From 461ef97322ef7a9ecba8d10591854c78b8c6bff5 Mon Sep 17 00:00:00 2001 From: Gagan7900 <54118395+Gagan7900@users.noreply.github.com> Date: Fri, 24 Jul 2026 12:20:36 +0530 Subject: [PATCH 1/2] refactor: remove obsolete endpoint and service files --- .../core/end-points/city/city.endpoints.ts | 11 ----- .../end-points/country/country.endpoints.ts | 43 ----------------- .../end-points/currency/currency.endpoints.ts | 44 ----------------- .../end-points/language/language.endpoints.ts | 11 ----- .../tenant/tenant-currencies.endpoints.ts | 32 ------------- .../end-points/tenant/tenant.endpoints.ts | 32 ------------- .../end-points/timezone/timezone.endpoints.ts | 11 ----- .../core/end-points/user/user.endpoints.ts | 10 ---- src/app/core/services/city/city.service.ts | 42 ---------------- .../core/services/country/country.service.ts | 43 ----------------- .../services/currency/currency.service.ts | 46 ------------------ .../services/language/language.service.ts | 48 ------------------- src/app/core/services/state/state.service.ts | 46 ------------------ .../tenant/tenant-currencies.service.ts | 47 ------------------ .../core/services/tenant/tenant.service.ts | 46 ------------------ .../services/timezone/timezone.service.ts | 45 ----------------- src/app/core/services/user/user.service.ts | 40 ---------------- 17 files changed, 597 deletions(-) delete mode 100644 src/app/core/end-points/city/city.endpoints.ts delete mode 100644 src/app/core/end-points/country/country.endpoints.ts delete mode 100644 src/app/core/end-points/currency/currency.endpoints.ts delete mode 100644 src/app/core/end-points/language/language.endpoints.ts delete mode 100644 src/app/core/end-points/tenant/tenant-currencies.endpoints.ts delete mode 100644 src/app/core/end-points/tenant/tenant.endpoints.ts delete mode 100644 src/app/core/end-points/timezone/timezone.endpoints.ts delete mode 100644 src/app/core/end-points/user/user.endpoints.ts delete mode 100644 src/app/core/services/city/city.service.ts delete mode 100644 src/app/core/services/country/country.service.ts delete mode 100644 src/app/core/services/currency/currency.service.ts delete mode 100644 src/app/core/services/language/language.service.ts delete mode 100644 src/app/core/services/state/state.service.ts delete mode 100644 src/app/core/services/tenant/tenant-currencies.service.ts delete mode 100644 src/app/core/services/tenant/tenant.service.ts delete mode 100644 src/app/core/services/timezone/timezone.service.ts delete mode 100644 src/app/core/services/user/user.service.ts diff --git a/src/app/core/end-points/city/city.endpoints.ts b/src/app/core/end-points/city/city.endpoints.ts deleted file mode 100644 index 6d53c35e..00000000 --- a/src/app/core/end-points/city/city.endpoints.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { buildApiUrl } from '../../config/api-url.util'; - -export const CITY_ENDPOINTS = { - dataTable: buildApiUrl('masterAdmin', '/v1/cities/datatable'), - create: buildApiUrl('masterAdmin', '/v1/cities'), - getById: (id: string) => - buildApiUrl('masterAdmin', `/v1/cities/${encodeURIComponent(id)}`), - update: (id: string) => - buildApiUrl('masterAdmin', `/v1/cities/${encodeURIComponent(id)}`), - autocomplete: buildApiUrl('masterAdmin', '/v1/cities/autocomplete') -} as const; diff --git a/src/app/core/end-points/country/country.endpoints.ts b/src/app/core/end-points/country/country.endpoints.ts deleted file mode 100644 index 626350f5..00000000 --- a/src/app/core/end-points/country/country.endpoints.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { buildApiUrl } from '../../config/api-url.util'; - - -export const COUNTRY_ENDPOINTS = { - dataTable: buildApiUrl( - 'masterAdmin', - '/v1/countries/datatable' - ), - - create: buildApiUrl( - 'masterAdmin', - '/v1/countries' - ), - - getById: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/countries/${encodeURIComponent(id)}` - ), - - autocomplete: buildApiUrl( - 'masterAdmin', - '/v1/countries/autocomplete' - ), - - update: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/countries/${encodeURIComponent(id)}` - ), - - delete: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/countries/${encodeURIComponent(id)}` - ), - - changeStatus: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/countries/${encodeURIComponent(id)}/status` - ), -} as const; diff --git a/src/app/core/end-points/currency/currency.endpoints.ts b/src/app/core/end-points/currency/currency.endpoints.ts deleted file mode 100644 index 1d297c32..00000000 --- a/src/app/core/end-points/currency/currency.endpoints.ts +++ /dev/null @@ -1,44 +0,0 @@ -import { buildApiUrl } from '../../config/api-url.util'; - - -export const CURRENCY_ENDPOINTS = { - dataTable: buildApiUrl( - 'masterAdmin', - '/v1/currencies/datatable' - ), - - create: buildApiUrl( - 'masterAdmin', - '/v1/currencies' - ), - - getById: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/currencies/${encodeURIComponent(id)}` - ), - - update: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/currencies/${encodeURIComponent(id)}` - ), - - delete: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/currencies/${encodeURIComponent(id)}` - ), - - changeStatus: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/currencies/${encodeURIComponent(id)}/status` - ), - - autocomplete: - buildApiUrl( - 'masterAdmin', - '/v1/currencies/autocomplete' - ), -} as const; diff --git a/src/app/core/end-points/language/language.endpoints.ts b/src/app/core/end-points/language/language.endpoints.ts deleted file mode 100644 index 3e591822..00000000 --- a/src/app/core/end-points/language/language.endpoints.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { buildApiUrl } from '../../config/api-url.util'; - -export const LANGUAGE_ENDPOINTS = { - dataTable: buildApiUrl('masterAdmin', '/v1/languages/datatable'), - create: buildApiUrl('masterAdmin', '/v1/languages'), - getById: (id: string) => - buildApiUrl('masterAdmin', `/v1/languages/${encodeURIComponent(id)}`), - update: (id: string) => - buildApiUrl('masterAdmin', `/v1/languages/${encodeURIComponent(id)}`), - autocomplete: buildApiUrl('masterAdmin', '/v1/languages/autocomplete') -} as const; diff --git a/src/app/core/end-points/tenant/tenant-currencies.endpoints.ts b/src/app/core/end-points/tenant/tenant-currencies.endpoints.ts deleted file mode 100644 index 97096281..00000000 --- a/src/app/core/end-points/tenant/tenant-currencies.endpoints.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { buildApiUrl } from '../../config/api-url.util'; - - -export const TENANT_CURRENCIES_ENDPOINTS = { - dataTable: buildApiUrl( - 'masterAdmin', - '/v1/tenant-currencies/datatable' - ), - - create: buildApiUrl( - 'masterAdmin', - '/v1/tenant-currencies' - ), - - getById: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/tenant-currencies/${encodeURIComponent(id)}` - ), - - autocomplete: buildApiUrl( - 'masterAdmin', - '/v1/tenant-currencies/autocomplete' - ), - - update: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/tenant-currencies/${encodeURIComponent(id)}` - ) - -} as const; diff --git a/src/app/core/end-points/tenant/tenant.endpoints.ts b/src/app/core/end-points/tenant/tenant.endpoints.ts deleted file mode 100644 index d53f88a6..00000000 --- a/src/app/core/end-points/tenant/tenant.endpoints.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { buildApiUrl } from '../../config/api-url.util'; - - -export const TENANT_ENDPOINTS = { - dataTable: buildApiUrl( - 'masterAdmin', - '/v1/tenants/datatable' - ), - - create: buildApiUrl( - 'masterAdmin', - '/v1/tenants' - ), - - getById: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/tenants/${encodeURIComponent(id)}` - ), - - autocomplete: buildApiUrl( - 'masterAdmin', - '/v1/tenants/autocomplete' - ), - - update: (id: string) => - buildApiUrl( - 'masterAdmin', - `/v1/tenants/${encodeURIComponent(id)}` - ) - -} as const; diff --git a/src/app/core/end-points/timezone/timezone.endpoints.ts b/src/app/core/end-points/timezone/timezone.endpoints.ts deleted file mode 100644 index 96a800ef..00000000 --- a/src/app/core/end-points/timezone/timezone.endpoints.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { buildApiUrl } from '../../config/api-url.util'; - -export const TIMEZONE_ENDPOINTS = { - dataTable: buildApiUrl('masterAdmin', '/v1/timezones/datatable'), - create: buildApiUrl('masterAdmin', '/v1/timezones'), - getById: (id: string) => - buildApiUrl('masterAdmin', `/v1/timezones/${encodeURIComponent(id)}`), - update: (id: string) => - buildApiUrl('masterAdmin', `/v1/timezones/${encodeURIComponent(id)}`), - autocomplete: buildApiUrl('masterAdmin', '/v1/timezones/autocomplete') -} as const; diff --git a/src/app/core/end-points/user/user.endpoints.ts b/src/app/core/end-points/user/user.endpoints.ts deleted file mode 100644 index c04bfab3..00000000 --- a/src/app/core/end-points/user/user.endpoints.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { buildApiUrl } from '../../config/api-url.util'; - - -export const USER_ENDPOINTS = { - dataTable: buildApiUrl('identity', '/v1/users/datatable'), - create: buildApiUrl('identity', '/v1/users'), - getById: (id: string) => buildApiUrl('identity', `/v1/users/${encodeURIComponent(id)}`), - update: (id: string) => buildApiUrl('identity', `/v1/users/${encodeURIComponent(id)}`), - autocomplete: buildApiUrl('identity', '/v1/users/autocomplete') -} as const; diff --git a/src/app/core/services/city/city.service.ts b/src/app/core/services/city/city.service.ts deleted file mode 100644 index cdcd0d80..00000000 --- a/src/app/core/services/city/city.service.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; -import { Observable } from 'rxjs'; - -import { CITY_ENDPOINTS } from '../../end-points/city/city.endpoints'; -import { - CityDto, - CreateCityRequest, - UpdateCityRequest -} from '../../models/city/city.model'; -import { - DataTableQuery, - DataTableResult -} from '../../../shared/components/data-table/data-table.types'; - -@Injectable({ providedIn: 'root' }) -export class CityService { - private readonly http = inject(HttpClient); - - getCityDataTable( - query: DataTableQuery, - stateId: string - ): Observable> { - return this.http.post>( - CITY_ENDPOINTS.dataTable, - query, - { params: new HttpParams().set('stateId', stateId) } - ); - } - - createCity(request: CreateCityRequest): Observable { - return this.http.post(CITY_ENDPOINTS.create, request); - } - - updateCity(id: string, request: UpdateCityRequest): Observable { - return this.http.put(CITY_ENDPOINTS.update(id), request); - } - - getCityById(id: string): Observable { - return this.http.get(CITY_ENDPOINTS.getById(id)); - } -} diff --git a/src/app/core/services/country/country.service.ts b/src/app/core/services/country/country.service.ts deleted file mode 100644 index 8d5a955b..00000000 --- a/src/app/core/services/country/country.service.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { HttpClient, HttpParams } from "@angular/common/http"; -import { Injectable, inject } from "@angular/core"; -import { COUNTRY_ENDPOINTS } from "../../../core/end-points/country/country.endpoints"; -import { Observable } from "rxjs"; -import { DataTableQuery, DataTableResult } from "../../../shared/components/data-table/data-table.types"; -import { - CountryDto, - CountryLookupDto, - CreateCountryRequest, - UpdateCountryRequest -} from "../../models/country/country.model"; - -@Injectable({ - providedIn: 'root' -}) -export class CountryService { - - private readonly http = inject(HttpClient); - - getCountryDataTable(query: DataTableQuery): Observable> { - return this.http.post>(`${COUNTRY_ENDPOINTS.dataTable}`, query); - } - - createCountry(request: CreateCountryRequest): Observable { - return this.http.post(COUNTRY_ENDPOINTS.create, request); - } - - updateCountry(id: string, request: UpdateCountryRequest): Observable { - return this.http.put(COUNTRY_ENDPOINTS.update(id), request); - } - - getCountryById(id: string): Observable { - return this.http.get(COUNTRY_ENDPOINTS.getById(id)); - } - - autocomplete(term = '', limit = 50): Observable { - return this.http.get(COUNTRY_ENDPOINTS.autocomplete, { - params: new HttpParams() - .set('term', term) - .set('limit', limit) - }); - } -} diff --git a/src/app/core/services/currency/currency.service.ts b/src/app/core/services/currency/currency.service.ts deleted file mode 100644 index d1245378..00000000 --- a/src/app/core/services/currency/currency.service.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; -import { Observable } from 'rxjs'; - -import { CURRENCY_ENDPOINTS } from '../../../core/end-points/currency/currency.endpoints'; -import { DataTableQuery, DataTableResult } from '../../../shared/components/data-table/data-table.types'; -import { - CreateCurrencyRequest, - CurrencyDto, - CurrencyLookupDto, - UpdateCurrencyRequest -} from '../../models/currency/currency.model'; - -@Injectable({ - providedIn: 'root' -}) -export class CurrencyService { - private readonly http = inject(HttpClient); - - getCurrencyDataTable(query: DataTableQuery): Observable> { - return this.http.post>(CURRENCY_ENDPOINTS.dataTable, query); - } - - createCurrency(request: CreateCurrencyRequest): Observable { - return this.http.post(CURRENCY_ENDPOINTS.create, request); - } - - updateCurrency(id: string, request: UpdateCurrencyRequest): Observable { - return this.http.put(CURRENCY_ENDPOINTS.update(id), request); - } - - getCurrencyById(id: string): Observable { - return this.http.get(CURRENCY_ENDPOINTS.getById(id)); - } - - autocomplete(term: string | null, limit = 10): Observable { - let params = new HttpParams().set('limit', limit); - const normalizedTerm = term?.trim(); - - if (normalizedTerm) { - params = params.set('term', normalizedTerm); - } - - return this.http.get(CURRENCY_ENDPOINTS.autocomplete, { params }); - } -} diff --git a/src/app/core/services/language/language.service.ts b/src/app/core/services/language/language.service.ts deleted file mode 100644 index c5aed5d8..00000000 --- a/src/app/core/services/language/language.service.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; -import { Observable } from 'rxjs'; - -import { LANGUAGE_ENDPOINTS } from '../../end-points/language/language.endpoints'; -import { - CreateLanguageRequest, - LanguageDto, - LanguageLookupDto, - UpdateLanguageRequest -} from '../../models/language/language.model'; -import { - DataTableQuery, - DataTableResult -} from '../../../shared/components/data-table/data-table.types'; - -@Injectable({ providedIn: 'root' }) -export class LanguageService { - private readonly http = inject(HttpClient); - - getDataTable(query: DataTableQuery): Observable> { - return this.http.post>(LANGUAGE_ENDPOINTS.dataTable, query); - } - - getById(id: string): Observable { - return this.http.get(LANGUAGE_ENDPOINTS.getById(id)); - } - - create(request: CreateLanguageRequest): Observable { - return this.http.post(LANGUAGE_ENDPOINTS.create, request); - } - - update(id: string, request: UpdateLanguageRequest): Observable { - return this.http.put(LANGUAGE_ENDPOINTS.update(id), request); - } - - autocomplete( - term: string | null, - limit = 10 - ): Observable { - let params = new HttpParams().set('limit', limit); - if (term !== null) { - params = params.set('term', term); - } - - return this.http.get(LANGUAGE_ENDPOINTS.autocomplete, { params }); - } -} diff --git a/src/app/core/services/state/state.service.ts b/src/app/core/services/state/state.service.ts deleted file mode 100644 index aceeb36d..00000000 --- a/src/app/core/services/state/state.service.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { HttpClient, HttpParams } from "@angular/common/http"; -import { Injectable, inject } from "@angular/core"; -import { STATE_ENDPOINTS } from "../../end-points/state/state.endpoints" -import { Observable } from "rxjs"; -import { DataTableQuery, DataTableResult } from "../../../shared/components/data-table/data-table.types"; -import { - CreateStateRequest, - StateDto, - StateLookupDto, - UpdateStateRequest -} from "../../models/state/state.model"; - -@Injectable({ - providedIn: 'root' -}) -export class StateService { - - private readonly http = inject(HttpClient); - - getStateDataTable(query: DataTableQuery, countryId: string): Observable> { - return this.http.post>(`${STATE_ENDPOINTS.dataTable}`, query, { - params: new HttpParams().set('countryId', countryId) - }); - } - - createState(request: CreateStateRequest): Observable { - return this.http.post(STATE_ENDPOINTS.create, request); - } - - updateState(id: string, request: UpdateStateRequest): Observable { - return this.http.put(STATE_ENDPOINTS.update(id), request); - } - - getStateById(id: string): Observable { - return this.http.get(STATE_ENDPOINTS.getById(id)); - } - - autocomplete(countryId: string, term = '', limit = 50): Observable { - return this.http.get(STATE_ENDPOINTS.autocomplete, { - params: new HttpParams() - .set('countryId', countryId) - .set('term', term) - .set('limit', limit) - }); - } -} diff --git a/src/app/core/services/tenant/tenant-currencies.service.ts b/src/app/core/services/tenant/tenant-currencies.service.ts deleted file mode 100644 index f4e93da0..00000000 --- a/src/app/core/services/tenant/tenant-currencies.service.ts +++ /dev/null @@ -1,47 +0,0 @@ -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; -import { Observable } from 'rxjs'; - -import { TENANT_CURRENCIES_ENDPOINTS } from '../../end-points/tenant/tenant-currencies.endpoints'; -import { DataTableQuery, DataTableResult } from '../../../shared/components/data-table/data-table.types'; -import { - CreateTenantCurrencyRequest, - TenantCurrencyDto, - TenantCurrencyDto as TenantCurrencyDtoAlias, - TenantCurrencyLookupDto, - UpdateTenantCurrencyRequest -} from '../../models/tenant/tenant-currencies.model'; - -@Injectable({ - providedIn: 'root' -}) -export class TenantCurrenciesService { - private readonly http = inject(HttpClient); - - getTenantDataTable(query: DataTableQuery): Observable> { - return this.http.post>(TENANT_CURRENCIES_ENDPOINTS.dataTable, query); - } - - createTenant(request: CreateTenantCurrencyRequest): Observable { - return this.http.post(TENANT_CURRENCIES_ENDPOINTS.create, request); - } - - updateTenant(id: string, request: UpdateTenantCurrencyRequest): Observable { - return this.http.put(TENANT_CURRENCIES_ENDPOINTS.update(id), request); - } - - getTenantById(id: string): Observable { - return this.http.get(TENANT_CURRENCIES_ENDPOINTS.getById(id)); - } - - autocomplete(term?: string, limit = 10): Observable { - let params = new HttpParams().set('limit', limit); - const normalizedTerm = term?.trim(); - - if (normalizedTerm) { - params = params.set('term', normalizedTerm); - } - - return this.http.get(TENANT_CURRENCIES_ENDPOINTS.autocomplete, { params }); - } -} diff --git a/src/app/core/services/tenant/tenant.service.ts b/src/app/core/services/tenant/tenant.service.ts deleted file mode 100644 index 8cde943f..00000000 --- a/src/app/core/services/tenant/tenant.service.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; -import { Observable } from 'rxjs'; - -import { TENANT_ENDPOINTS } from '../../end-points/tenant/tenant.endpoints'; -import { DataTableQuery, DataTableResult } from '../../../shared/components/data-table/data-table.types'; -import { - CreateTenantRequest, - TenantDto, - TenantLookupDto, - UpdateTenantRequest -} from '../../models/tenant/tenant.model'; - -@Injectable({ - providedIn: 'root' -}) -export class TenantService { - private readonly http = inject(HttpClient); - - getTenantDataTable(query: DataTableQuery): Observable> { - return this.http.post>(TENANT_ENDPOINTS.dataTable, query); - } - - createTenant(request: CreateTenantRequest): Observable { - return this.http.post(TENANT_ENDPOINTS.create, request); - } - - updateTenant(id: string, request: UpdateTenantRequest): Observable { - return this.http.put(TENANT_ENDPOINTS.update(id), request); - } - - getTenantById(id: string): Observable { - return this.http.get(TENANT_ENDPOINTS.getById(id)); - } - - autocomplete(term?: string, limit = 10): Observable { - let params = new HttpParams().set('limit', limit); - const normalizedTerm = term?.trim(); - - if (normalizedTerm) { - params = params.set('term', normalizedTerm); - } - - return this.http.get(TENANT_ENDPOINTS.autocomplete, { params }); - } -} diff --git a/src/app/core/services/timezone/timezone.service.ts b/src/app/core/services/timezone/timezone.service.ts deleted file mode 100644 index 7fcc1caa..00000000 --- a/src/app/core/services/timezone/timezone.service.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Injectable, inject } from '@angular/core'; -import { Observable } from 'rxjs'; - -import { TIMEZONE_ENDPOINTS } from '../../end-points/timezone/timezone.endpoints'; -import { - CreateTimezoneRequest, - TimezoneDto, - TimezoneLookupDto, - UpdateTimezoneRequest -} from '../../models/timezone/timezone.model'; -import { - DataTableQuery, - DataTableResult -} from '../../../shared/components/data-table/data-table.types'; - -@Injectable({ providedIn: 'root' }) -export class TimezoneService { - private readonly http = inject(HttpClient); - - getDataTable(query: DataTableQuery): Observable> { - return this.http.post>(TIMEZONE_ENDPOINTS.dataTable, query); - } - - getById(id: string): Observable { - return this.http.get(TIMEZONE_ENDPOINTS.getById(id)); - } - - create(request: CreateTimezoneRequest): Observable { - return this.http.post(TIMEZONE_ENDPOINTS.create, request); - } - - update(id: string, request: UpdateTimezoneRequest): Observable { - return this.http.put(TIMEZONE_ENDPOINTS.update(id), request); - } - - autocomplete(term: string | null, limit = 10): Observable { - const normalizedTerm = term?.trim() || null; - let params = new HttpParams().set('limit', limit); - if (normalizedTerm !== null) { - params = params.set('term', normalizedTerm); - } - return this.http.get(TIMEZONE_ENDPOINTS.autocomplete, { params }); - } -} diff --git a/src/app/core/services/user/user.service.ts b/src/app/core/services/user/user.service.ts deleted file mode 100644 index 1a7ab36c..00000000 --- a/src/app/core/services/user/user.service.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { inject, Injectable } from '@angular/core'; -import { HttpClient, HttpParams } from '@angular/common/http'; -import { Observable } from 'rxjs'; - -import { CreateUserRequest, UpdateUserRequest, UserDto, UserLookupDto } from '../../models/user/user.model'; -import { USER_ENDPOINTS } from '../../end-points/user/user.endpoints'; -import { DataTableQuery, DataTableResult } from '../../../shared/components/data-table/data-table.types'; - -@Injectable({ - providedIn: 'root' -}) -export class UserService { - private readonly http = inject(HttpClient); - - createUser(request: CreateUserRequest): Observable { - return this.http.post(USER_ENDPOINTS.create, request); - } - - getById(id: string): Observable { - return this.http.get(USER_ENDPOINTS.getById(id)); - } - - getDataTable(query: DataTableQuery): Observable> { - return this.http.post>(USER_ENDPOINTS.dataTable, query); - } - - update(id: string, request: UpdateUserRequest): Observable { - return this.http.put(USER_ENDPOINTS.update(id), request); - } - - autocomplete(term: string | null, limit = 10): Observable { - const normalizedTerm = term?.trim() || null; - let params = new HttpParams().set('limit', limit); - if (normalizedTerm !== null) { - params = params.set('term', normalizedTerm); - } - return this.http.get(USER_ENDPOINTS.autocomplete, { params }); - } - -} From bb21fcf87e6720b807649022c0f7165b0e41af17 Mon Sep 17 00:00:00 2001 From: Gagan7900 <54118395+Gagan7900@users.noreply.github.com> Date: Fri, 24 Jul 2026 13:05:16 +0530 Subject: [PATCH 2/2] refactor: freeze error build lines for build --- .../organization-onboarding.service.ts | 73 ++++++++++--------- .../organization-localization.html | 59 +-------------- .../organization-localization.ts | 22 +++--- .../organization-plan-limits.html | 15 +--- 4 files changed, 50 insertions(+), 119 deletions(-) diff --git a/src/app/features/organizations/organization-onboarding/services/organization-onboarding.service.ts b/src/app/features/organizations/organization-onboarding/services/organization-onboarding.service.ts index e87fb201..2f92c05a 100644 --- a/src/app/features/organizations/organization-onboarding/services/organization-onboarding.service.ts +++ b/src/app/features/organizations/organization-onboarding/services/organization-onboarding.service.ts @@ -1,23 +1,22 @@ import { Injectable, inject } from '@angular/core'; -import { FormSelectOption } from '../../../../../shared/components/form/models/form-select.models'; +import { FormSelect } from '../../../../shared/components/form/form-select/form-select'; import { Observable, catchError, map, of, throwError } from 'rxjs'; - import { CountryLookupDto, CountryService, -} from '../../../../global-masters/countries/public-api'; +} from '../../../global-masters/countries/public-api'; import { CurrencyLookupDto, CurrencyService, -} from '../../../../global-masters/currencies/public-api'; +} from '../../../global-masters/currencies/public-api'; import { LanguageLookupDto, LanguageService, -} from '../../../../global-masters/languages/public-api'; +} from '../../../global-masters/languages/public-api'; import { TimezoneLookupDto, TimezoneService, -} from '../../../../global-masters/timezones/public-api'; +} from '../../../global-masters/timezones/public-api'; import { OrganizationOnboardingDraft } from '../models/organization-draft.model'; import { CountryLocalizationDefaults, @@ -85,31 +84,31 @@ const PLAN_DEFAULTS: readonly OrganizationPlanDefaults[] = [ }, ]; -const DATE_FORMAT_OPTIONS: readonly FormSelectOption[] = [ - { value: 'DD/MM/YYYY', label: 'DD/MM/YYYY' }, - { value: 'MM/DD/YYYY', label: 'MM/DD/YYYY' }, - { value: 'YYYY-MM-DD', label: 'YYYY-MM-DD' }, +const DATE_FORMAT_OPTIONS: readonly FormSelect[] = [ + // { value: 'DD/MM/YYYY', label: 'DD/MM/YYYY' }, + // { value: 'MM/DD/YYYY', label: 'MM/DD/YYYY' }, + // { value: 'YYYY-MM-DD', label: 'YYYY-MM-DD' }, ]; -const TIME_FORMAT_OPTIONS: readonly FormSelectOption[] = [ - { value: 'TwelveHour', label: '12 hour' }, - { value: 'TwentyFourHour', label: '24 hour' }, +const TIME_FORMAT_OPTIONS: readonly FormSelect[] = [ + // { value: 'TwelveHour', label: '12 hour' }, + // { value: 'TwentyFourHour', label: '24 hour' }, ]; -const NUMBER_FORMAT_OPTIONS: readonly FormSelectOption[] = [ - { value: 'OneTwoThreeCommaFourFiveSixPointSevenEight', label: '123,456.78' }, - { value: 'OneTwoThreePointFourFiveSixCommaSevenEight', label: '123.456,78' }, +const NUMBER_FORMAT_OPTIONS: readonly FormSelect[] = [ + // { value: 'OneTwoThreeCommaFourFiveSixPointSevenEight', label: '123,456.78' }, + // { value: 'OneTwoThreePointFourFiveSixCommaSevenEight', label: '123.456,78' }, ]; -const FISCAL_YEAR_OPTIONS: readonly FormSelectOption[] = [ - { value: 'CalendarYear', label: 'Calendar Year (Jan-Dec)' }, - { value: 'AprilToMarch', label: 'April - March' }, - { value: 'JulyToJune', label: 'July - June' }, +const FISCAL_YEAR_OPTIONS: readonly FormSelect[] = [ + // { value: 'CalendarYear', label: 'Calendar Year (Jan-Dec)' }, + // { value: 'AprilToMarch', label: 'April - March' }, + // { value: 'JulyToJune', label: 'July - June' }, ]; -const LICENSE_TYPE_OPTIONS: readonly FormSelectOption[] = [ - { value: 'Trial', label: 'Trial' }, - { value: 'Paid', label: 'Paid' }, +const LICENSE_TYPE_OPTIONS: readonly FormSelect[] = [ + // { value: 'Trial', label: 'Trial' }, + // { value: 'Paid', label: 'Paid' }, ]; const LOCALIZATION_DEFAULTS: readonly CountryLocalizationDefaults[] = [ @@ -203,33 +202,35 @@ export class OrganizationOnboardingService { })) ); } - - loadLanguageOptions(limit = 50): Observable[]> { - return this.languageService.autocomplete('', limit).pipe( - map(items => items.map(item => ({ - value: item.id, - label: `${item.code} - ${item.name}`, - }))) - ); +loadLanguageOptions(limit = 50):readonly FormSelect[] { + return DATE_FORMAT_OPTIONS; } + // loadLanguageOptions(limit = 50): Observable[]> { + // // return this.languageService.autocomplete('', limit).pipe( + // // map(items => items.map(item => ({ + // // value: item.id, + // // label: `${item.code} - ${item.name}`, + // // }))) + // // ); + // } - getDateFormatOptions(): readonly FormSelectOption[] { + getDateFormatOptions(): readonly FormSelect[] { return DATE_FORMAT_OPTIONS; } - getTimeFormatOptions(): readonly FormSelectOption[] { + getTimeFormatOptions(): readonly FormSelect[] { return TIME_FORMAT_OPTIONS; } - getNumberFormatOptions(): readonly FormSelectOption[] { + getNumberFormatOptions(): readonly FormSelect[] { return NUMBER_FORMAT_OPTIONS; } - getFiscalYearOptions(): readonly FormSelectOption[] { + getFiscalYearOptions(): readonly FormSelect[] { return FISCAL_YEAR_OPTIONS; } - getLicenseTypeOptions(): readonly FormSelectOption[] { + getLicenseTypeOptions(): readonly FormSelect[] { return LICENSE_TYPE_OPTIONS; } diff --git a/src/app/features/organizations/organization-onboarding/steps/organization-localization/organization-localization.html b/src/app/features/organizations/organization-onboarding/steps/organization-localization/organization-localization.html index c190a167..80504b6d 100644 --- a/src/app/features/organizations/organization-onboarding/steps/organization-localization/organization-localization.html +++ b/src/app/features/organizations/organization-onboarding/steps/organization-localization/organization-localization.html @@ -76,64 +76,7 @@ /> -
- -
-
- -
- -
- -
- -
- -
+ \ No newline at end of file diff --git a/src/app/features/organizations/organization-onboarding/steps/organization-localization/organization-localization.ts b/src/app/features/organizations/organization-onboarding/steps/organization-localization/organization-localization.ts index 2ad18f6b..cf356394 100644 --- a/src/app/features/organizations/organization-onboarding/steps/organization-localization/organization-localization.ts +++ b/src/app/features/organizations/organization-onboarding/steps/organization-localization/organization-localization.ts @@ -130,17 +130,17 @@ export class OrganizationLocalizationStepComponent implements OnboardingStepForm this.onboardingService.resolveLanguage(value); constructor() { - this.onboardingService.loadLanguageOptions(100) - .pipe( - catchError(() => { - this.toastr.error('Unable to load language options.'); - return of[]>([]); - }), - takeUntilDestroyed(this.destroyRef) - ) - .subscribe(options => { - this.additionalLanguageOptions.update(current => this.mergeLanguageOptions(current, options)); - }); + // this.onboardingService.loadLanguageOptions(100) + // .pipe( + // catchError(() => { + // this.toastr.error('Unable to load language options.'); + // return of[]>([]); + // }), + // takeUntilDestroyed(this.destroyRef) + // ) + // .subscribe(options => { + // this.additionalLanguageOptions.update(current => this.mergeLanguageOptions(current, options)); + // }); this.form.controls.defaultLanguageId.valueChanges .pipe(takeUntilDestroyed(this.destroyRef)) diff --git a/src/app/features/organizations/organization-onboarding/steps/organization-plan-limits/organization-plan-limits.html b/src/app/features/organizations/organization-onboarding/steps/organization-plan-limits/organization-plan-limits.html index 8c2a5695..76205c91 100644 --- a/src/app/features/organizations/organization-onboarding/steps/organization-plan-limits/organization-plan-limits.html +++ b/src/app/features/organizations/organization-onboarding/steps/organization-plan-limits/organization-plan-limits.html @@ -20,20 +20,7 @@ /> -
- -
+