merge: retain latest local code while syncing company main
This commit is contained in:
@@ -45,3 +45,10 @@ __screenshots__/
|
|||||||
# System files
|
# System files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
|
||||||
|
# Ignore local ESLint config
|
||||||
|
eslint.config.js
|
||||||
|
|
||||||
|
# Ignore preview folder
|
||||||
|
preview/
|
||||||
+27
-6
@@ -3,7 +3,10 @@
|
|||||||
"version": 1,
|
"version": 1,
|
||||||
"cli": {
|
"cli": {
|
||||||
"packageManager": "npm",
|
"packageManager": "npm",
|
||||||
"analytics": "0b3da18f-5d81-4a09-9b2f-b0ce36040773"
|
"analytics": "0b3da18f-5d81-4a09-9b2f-b0ce36040773",
|
||||||
|
"schematicCollections": [
|
||||||
|
"angular-eslint"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"newProjectRoot": "projects",
|
"newProjectRoot": "projects",
|
||||||
"projects": {
|
"projects": {
|
||||||
@@ -23,7 +26,7 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"builder": "@angular/build:application",
|
"builder": "@angular/build:application",
|
||||||
"options": {
|
"options": {
|
||||||
"allowedCommonJsDependencies": [
|
"allowedCommonJsDependencies": [
|
||||||
"sweetalert2",
|
"sweetalert2",
|
||||||
"inputmask",
|
"inputmask",
|
||||||
"filepond",
|
"filepond",
|
||||||
@@ -53,13 +56,22 @@
|
|||||||
"src/.htaccess"
|
"src/.htaccess"
|
||||||
],
|
],
|
||||||
"styles": [
|
"styles": [
|
||||||
|
"node_modules/@ng-select/ng-select/themes/default.theme.css",
|
||||||
"src/styles.scss"
|
"src/styles.scss"
|
||||||
],
|
],
|
||||||
"scripts": ["node_modules/preline/dist/preline.js"]
|
"scripts": [
|
||||||
|
"node_modules/preline/dist/preline.js"
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"configurations": {
|
"configurations": {
|
||||||
"production": {
|
"production": {
|
||||||
"baseHref": "/angular/ynex-tailwind/preview/",
|
"fileReplacements": [
|
||||||
|
{
|
||||||
|
"replace": "src/environments/environment.ts",
|
||||||
|
"with": "src/environments/environment.prod.ts"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"baseHref": "/",
|
||||||
"budgets": [
|
"budgets": [
|
||||||
{
|
{
|
||||||
"type": "initial",
|
"type": "initial",
|
||||||
@@ -80,7 +92,7 @@
|
|||||||
"sourceMap": true
|
"sourceMap": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"defaultConfiguration": "production"
|
"defaultConfiguration": "development"
|
||||||
},
|
},
|
||||||
"serve": {
|
"serve": {
|
||||||
"builder": "@angular/build:dev-server",
|
"builder": "@angular/build:dev-server",
|
||||||
@@ -96,8 +108,17 @@
|
|||||||
},
|
},
|
||||||
"test": {
|
"test": {
|
||||||
"builder": "@angular/build:unit-test"
|
"builder": "@angular/build:unit-test"
|
||||||
|
},
|
||||||
|
"lint": {
|
||||||
|
"builder": "@angular-eslint/builder:lint",
|
||||||
|
"options": {
|
||||||
|
"lintFilePatterns": [
|
||||||
|
"src/**/*.ts",
|
||||||
|
"src/**/*.html"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+1789
File diff suppressed because it is too large
Load Diff
+9
-2
@@ -9,7 +9,8 @@
|
|||||||
"test": "ng test",
|
"test": "ng test",
|
||||||
"sass": "sass ./public/assets/scss:./public/assets/css/",
|
"sass": "sass ./public/assets/scss:./public/assets/css/",
|
||||||
"sass-min": "sass ./public/assets/scss:./public/assets/css/ --style compressed",
|
"sass-min": "sass ./public/assets/scss:./public/assets/css/ --style compressed",
|
||||||
"postcss": "sass ./public/assets/scss:./public/assets/css && postcss ./public/assets/css/*.css --dir ./public/assets/css"
|
"postcss": "sass ./public/assets/scss:./public/assets/css && postcss ./public/assets/css/*.css --dir ./public/assets/css",
|
||||||
|
"lint": "ng lint"
|
||||||
},
|
},
|
||||||
"prettier": {
|
"prettier": {
|
||||||
"printWidth": 100,
|
"printWidth": 100,
|
||||||
@@ -38,6 +39,7 @@
|
|||||||
"@angular/platform-browser": "^21.2.10",
|
"@angular/platform-browser": "^21.2.10",
|
||||||
"@angular/platform-browser-dynamic": "^21.2.10",
|
"@angular/platform-browser-dynamic": "^21.2.10",
|
||||||
"@angular/router": "^21.2.10",
|
"@angular/router": "^21.2.10",
|
||||||
|
"@ng-select/ng-select": "^21.8.2",
|
||||||
"@tailwindcss/forms": "^0.5.11",
|
"@tailwindcss/forms": "^0.5.11",
|
||||||
"@tsparticles/angular": "^3.0.0",
|
"@tsparticles/angular": "^3.0.0",
|
||||||
"apexcharts": "^5.10.5",
|
"apexcharts": "^5.10.5",
|
||||||
@@ -51,6 +53,7 @@
|
|||||||
"preline": "^4.1.2",
|
"preline": "^4.1.2",
|
||||||
"rxjs": "~7.8.0",
|
"rxjs": "~7.8.0",
|
||||||
"simplebar-angular": "^3.3.2",
|
"simplebar-angular": "^3.3.2",
|
||||||
|
"sweetalert2": "^11.26.25",
|
||||||
"tslib": "^2.3.0",
|
"tslib": "^2.3.0",
|
||||||
"tsparticles": "^3.9.1"
|
"tsparticles": "^3.9.1"
|
||||||
},
|
},
|
||||||
@@ -58,13 +61,17 @@
|
|||||||
"@angular/build": "^21.0.5",
|
"@angular/build": "^21.0.5",
|
||||||
"@angular/cli": "^21.0.5",
|
"@angular/cli": "^21.0.5",
|
||||||
"@angular/compiler-cli": "^21.2.10",
|
"@angular/compiler-cli": "^21.2.10",
|
||||||
|
"@eslint/js": "^10.0.1",
|
||||||
"@tailwindcss/postcss": "^4.2.2",
|
"@tailwindcss/postcss": "^4.2.2",
|
||||||
|
"angular-eslint": "21.4.0",
|
||||||
"autoprefixer": "^10.4.27",
|
"autoprefixer": "^10.4.27",
|
||||||
|
"eslint": "^10.3.0",
|
||||||
"jsdom": "^27.1.0",
|
"jsdom": "^27.1.0",
|
||||||
"postcss": "^8.5.8",
|
"postcss": "^8.5.8",
|
||||||
"postcss-cli": "^11.0.1",
|
"postcss-cli": "^11.0.1",
|
||||||
"tailwindcss": "^4.2.2",
|
"tailwindcss": "^4.2.2",
|
||||||
"typescript": "~5.9.2",
|
"typescript": "~5.9.2",
|
||||||
|
"typescript-eslint": "8.59.2",
|
||||||
"vitest": "^4.0.8"
|
"vitest": "^4.0.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
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;
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
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;
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
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;
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
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;
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
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;
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
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;
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
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;
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
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;
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
export interface CityDto {
|
||||||
|
id: string;
|
||||||
|
stateId: string;
|
||||||
|
name: string;
|
||||||
|
code: string | null;
|
||||||
|
timezoneId: string | null;
|
||||||
|
isActive: boolean;
|
||||||
|
createdOn?: string;
|
||||||
|
modifiedOn?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateCityRequest {
|
||||||
|
stateId: string;
|
||||||
|
name: string;
|
||||||
|
code: string;
|
||||||
|
timezoneId: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateCityRequest {
|
||||||
|
name: string;
|
||||||
|
code: string;
|
||||||
|
timezoneId: string | null;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CityModalMode = 'create' | 'edit' ;
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
export interface CountryDto {
|
||||||
|
id: string;
|
||||||
|
iso2: string;
|
||||||
|
iso3: string;
|
||||||
|
name: string;
|
||||||
|
phoneCode: string | null;
|
||||||
|
defaultCurrencyId: string | null;
|
||||||
|
isActive: boolean;
|
||||||
|
createdOn?: string;
|
||||||
|
modifiedOn?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CountryLookupDto {
|
||||||
|
id: string;
|
||||||
|
iso2: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateCountryRequest {
|
||||||
|
iso2: string;
|
||||||
|
iso3: string;
|
||||||
|
name: string;
|
||||||
|
phoneCode: string | null;
|
||||||
|
defaultCurrencyId: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateCountryRequest extends CreateCountryRequest {
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CountryModalMode = 'create' | 'edit';
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
export interface CurrencyDto {
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
iso2: string;
|
||||||
|
name: string;
|
||||||
|
symbol: string;
|
||||||
|
numericCode: number;
|
||||||
|
decimalDigits: number;
|
||||||
|
isActive: boolean;
|
||||||
|
createdOn?: string;
|
||||||
|
modifiedOn?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface CurrencyLookupDto {
|
||||||
|
readonly id: string;
|
||||||
|
readonly code: string;
|
||||||
|
readonly name: string;
|
||||||
|
readonly symbol: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateCurrencyRequest {
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
symbol: string;
|
||||||
|
numericCode: number;
|
||||||
|
decimalDigits: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateCurrencyRequest extends CreateCurrencyRequest {
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CurrencyModalMode = 'create' | 'edit';
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
export interface LanguageDto {
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
nativeName: string;
|
||||||
|
isRightToLeft: boolean;
|
||||||
|
isActive: boolean;
|
||||||
|
createdOn: string;
|
||||||
|
modifiedOn: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LanguageLookupDto {
|
||||||
|
readonly id: string;
|
||||||
|
readonly code: string;
|
||||||
|
readonly name: string;
|
||||||
|
readonly nativeName: string;
|
||||||
|
readonly isRightToLeft: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateLanguageRequest {
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
nativeName: string;
|
||||||
|
isRightToLeft: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateLanguageRequest extends CreateLanguageRequest {
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type LanguageModalMode = 'create' | 'edit';
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
export interface StateDto {
|
||||||
|
id: string;
|
||||||
|
countryId: string;
|
||||||
|
name: string;
|
||||||
|
code: string | null;
|
||||||
|
isActive: boolean;
|
||||||
|
createdOn?: string;
|
||||||
|
modifiedOn?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface StateLookupDto {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
code: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateStateRequest {
|
||||||
|
countryId: string;
|
||||||
|
name: string;
|
||||||
|
code: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateStateRequest {
|
||||||
|
countryId: null;
|
||||||
|
name: string;
|
||||||
|
code: string;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type StateModalMode = 'create' | 'edit';
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import { DataTableRecord } from '../../../shared/components/data-table/data-table.types';
|
||||||
|
|
||||||
|
|
||||||
|
export interface TenantCurrencyDto {
|
||||||
|
id: string;
|
||||||
|
tenantId: string;
|
||||||
|
tenantName: string;
|
||||||
|
currencyId: string;
|
||||||
|
currencyName: string;
|
||||||
|
isBaseCurrency: boolean;
|
||||||
|
isReporting: boolean;
|
||||||
|
isActive: boolean;
|
||||||
|
createdOn?: string;
|
||||||
|
modifiedOn?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TenantCurrencyLookupDto {
|
||||||
|
id: string;
|
||||||
|
tenantId: string;
|
||||||
|
currencyId: string;
|
||||||
|
isBaseCurrency: boolean;
|
||||||
|
isReporting: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateTenantCurrencyRequest {
|
||||||
|
tenantId: string;
|
||||||
|
currencyId: string;
|
||||||
|
isBaseCurrency: boolean;
|
||||||
|
isReporting: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateTenantCurrencyRequest {
|
||||||
|
isBaseCurrency: boolean;
|
||||||
|
isReporting: boolean;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface TenantCurrencyTableRow extends DataTableRecord {
|
||||||
|
readonly id: string;
|
||||||
|
readonly tenantId: string;
|
||||||
|
readonly tenantName: string;
|
||||||
|
readonly currencyId: string;
|
||||||
|
readonly currencyName: string;
|
||||||
|
readonly isBaseCurrency: boolean;
|
||||||
|
readonly isReporting: boolean;
|
||||||
|
readonly isActive: boolean;
|
||||||
|
readonly serialNumber: number;
|
||||||
|
readonly createdOn?: string;
|
||||||
|
readonly modifiedOn?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TenantCurrencyModalMode = 'create' | 'edit';
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
import { DataTableRecord } from '../../../shared/components/data-table/data-table.types';
|
||||||
|
|
||||||
|
export enum TenantStatus { Trial = 0, Active = 1, Suspended = 2, Cancelled = 3 }
|
||||||
|
|
||||||
|
export interface TenantDto {
|
||||||
|
id: string;
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
status: TenantStatus;
|
||||||
|
defaultLanguageId: string;
|
||||||
|
defaultLanguageName: string | null;
|
||||||
|
defaultDbConnectionId: string | null;
|
||||||
|
defaultDbConnectionName: string | null;
|
||||||
|
defaultCurrencyId: string;
|
||||||
|
defaultCurrencyName: string | null;
|
||||||
|
defaultTimezoneId: string;
|
||||||
|
defaultTimezoneName: string | null;
|
||||||
|
dataRegion: string;
|
||||||
|
isActive: boolean;
|
||||||
|
createdOn?: string;
|
||||||
|
modifiedOn?: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TenantLookupDto {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
code: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateTenantRequest {
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
status: TenantStatus;
|
||||||
|
defaultLanguageId: string;
|
||||||
|
defaultCurrencyId: string;
|
||||||
|
defaultTimezoneId: string;
|
||||||
|
dataRegion: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateTenantRequest {
|
||||||
|
code: string;
|
||||||
|
name: string;
|
||||||
|
status: TenantStatus;
|
||||||
|
defaultLanguageId: string;
|
||||||
|
defaultCurrencyId: string;
|
||||||
|
defaultTimezoneId: string;
|
||||||
|
defaultDbConnectionId: string | null;
|
||||||
|
dataRegion: string;
|
||||||
|
isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface TenantTableRow extends DataTableRecord {
|
||||||
|
readonly id: string;
|
||||||
|
readonly code: string;
|
||||||
|
readonly name: string;
|
||||||
|
readonly status: TenantStatus;
|
||||||
|
readonly dataRegion: string;
|
||||||
|
readonly isActive: boolean;
|
||||||
|
readonly serialNumber: number;
|
||||||
|
readonly createdOn?: string;
|
||||||
|
readonly modifiedOn?: string | null;
|
||||||
|
readonly defaultLanguageName: string | null;
|
||||||
|
readonly defaultCurrencyName: string | null;
|
||||||
|
readonly defaultTimezoneName: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TenantModalMode = 'create' | 'edit';
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
export interface TimezoneDto {
|
||||||
|
readonly id: string;
|
||||||
|
readonly ianaId: string;
|
||||||
|
readonly displayName: string;
|
||||||
|
readonly utcOffsetMinutes: number;
|
||||||
|
readonly isActive: boolean;
|
||||||
|
readonly createdOn: string;
|
||||||
|
readonly modifiedOn: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface TimezoneLookupDto {
|
||||||
|
readonly id: string;
|
||||||
|
readonly ianaId: string;
|
||||||
|
readonly displayName: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateTimezoneRequest {
|
||||||
|
readonly ianaId: string;
|
||||||
|
readonly displayName: string;
|
||||||
|
readonly utcOffsetMinutes: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateTimezoneRequest extends CreateTimezoneRequest {
|
||||||
|
readonly isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type TimezoneModalMode = 'create' | 'edit' | 'view';
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
export enum UserStatus { Pending = 0, Active = 1, Suspended = 2, Locked = 3, Disabled = 4 }
|
||||||
|
|
||||||
|
export interface CreateUserRequest {
|
||||||
|
email: string;
|
||||||
|
password: string;
|
||||||
|
roleCodes: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserDto {
|
||||||
|
id: string;
|
||||||
|
email: string;
|
||||||
|
status: UserStatus;
|
||||||
|
roles: string[];
|
||||||
|
isActive: boolean;
|
||||||
|
createdOn: string;
|
||||||
|
updatedOn?: string | null;
|
||||||
|
lastLoginOn: string | null;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UserLookupDto {
|
||||||
|
readonly id: string;
|
||||||
|
readonly ianaId: string;
|
||||||
|
readonly displayName: string;
|
||||||
|
}
|
||||||
|
export interface UpdateUserRequest extends CreateUserRequest {
|
||||||
|
readonly isActive: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type UserModalMode = 'create' | 'edit';
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
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<DataTableResult<CityDto>> {
|
||||||
|
return this.http.post<DataTableResult<CityDto>>(
|
||||||
|
CITY_ENDPOINTS.dataTable,
|
||||||
|
query,
|
||||||
|
{ params: new HttpParams().set('stateId', stateId) }
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
createCity(request: CreateCityRequest): Observable<CityDto> {
|
||||||
|
return this.http.post<CityDto>(CITY_ENDPOINTS.create, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateCity(id: string, request: UpdateCityRequest): Observable<CityDto> {
|
||||||
|
return this.http.put<CityDto>(CITY_ENDPOINTS.update(id), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
getCityById(id: string): Observable<CityDto> {
|
||||||
|
return this.http.get<CityDto>(CITY_ENDPOINTS.getById(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
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<DataTableResult<CountryDto>> {
|
||||||
|
return this.http.post<DataTableResult<CountryDto>>(`${COUNTRY_ENDPOINTS.dataTable}`, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
createCountry(request: CreateCountryRequest): Observable<CountryDto> {
|
||||||
|
return this.http.post<CountryDto>(COUNTRY_ENDPOINTS.create, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateCountry(id: string, request: UpdateCountryRequest): Observable<CountryDto> {
|
||||||
|
return this.http.put<CountryDto>(COUNTRY_ENDPOINTS.update(id), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
getCountryById(id: string): Observable<CountryDto> {
|
||||||
|
return this.http.get<CountryDto>(COUNTRY_ENDPOINTS.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
autocomplete(term = '', limit = 50): Observable<CountryLookupDto[]> {
|
||||||
|
return this.http.get<CountryLookupDto[]>(COUNTRY_ENDPOINTS.autocomplete, {
|
||||||
|
params: new HttpParams()
|
||||||
|
.set('term', term)
|
||||||
|
.set('limit', limit)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
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<DataTableResult<CurrencyDto>> {
|
||||||
|
return this.http.post<DataTableResult<CurrencyDto>>(CURRENCY_ENDPOINTS.dataTable, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
createCurrency(request: CreateCurrencyRequest): Observable<CurrencyDto> {
|
||||||
|
return this.http.post<CurrencyDto>(CURRENCY_ENDPOINTS.create, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateCurrency(id: string, request: UpdateCurrencyRequest): Observable<CurrencyDto> {
|
||||||
|
return this.http.put<CurrencyDto>(CURRENCY_ENDPOINTS.update(id), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
getCurrencyById(id: string): Observable<CurrencyDto> {
|
||||||
|
return this.http.get<CurrencyDto>(CURRENCY_ENDPOINTS.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
autocomplete(term: string | null, limit = 10): Observable<readonly CurrencyLookupDto[]> {
|
||||||
|
let params = new HttpParams().set('limit', limit);
|
||||||
|
const normalizedTerm = term?.trim();
|
||||||
|
|
||||||
|
if (normalizedTerm) {
|
||||||
|
params = params.set('term', normalizedTerm);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.http.get<readonly CurrencyLookupDto[]>(CURRENCY_ENDPOINTS.autocomplete, { params });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
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<DataTableResult<LanguageDto>> {
|
||||||
|
return this.http.post<DataTableResult<LanguageDto>>(LANGUAGE_ENDPOINTS.dataTable, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
getById(id: string): Observable<LanguageDto> {
|
||||||
|
return this.http.get<LanguageDto>(LANGUAGE_ENDPOINTS.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
create(request: CreateLanguageRequest): Observable<LanguageDto> {
|
||||||
|
return this.http.post<LanguageDto>(LANGUAGE_ENDPOINTS.create, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
update(id: string, request: UpdateLanguageRequest): Observable<LanguageDto> {
|
||||||
|
return this.http.put<LanguageDto>(LANGUAGE_ENDPOINTS.update(id), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
autocomplete(
|
||||||
|
term: string | null,
|
||||||
|
limit = 10
|
||||||
|
): Observable<readonly LanguageLookupDto[]> {
|
||||||
|
let params = new HttpParams().set('limit', limit);
|
||||||
|
if (term !== null) {
|
||||||
|
params = params.set('term', term);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.http.get<readonly LanguageLookupDto[]>(LANGUAGE_ENDPOINTS.autocomplete, { params });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
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<DataTableResult<StateDto>> {
|
||||||
|
return this.http.post<DataTableResult<StateDto>>(`${STATE_ENDPOINTS.dataTable}`, query, {
|
||||||
|
params: new HttpParams().set('countryId', countryId)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
createState(request: CreateStateRequest): Observable<StateDto> {
|
||||||
|
return this.http.post<StateDto>(STATE_ENDPOINTS.create, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateState(id: string, request: UpdateStateRequest): Observable<StateDto> {
|
||||||
|
return this.http.put<StateDto>(STATE_ENDPOINTS.update(id), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
getStateById(id: string): Observable<StateDto> {
|
||||||
|
return this.http.get<StateDto>(STATE_ENDPOINTS.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
autocomplete(countryId: string, term = '', limit = 50): Observable<StateLookupDto[]> {
|
||||||
|
return this.http.get<StateLookupDto[]>(STATE_ENDPOINTS.autocomplete, {
|
||||||
|
params: new HttpParams()
|
||||||
|
.set('countryId', countryId)
|
||||||
|
.set('term', term)
|
||||||
|
.set('limit', limit)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
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<DataTableResult<TenantCurrencyDto>> {
|
||||||
|
return this.http.post<DataTableResult<TenantCurrencyDto>>(TENANT_CURRENCIES_ENDPOINTS.dataTable, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
createTenant(request: CreateTenantCurrencyRequest): Observable<TenantCurrencyDto> {
|
||||||
|
return this.http.post<TenantCurrencyDto>(TENANT_CURRENCIES_ENDPOINTS.create, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateTenant(id: string, request: UpdateTenantCurrencyRequest): Observable<TenantCurrencyDto> {
|
||||||
|
return this.http.put<TenantCurrencyDto>(TENANT_CURRENCIES_ENDPOINTS.update(id), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
getTenantById(id: string): Observable<TenantCurrencyDto> {
|
||||||
|
return this.http.get<TenantCurrencyDto>(TENANT_CURRENCIES_ENDPOINTS.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
autocomplete(term?: string, limit = 10): Observable<readonly TenantCurrencyLookupDto[]> {
|
||||||
|
let params = new HttpParams().set('limit', limit);
|
||||||
|
const normalizedTerm = term?.trim();
|
||||||
|
|
||||||
|
if (normalizedTerm) {
|
||||||
|
params = params.set('term', normalizedTerm);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.http.get<readonly TenantCurrencyLookupDto[]>(TENANT_CURRENCIES_ENDPOINTS.autocomplete, { params });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
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<DataTableResult<TenantDto>> {
|
||||||
|
return this.http.post<DataTableResult<TenantDto>>(TENANT_ENDPOINTS.dataTable, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
createTenant(request: CreateTenantRequest): Observable<TenantDto> {
|
||||||
|
return this.http.post<TenantDto>(TENANT_ENDPOINTS.create, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateTenant(id: string, request: UpdateTenantRequest): Observable<TenantDto> {
|
||||||
|
return this.http.put<TenantDto>(TENANT_ENDPOINTS.update(id), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
getTenantById(id: string): Observable<TenantDto> {
|
||||||
|
return this.http.get<TenantDto>(TENANT_ENDPOINTS.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
autocomplete(term?: string, limit = 10): Observable<readonly TenantLookupDto[]> {
|
||||||
|
let params = new HttpParams().set('limit', limit);
|
||||||
|
const normalizedTerm = term?.trim();
|
||||||
|
|
||||||
|
if (normalizedTerm) {
|
||||||
|
params = params.set('term', normalizedTerm);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.http.get<readonly TenantLookupDto[]>(TENANT_ENDPOINTS.autocomplete, { params });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
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<DataTableResult<TimezoneDto>> {
|
||||||
|
return this.http.post<DataTableResult<TimezoneDto>>(TIMEZONE_ENDPOINTS.dataTable, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
getById(id: string): Observable<TimezoneDto> {
|
||||||
|
return this.http.get<TimezoneDto>(TIMEZONE_ENDPOINTS.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
create(request: CreateTimezoneRequest): Observable<TimezoneDto> {
|
||||||
|
return this.http.post<TimezoneDto>(TIMEZONE_ENDPOINTS.create, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
update(id: string, request: UpdateTimezoneRequest): Observable<TimezoneDto> {
|
||||||
|
return this.http.put<TimezoneDto>(TIMEZONE_ENDPOINTS.update(id), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
autocomplete(term: string | null, limit = 10): Observable<readonly TimezoneLookupDto[]> {
|
||||||
|
const normalizedTerm = term?.trim() || null;
|
||||||
|
let params = new HttpParams().set('limit', limit);
|
||||||
|
if (normalizedTerm !== null) {
|
||||||
|
params = params.set('term', normalizedTerm);
|
||||||
|
}
|
||||||
|
return this.http.get<readonly TimezoneLookupDto[]>(TIMEZONE_ENDPOINTS.autocomplete, { params });
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
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<UserDto> {
|
||||||
|
return this.http.post<UserDto>(USER_ENDPOINTS.create, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
getById(id: string): Observable<UserDto> {
|
||||||
|
return this.http.get<UserDto>(USER_ENDPOINTS.getById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
getDataTable(query: DataTableQuery): Observable<DataTableResult<UserDto>> {
|
||||||
|
return this.http.post<DataTableResult<UserDto>>(USER_ENDPOINTS.dataTable, query);
|
||||||
|
}
|
||||||
|
|
||||||
|
update(id: string, request: UpdateUserRequest): Observable<UserDto> {
|
||||||
|
return this.http.put<UserDto>(USER_ENDPOINTS.update(id), request);
|
||||||
|
}
|
||||||
|
|
||||||
|
autocomplete(term: string | null, limit = 10): Observable<readonly UserLookupDto[]> {
|
||||||
|
const normalizedTerm = term?.trim() || null;
|
||||||
|
let params = new HttpParams().set('limit', limit);
|
||||||
|
if (normalizedTerm !== null) {
|
||||||
|
params = params.set('term', normalizedTerm);
|
||||||
|
}
|
||||||
|
return this.http.get<readonly UserLookupDto[]>(USER_ENDPOINTS.autocomplete, { params });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -10,9 +10,6 @@
|
|||||||
},
|
},
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*.d.ts",
|
"src/**/*.d.ts",
|
||||||
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"src/**/*.spec.ts"
|
"src/**/*.spec.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user