Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelPelegrina committed May 14, 2024
1 parent b85ae2a commit 195103c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 36 deletions.
2 changes: 1 addition & 1 deletion src/app/components/footer/footer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export class FooterComponent {
constructor(@Inject(DOCUMENT) private document: Document) { }

protected goToDocumentation(): void {
this.document.location.href = StringValues.API_SPECIFICATION;
this.document.location.href = StringValues.DOCUMENTATION;
}
}
70 changes: 35 additions & 35 deletions src/app/shared/utils/string-values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,101 +6,101 @@ export const ANIMATION_DURATION = '225ms cubic-bezier(0.4, 0.0, 0.2, 1)';
* Class containing all default values and shared URLs.
*/
export class StringValues{
public static BASE_URL: string = 'http://localhost:8081';
public static API_SPECIFICATION: string = 'https://miguelpelegrina.github.io/java_school_online_store_documentation/';
public static BASE_URL = 'http://localhost:8081';
public static DOCUMENTATION = 'https://miguelpelegrina.github.io/java_school_online_store_documentation/';

/////////////////////////////////////////////////////
// Authentication
/////////////////////////////////////////////////////
private static AUTH_URL: string = '/auth';
private static LOGIN_URL: string = '/login'
private static REGISTER_URL: string = '/register'
public static BASE_LOGIN_URL: string = `${this.BASE_URL}${this.AUTH_URL}${this.LOGIN_URL}`
public static BASE_REGISTER_URL: string = `${this.BASE_URL}${this.AUTH_URL}${this.REGISTER_URL}`
private static AUTH_URL = '/auth';
private static LOGIN_URL = '/login'
private static REGISTER_URL = '/register'
public static BASE_LOGIN_URL = `${this.BASE_URL}${this.AUTH_URL}${this.LOGIN_URL}`
public static BASE_REGISTER_URL = `${this.BASE_URL}${this.AUTH_URL}${this.REGISTER_URL}`

/////////////////////////////////////////////////////
// Books
/////////////////////////////////////////////////////
public static BOOK_URL: string = '/books';
public static BASE_BOOK_URL: string = `${this.BASE_URL}${this.BOOK_URL}`;
public static BOOK_URL = '/books';
public static BASE_BOOK_URL = `${this.BASE_URL}${this.BOOK_URL}`;

/////////////////////////////////////////////////////
// Book formats
/////////////////////////////////////////////////////
public static BOOK_FORMAT_URL: string = '/book_parameters_format';
public static BASE_BOOK_FORMAT_URL: string = `${this.BASE_URL}${this.BOOK_FORMAT_URL}`;
public static BOOK_FORMAT_URL = '/book_parameters_format';
public static BASE_BOOK_FORMAT_URL = `${this.BASE_URL}${this.BOOK_FORMAT_URL}`;

/////////////////////////////////////////////////////
// Book genres
/////////////////////////////////////////////////////
public static BOOK_GENRE_URL: string = '/book_genres';
public static BASE_BOOK_GENRE_URL: string = `${this.BASE_URL}${this.BOOK_GENRE_URL}`;
public static BOOK_GENRE_URL = '/book_genres';
public static BASE_BOOK_GENRE_URL = `${this.BASE_URL}${this.BOOK_GENRE_URL}`;

//////////////////////////////////////////////////////
// Cities
//////////////////////////////////////////////////////
public static CITIES_URL: string = '/cities';
public static BASE_CITY_URL: string = `${this.BASE_URL}${this.CITIES_URL}`;
public static CITIES_URL = '/cities';
public static BASE_CITY_URL = `${this.BASE_URL}${this.CITIES_URL}`;

//////////////////////////////////////////////////////
// Countries
//////////////////////////////////////////////////////
public static COUNTRY_URL: string = '/countries';
public static BASE_COUNTRY_URL: string = `${this.BASE_URL}${this.COUNTRY_URL}`;
public static COUNTRY_URL = '/countries';
public static BASE_COUNTRY_URL = `${this.BASE_URL}${this.COUNTRY_URL}`;

/////////////////////////////////////////////////////
// Delivery methods
/////////////////////////////////////////////////////
public static DELIVERY_METHODS_URL: string = '/delivery_methods';
public static BASE_DELIVERY_METHODS_URL: string = `${this.BASE_URL}${this.DELIVERY_METHODS_URL}`;
public static DELIVERY_METHODS_URL = '/delivery_methods';
public static BASE_DELIVERY_METHODS_URL = `${this.BASE_URL}${this.DELIVERY_METHODS_URL}`;

/////////////////////////////////////////////////////
// Order statuses
/////////////////////////////////////////////////////
public static ORDER_STATUSES_URL: string = '/order_statuses';
public static BASE_ORDER_STATUSES_URL: string = `${this.BASE_URL}${this.ORDER_STATUSES_URL}`;
public static ORDER_STATUSES_URL = '/order_statuses';
public static BASE_ORDER_STATUSES_URL = `${this.BASE_URL}${this.ORDER_STATUSES_URL}`;

/////////////////////////////////////////////////////
// Orders
/////////////////////////////////////////////////////
public static ORDER_URL: string = '/orders';
public static BASE_ORDER_URL: string = `${this.BASE_URL}${this.ORDER_URL}`;
public static ORDER_URL = '/orders';
public static BASE_ORDER_URL = `${this.BASE_URL}${this.ORDER_URL}`;

/////////////////////////////////////////////////////
// Payment methods
/////////////////////////////////////////////////////
public static PAYMENT_METHODS_URL: string = '/payment_methods';
public static BASE_PAYMENT_METHODS_URL: string = `${this.BASE_URL}${this.PAYMENT_METHODS_URL}`;
public static PAYMENT_METHODS_URL = '/payment_methods';
public static BASE_PAYMENT_METHODS_URL = `${this.BASE_URL}${this.PAYMENT_METHODS_URL}`;

/////////////////////////////////////////////////////
// Payment statuses
/////////////////////////////////////////////////////
public static PAYMENT_STATUS_URL: string = '/payment_statuses';
public static BASE_PAYMENT_STATUS_URL: string = `${this.BASE_URL}${this.PAYMENT_STATUS_URL}`;
public static PAYMENT_STATUS_URL = '/payment_statuses';
public static BASE_PAYMENT_STATUS_URL = `${this.BASE_URL}${this.PAYMENT_STATUS_URL}`;

/////////////////////////////////////////////////////
// Postal codes
/////////////////////////////////////////////////////
public static POSTAL_CODE_URL: string = '/postal_codes';
public static BASE_POSTAL_CODE_URL: string = `${this.BASE_URL}${this.POSTAL_CODE_URL}`;
public static POSTAL_CODE_URL = '/postal_codes';
public static BASE_POSTAL_CODE_URL = `${this.BASE_URL}${this.POSTAL_CODE_URL}`;

/////////////////////////////////////////////////////
// User address
/////////////////////////////////////////////////////
public static USERS_URL: string = '/users';
public static BASE_USER_URL: string = `${this.BASE_URL}${this.USERS_URL}`;
public static USERS_URL = '/users';
public static BASE_USER_URL = `${this.BASE_URL}${this.USERS_URL}`;

/////////////////////////////////////////////////////
// User address
/////////////////////////////////////////////////////
public static USER_ADDRESSES_URL: string = '/user_addresses';
public static BASE_USER_ADDRESSES_URL: string = `${this.BASE_URL}${this.USER_ADDRESSES_URL}`;
public static USER_ADDRESSES_URL = '/user_addresses';
public static BASE_USER_ADDRESSES_URL = `${this.BASE_URL}${this.USER_ADDRESSES_URL}`;

/////////////////////////////////////////////////////
// Default values
////////////////////////////////////////////////////
public static DEFAULT_ORDER_STATUS_ON_ORDER: string = 'Pending payment';
public static DEFAULT_ORDER_STATUS_ON_ORDER = 'Pending payment';
public static DEFAULT_PAGE_SIZE = 12;
public static DEFAULT_PAGE_SIZE_OPTIONS = [1, 3, 6, 9, 12, 24, 36];
public static DEFAULT_PAYMENT_STATUS_ON_ORDER: string = 'Pending';
public static DEFAULT_PAYMENT_STATUS_ON_ORDER = 'Pending';
}

0 comments on commit 195103c

Please sign in to comment.