-
-
Dialog
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
- consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
-
-
-
-
-
-
-
+ selector: 'app-overlay-demo',
+ standalone: true,
+ imports: [
+ ToastModule,
+ DialogModule,
+ ButtonModule,
+ DrawerModule,
+ PopoverModule,
+ ConfirmPopupModule,
+ InputTextModule,
+ FormsModule,
+ TooltipModule,
+ TableModule,
+ ToastModule,
+ SharedDialogComponent,
+ ],
+ template: `
+
+
+
SharedDialogComponent
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
+ dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
+ Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
+ mollit anim id est laborum.
+
+
+
+
+
+
+
-
-
Popover
-
-
-
-
-
-
- Name
- Image
- Price
-
-
-
-
- {{ product.name }}
-
- {{ product.price }}
-
-
-
-
-
-
-
-
-
+
+
Popover
+
+
+
+
+
+
+ Name
+ Image
+ Price
+
+
+
+
+ {{ product.name }}
+
+
+
+ {{ product.price }}
+
+
+
+
+
-
-
-
Drawer
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
- consequat.
-
-
+
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
- consequat.
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
- consequat.
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
- consequat.
-
-
-
-
-
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
- consequat.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
ConfirmDialog
-
-
-
-
- Are you sure you want to proceed?
-
-
-
-
-
-
-
+
`,
- providers: [ConfirmationService, MessageService, ProductService]
+
+
+
+
+
Drawer
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
+ exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
ConfirmDialog
+
+
+
+
+ Are you sure you want to proceed?
+
+
+
+
+
+
+
+
+
`,
+ providers: [ConfirmationService, MessageService, ProductService],
})
export class OverlayDemo implements OnInit {
- images: any[] = [];
+ images: any[] = [];
- display: boolean = false;
+ display: boolean = false;
- products: Product[] = [];
+ products: Product[] = [];
- visibleLeft: boolean = false;
+ visibleLeft: boolean = false;
- visibleRight: boolean = false;
+ visibleRight: boolean = false;
- visibleTop: boolean = false;
+ visibleTop: boolean = false;
- visibleBottom: boolean = false;
+ visibleBottom: boolean = false;
- visibleFull: boolean = false;
+ visibleFull: boolean = false;
- displayConfirmation: boolean = false;
+ displayConfirmation: boolean = false;
- selectedProduct!: Product;
+ selectedProduct!: Product;
- constructor(
- private productService: ProductService,
- private confirmationService: ConfirmationService,
- private messageService: MessageService
- ) {}
+ constructor(
+ private productService: ProductService,
+ private confirmationService: ConfirmationService,
+ private messageService: MessageService,
+ ) {}
- ngOnInit() {
- this.productService.getProductsSmall().then((products) => (this.products = products));
+ ngOnInit() {
+ this.productService.getProductsSmall().then((products) => (this.products = products));
- this.images = [];
- this.images.push({
- source: 'assets/demo/images/sopranos/sopranos1.jpg',
- thumbnail: 'assets/demo/images/sopranos/sopranos1_small.jpg',
- title: 'Sopranos 1'
+ this.images = [];
+ this.images.push({
+ source: 'assets/demo/images/sopranos/sopranos1.jpg',
+ thumbnail: 'assets/demo/images/sopranos/sopranos1_small.jpg',
+ title: 'Sopranos 1',
+ });
+ this.images.push({
+ source: 'assets/demo/images/sopranos/sopranos2.jpg',
+ thumbnail: 'assets/demo/images/sopranos/sopranos2_small.jpg',
+ title: 'Sopranos 2',
+ });
+ this.images.push({
+ source: 'assets/demo/images/sopranos/sopranos3.jpg',
+ thumbnail: 'assets/demo/images/sopranos/sopranos3_small.jpg',
+ title: 'Sopranos 3',
+ });
+ this.images.push({
+ source: 'assets/demo/images/sopranos/sopranos4.jpg',
+ thumbnail: 'assets/demo/images/sopranos/sopranos4_small.jpg',
+ title: 'Sopranos 4',
+ });
+ }
+
+ confirm(event: Event) {
+ this.confirmationService.confirm({
+ key: 'confirm2',
+ target: event.target || new EventTarget(),
+ message: 'Are you sure that you want to proceed?',
+ icon: 'pi pi-exclamation-triangle',
+ accept: () => {
+ this.messageService.add({
+ severity: 'info',
+ summary: 'Confirmed',
+ detail: 'You have accepted',
});
- this.images.push({
- source: 'assets/demo/images/sopranos/sopranos2.jpg',
- thumbnail: 'assets/demo/images/sopranos/sopranos2_small.jpg',
- title: 'Sopranos 2'
+ },
+ reject: () => {
+ this.messageService.add({
+ severity: 'error',
+ summary: 'Rejected',
+ detail: 'You have rejected',
});
- this.images.push({
- source: 'assets/demo/images/sopranos/sopranos3.jpg',
- thumbnail: 'assets/demo/images/sopranos/sopranos3_small.jpg',
- title: 'Sopranos 3'
- });
- this.images.push({
- source: 'assets/demo/images/sopranos/sopranos4.jpg',
- thumbnail: 'assets/demo/images/sopranos/sopranos4_small.jpg',
- title: 'Sopranos 4'
- });
- }
+ },
+ });
+ }
- confirm(event: Event) {
- this.confirmationService.confirm({
- key: 'confirm2',
- target: event.target || new EventTarget(),
- message: 'Are you sure that you want to proceed?',
- icon: 'pi pi-exclamation-triangle',
- accept: () => {
- this.messageService.add({ severity: 'info', summary: 'Confirmed', detail: 'You have accepted' });
- },
- reject: () => {
- this.messageService.add({ severity: 'error', summary: 'Rejected', detail: 'You have rejected' });
- }
- });
- }
+ open() {
+ this.display = true;
+ }
- open() {
- this.display = true;
- }
+ close() {
+ this.display = false;
+ }
- close() {
- this.display = false;
- }
+ toggleDataTable(op: Popover, event: any) {
+ op.toggle(event);
+ }
- toggleDataTable(op: Popover, event: any) {
- op.toggle(event);
- }
+ onProductSelect(op: Popover, event: any) {
+ op.hide();
+ this.messageService.add({
+ severity: 'info',
+ summary: 'Product Selected',
+ detail: event?.data.name,
+ life: 3000,
+ });
+ }
- onProductSelect(op: Popover, event: any) {
- op.hide();
- this.messageService.add({ severity: 'info', summary: 'Product Selected', detail: event?.data.name, life: 3000 });
- }
+ openConfirmation() {
+ this.displayConfirmation = true;
+ }
- openConfirmation() {
- this.displayConfirmation = true;
- }
-
- closeConfirmation() {
- this.displayConfirmation = false;
- }
+ closeConfirmation() {
+ this.displayConfirmation = false;
+ }
}
diff --git a/src/app/shared/apiEnum/select.component.html b/src/app/shared/apiEnum/select.component.html
index c2e543d..5c3c80b 100644
--- a/src/app/shared/apiEnum/select.component.html
+++ b/src/app/shared/apiEnum/select.component.html
@@ -7,6 +7,7 @@
[formControl]="control"
[showClear]="showClear"
[filter]="true"
+ [name]="name || type"
appendTo="body"
/>
diff --git a/src/app/shared/apiEnum/select.component.ts b/src/app/shared/apiEnum/select.component.ts
index bcb2a93..8cf1e70 100644
--- a/src/app/shared/apiEnum/select.component.ts
+++ b/src/app/shared/apiEnum/select.component.ts
@@ -15,6 +15,7 @@ import { EnumsService } from './services';
})
export class EnumSelectComponent extends AbstractSelectComponent
{
@Input({ required: true }) type!: TEnumApi;
+ @Input() name?: string;
@Input() customLabel?: string;
private readonly service = inject(EnumsService);
diff --git a/src/app/shared/catalog/guild/components/select.component.html b/src/app/shared/catalog/guild/components/select.component.html
index 31cf852..7acf987 100644
--- a/src/app/shared/catalog/guild/components/select.component.html
+++ b/src/app/shared/catalog/guild/components/select.component.html
@@ -8,6 +8,7 @@
[formControl]="control"
[showClear]="showClear"
[filter]="true"
+ [name]="name"
appendTo="body"
/>
diff --git a/src/app/shared/catalog/guild/components/select.component.ts b/src/app/shared/catalog/guild/components/select.component.ts
index b72d34f..83a28b5 100644
--- a/src/app/shared/catalog/guild/components/select.component.ts
+++ b/src/app/shared/catalog/guild/components/select.component.ts
@@ -17,6 +17,7 @@ export class CatalogGuildSelectComponent extends AbstractSelectComponent<
IListingResponse
> {
@Input() override showClear: boolean = false;
+ @Input({ required: true }) name!: string;
@Input() label: string = '';
private readonly service = inject(CatalogsService);
diff --git a/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.html b/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.html
index 02bfcb9..0e809b3 100644
--- a/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.html
+++ b/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.html
@@ -1,4 +1,4 @@
-
-
+
diff --git a/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.ts b/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.ts
index 431d090..5a2a7ac 100644
--- a/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.ts
+++ b/src/app/shared/components/changePasswordFormDialog/change-password-form-dialog.component.ts
@@ -3,8 +3,8 @@ import { AbstractDialog } from '@/shared/abstractClasses/abstract-dialog';
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
import { Component, EventEmitter, Output, input } from '@angular/core';
import { FormBuilder, ReactiveFormsModule, Validators } from '@angular/forms';
-import { Dialog } from 'primeng/dialog';
import { SharedPasswordInputComponent } from '../passwordInput/password-input.component';
+import { SharedDialogComponent } from '@/shared/components/dialog/dialog.component';
export interface IChangePasswordSubmitPayload {
password: string;
@@ -14,7 +14,7 @@ export interface IChangePasswordSubmitPayload {
@Component({
selector: 'shared-change-password-form-dialog',
templateUrl: './change-password-form-dialog.component.html',
- imports: [ReactiveFormsModule, Dialog, FormFooterActionsComponent, SharedPasswordInputComponent],
+ imports: [ReactiveFormsModule, SharedDialogComponent, FormFooterActionsComponent, SharedPasswordInputComponent],
})
export class ChangePasswordFormDialogComponent extends AbstractDialog {
title = input('');
@@ -35,7 +35,7 @@ export class ChangePasswordFormDialogComponent extends AbstractDialog {
);
get dialogHeader() {
- return this.title() ? `تغییر گذرواژهی ${this.title()}` : 'تغییر گذرواژه';
+ return this.title() ? `تغییر گذرواژه ${this.title()}` : 'تغییر گذرواژه';
}
submit() {
diff --git a/src/app/shared/components/dialog/dialog.component.ts b/src/app/shared/components/dialog/dialog.component.ts
new file mode 100644
index 0000000..fb13734
--- /dev/null
+++ b/src/app/shared/components/dialog/dialog.component.ts
@@ -0,0 +1,34 @@
+import { Component, EventEmitter, Input, Output } from '@angular/core';
+import { Dialog } from 'primeng/dialog';
+
+@Component({
+ selector: 'shared-dialog',
+ template: `
+
+
+
+ `,
+ imports: [Dialog],
+})
+export class SharedDialogComponent {
+ @Input() header = '';
+ @Input() visible = false;
+ @Output() visibleChange = new EventEmitter();
+
+ @Input() modal = true;
+ @Input() closable = true;
+ @Input() draggable = false;
+ @Input() style: Record | undefined;
+ @Input() breakpoints: Record | undefined;
+
+ @Output() onHide = new EventEmitter();
+}
diff --git a/src/app/shared/components/fields/address.component.ts b/src/app/shared/components/fields/address.component.ts
new file mode 100644
index 0000000..1a139c1
--- /dev/null
+++ b/src/app/shared/components/fields/address.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-address',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class AddressComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'address';
+}
diff --git a/src/app/shared/components/fields/branch_code.component.ts b/src/app/shared/components/fields/branch_code.component.ts
new file mode 100644
index 0000000..b66a2b5
--- /dev/null
+++ b/src/app/shared/components/fields/branch_code.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-branch-code',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class BranchCodeComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'branch_code';
+}
diff --git a/src/app/shared/components/fields/cash.component.ts b/src/app/shared/components/fields/cash.component.ts
new file mode 100644
index 0000000..eb64b4b
--- /dev/null
+++ b/src/app/shared/components/fields/cash.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-cash',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class CashComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'cash';
+}
diff --git a/src/app/shared/components/fields/code.component.ts b/src/app/shared/components/fields/code.component.ts
new file mode 100644
index 0000000..8807b70
--- /dev/null
+++ b/src/app/shared/components/fields/code.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-code',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class CodeComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'code';
+}
diff --git a/src/app/shared/components/fields/company_name.component.ts b/src/app/shared/components/fields/company_name.component.ts
new file mode 100644
index 0000000..23a377d
--- /dev/null
+++ b/src/app/shared/components/fields/company_name.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-company-name',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class CompanyNameComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'company_name';
+}
diff --git a/src/app/shared/components/fields/description.component.ts b/src/app/shared/components/fields/description.component.ts
new file mode 100644
index 0000000..a214b30
--- /dev/null
+++ b/src/app/shared/components/fields/description.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-description',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class DescriptionComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'description';
+}
diff --git a/src/app/shared/components/fields/device_id.component.ts b/src/app/shared/components/fields/device_id.component.ts
new file mode 100644
index 0000000..ff4fafa
--- /dev/null
+++ b/src/app/shared/components/fields/device_id.component.ts
@@ -0,0 +1,13 @@
+import { CatalogDeviceSelectComponent } from '@/shared/catalog/devices';
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+
+@Component({
+ selector: 'field-device-id',
+ template: ` `,
+ imports: [ReactiveFormsModule, CatalogDeviceSelectComponent],
+})
+export class DeviceIdComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'device_id';
+}
diff --git a/src/app/shared/components/fields/economic_code.component.ts b/src/app/shared/components/fields/economic_code.component.ts
new file mode 100644
index 0000000..8c9cd7f
--- /dev/null
+++ b/src/app/shared/components/fields/economic_code.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-economic-code',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class EconomicCodeComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'economic_code';
+}
diff --git a/src/app/shared/components/fields/email.component.ts b/src/app/shared/components/fields/email.component.ts
new file mode 100644
index 0000000..0a576f8
--- /dev/null
+++ b/src/app/shared/components/fields/email.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-email',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class EmailComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'email';
+}
diff --git a/src/app/shared/components/fields/first_name.component.ts b/src/app/shared/components/fields/first_name.component.ts
new file mode 100644
index 0000000..8682ae2
--- /dev/null
+++ b/src/app/shared/components/fields/first_name.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-first-name',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class FirstNameComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'first_name';
+}
diff --git a/src/app/shared/components/fields/fiscal_code.component.ts b/src/app/shared/components/fields/fiscal_code.component.ts
new file mode 100644
index 0000000..2bc842d
--- /dev/null
+++ b/src/app/shared/components/fields/fiscal_code.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-fiscal-code',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class FiscalCodeComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'fiscal_code';
+}
diff --git a/src/app/shared/components/fields/guild_id.component.ts b/src/app/shared/components/fields/guild_id.component.ts
new file mode 100644
index 0000000..d5b1d29
--- /dev/null
+++ b/src/app/shared/components/fields/guild_id.component.ts
@@ -0,0 +1,13 @@
+import { CatalogGuildSelectComponent } from '@/shared/catalog/guild/components/select.component';
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+
+@Component({
+ selector: 'field-guild-id',
+ template: ` `,
+ imports: [ReactiveFormsModule, CatalogGuildSelectComponent],
+})
+export class GuildIdComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'guild_id';
+}
diff --git a/src/app/shared/components/fields/index.ts b/src/app/shared/components/fields/index.ts
new file mode 100644
index 0000000..78efc85
--- /dev/null
+++ b/src/app/shared/components/fields/index.ts
@@ -0,0 +1,34 @@
+export * from './address.component';
+export * from './branch_code.component';
+export * from './cash.component';
+export * from './code.component';
+export * from './company_name.component';
+export * from './description.component';
+export * from './device_id.component';
+export * from './economic_code.component';
+export * from './email.component';
+export * from './first_name.component';
+export * from './fiscal_code.component';
+export * from './guild_id.component';
+export * from './last_name.component';
+export * from './legal_name.component';
+export * from './license_starts_at.component';
+export * from './mobile.component';
+export * from './mobile_number.component';
+export * from './model.component';
+export * from './name.component';
+export * from './national_code.component';
+export * from './national_id.component';
+export * from './partner_token.component';
+export * from './pos_type.component';
+export * from './postal_code.component';
+export * from './provider_id.component';
+export * from './quantity.component';
+export * from './registration_code.component';
+export * from './registration_number.component';
+export * from './serial_number.component';
+export * from './set_off.component';
+export * from './sku.component';
+export * from './terminal.component';
+export * from './unit_price.component';
+export * from './username.component';
diff --git a/src/app/shared/components/fields/last_name.component.ts b/src/app/shared/components/fields/last_name.component.ts
new file mode 100644
index 0000000..8164d13
--- /dev/null
+++ b/src/app/shared/components/fields/last_name.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-last-name',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class LastNameComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'last_name';
+}
diff --git a/src/app/shared/components/fields/legal_name.component.ts b/src/app/shared/components/fields/legal_name.component.ts
new file mode 100644
index 0000000..9fba078
--- /dev/null
+++ b/src/app/shared/components/fields/legal_name.component.ts
@@ -0,0 +1,14 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-legal-name',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class LegalNameComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'name';
+ @Input() label = 'نام شرکت';
+}
diff --git a/src/app/shared/components/fields/license_starts_at.component.ts b/src/app/shared/components/fields/license_starts_at.component.ts
new file mode 100644
index 0000000..6152936
--- /dev/null
+++ b/src/app/shared/components/fields/license_starts_at.component.ts
@@ -0,0 +1,18 @@
+import { UikitFlatpickrJalaliComponent } from '@/uikit';
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+
+@Component({
+ selector: 'field-license-starts-at',
+ template: ` `,
+ imports: [ReactiveFormsModule, UikitFlatpickrJalaliComponent],
+})
+export class LicenseStartsAtComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'license_starts_at';
+}
diff --git a/src/app/shared/components/fields/mobile.component.ts b/src/app/shared/components/fields/mobile.component.ts
new file mode 100644
index 0000000..c512927
--- /dev/null
+++ b/src/app/shared/components/fields/mobile.component.ts
@@ -0,0 +1,18 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-mobile',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class MobileComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'mobile';
+}
diff --git a/src/app/shared/components/fields/mobile_number.component.ts b/src/app/shared/components/fields/mobile_number.component.ts
new file mode 100644
index 0000000..c0156e3
--- /dev/null
+++ b/src/app/shared/components/fields/mobile_number.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-mobile-number',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class MobileNumberComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'mobile_number';
+}
diff --git a/src/app/shared/components/fields/model.component.ts b/src/app/shared/components/fields/model.component.ts
new file mode 100644
index 0000000..c5e5088
--- /dev/null
+++ b/src/app/shared/components/fields/model.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-model',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class ModelComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'model';
+}
diff --git a/src/app/shared/components/fields/name.component.ts b/src/app/shared/components/fields/name.component.ts
new file mode 100644
index 0000000..14d859a
--- /dev/null
+++ b/src/app/shared/components/fields/name.component.ts
@@ -0,0 +1,14 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-name',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class NameComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'name';
+ @Input() label = 'عنوان';
+}
diff --git a/src/app/shared/components/fields/national_code.component.ts b/src/app/shared/components/fields/national_code.component.ts
new file mode 100644
index 0000000..4859527
--- /dev/null
+++ b/src/app/shared/components/fields/national_code.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-national-code',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class NationalCodeComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'national_code';
+}
diff --git a/src/app/shared/components/fields/national_id.component.ts b/src/app/shared/components/fields/national_id.component.ts
new file mode 100644
index 0000000..bea1674
--- /dev/null
+++ b/src/app/shared/components/fields/national_id.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-national-id',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class NationalIdComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'national_id';
+}
diff --git a/src/app/shared/components/fields/partner_token.component.ts b/src/app/shared/components/fields/partner_token.component.ts
new file mode 100644
index 0000000..e79e24c
--- /dev/null
+++ b/src/app/shared/components/fields/partner_token.component.ts
@@ -0,0 +1,18 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-partner-token',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class PartnerTokenComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'partner_token';
+}
diff --git a/src/app/shared/components/fields/pos_type.component.ts b/src/app/shared/components/fields/pos_type.component.ts
new file mode 100644
index 0000000..6e08517
--- /dev/null
+++ b/src/app/shared/components/fields/pos_type.component.ts
@@ -0,0 +1,13 @@
+import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+
+@Component({
+ selector: 'field-pos-type',
+ template: ` `,
+ imports: [ReactiveFormsModule, EnumSelectComponent],
+})
+export class PosTypeComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'pos_type';
+}
diff --git a/src/app/shared/components/fields/postal_code.component.ts b/src/app/shared/components/fields/postal_code.component.ts
new file mode 100644
index 0000000..894df9d
--- /dev/null
+++ b/src/app/shared/components/fields/postal_code.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-postal-code',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class PostalCodeComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'postal_code';
+}
diff --git a/src/app/shared/components/fields/provider_id.component.ts b/src/app/shared/components/fields/provider_id.component.ts
new file mode 100644
index 0000000..372d359
--- /dev/null
+++ b/src/app/shared/components/fields/provider_id.component.ts
@@ -0,0 +1,13 @@
+import { CatalogProviderSelectComponent } from '@/shared/catalog';
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+
+@Component({
+ selector: 'field-provider-id',
+ template: ` `,
+ imports: [ReactiveFormsModule, CatalogProviderSelectComponent],
+})
+export class ProviderIdComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'provider_id';
+}
diff --git a/src/app/shared/components/fields/quantity.component.ts b/src/app/shared/components/fields/quantity.component.ts
new file mode 100644
index 0000000..9e739cb
--- /dev/null
+++ b/src/app/shared/components/fields/quantity.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-quantity',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class QuantityComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'quantity';
+}
diff --git a/src/app/shared/components/fields/registration_code.component.ts b/src/app/shared/components/fields/registration_code.component.ts
new file mode 100644
index 0000000..ba5a968
--- /dev/null
+++ b/src/app/shared/components/fields/registration_code.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-registration-code',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class RegistrationCodeComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'registration_code';
+}
diff --git a/src/app/shared/components/fields/registration_number.component.ts b/src/app/shared/components/fields/registration_number.component.ts
new file mode 100644
index 0000000..24be7d0
--- /dev/null
+++ b/src/app/shared/components/fields/registration_number.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-registration-number',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class RegistrationNumberComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'registration_number';
+}
diff --git a/src/app/shared/components/fields/serial_number.component.ts b/src/app/shared/components/fields/serial_number.component.ts
new file mode 100644
index 0000000..7d17a46
--- /dev/null
+++ b/src/app/shared/components/fields/serial_number.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-serial-number',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class SerialNumberComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'serial_number';
+}
diff --git a/src/app/shared/components/fields/set_off.component.ts b/src/app/shared/components/fields/set_off.component.ts
new file mode 100644
index 0000000..e5d28a0
--- /dev/null
+++ b/src/app/shared/components/fields/set_off.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-set-off',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class SetOffComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'set_off';
+}
diff --git a/src/app/shared/components/fields/sku.component.ts b/src/app/shared/components/fields/sku.component.ts
new file mode 100644
index 0000000..fc60faa
--- /dev/null
+++ b/src/app/shared/components/fields/sku.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-sku',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class SkuComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'sku';
+}
diff --git a/src/app/shared/components/fields/terminal.component.ts b/src/app/shared/components/fields/terminal.component.ts
new file mode 100644
index 0000000..0549ec2
--- /dev/null
+++ b/src/app/shared/components/fields/terminal.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-terminal',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class TerminalComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'terminal';
+}
diff --git a/src/app/shared/components/fields/unit_price.component.ts b/src/app/shared/components/fields/unit_price.component.ts
new file mode 100644
index 0000000..48c9ab5
--- /dev/null
+++ b/src/app/shared/components/fields/unit_price.component.ts
@@ -0,0 +1,13 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-unit-price',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class UnitPriceComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'unit_price';
+}
diff --git a/src/app/shared/components/fields/username.component.ts b/src/app/shared/components/fields/username.component.ts
new file mode 100644
index 0000000..8430ed4
--- /dev/null
+++ b/src/app/shared/components/fields/username.component.ts
@@ -0,0 +1,14 @@
+import { Component, Input } from '@angular/core';
+import { FormControl, ReactiveFormsModule } from '@angular/forms';
+import { InputComponent } from '../input/input.component';
+
+@Component({
+ selector: 'field-username',
+ template: ` `,
+ imports: [ReactiveFormsModule, InputComponent],
+})
+export class UsernameComponent {
+ @Input({ required: true }) control = new FormControl('');
+ @Input() name = 'username';
+ @Input() label = 'نام کاربری';
+}
diff --git a/src/app/shared/components/index.ts b/src/app/shared/components/index.ts
index 74de5f4..3812deb 100644
--- a/src/app/shared/components/index.ts
+++ b/src/app/shared/components/index.ts
@@ -2,6 +2,8 @@
export * from './breadcrumb.component';
export * from './card-data.component';
export * from './changePasswordFormDialog/change-password-form-dialog.component';
+export * from './dialog/dialog.component';
+export * from './fields';
export * from './inlineConfirmation/inline-confirmation.component';
export * from './inlineEdit/inline-edit.component';
export * from './input/input.component';
diff --git a/src/app/shared/components/passwordInput/password-input.component.html b/src/app/shared/components/passwordInput/password-input.component.html
index 0fe40a0..f409da6 100644
--- a/src/app/shared/components/passwordInput/password-input.component.html
+++ b/src/app/shared/components/passwordInput/password-input.component.html
@@ -2,7 +2,7 @@
[Validators.required] as ValidatorFn[];
+type ControlConfig = [string, ValidatorFn[]];
+
+export const fieldControl = {
+ name: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ code: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ description: (value = '', isRequired = false): ControlConfig => [value, isRequired ? required() : []],
+ company_name: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ first_name: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ firstName: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ last_name: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ lastName: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ legal_name: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ registration_code: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ registration_number: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ mobile_number: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? [Validators.required, mobileValidator()] : [mobileValidator()],
+ ],
+ mobile: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? [Validators.required, mobileValidator()] : [mobileValidator()],
+ ],
+ email: (value = '', isRequired = false): ControlConfig => [
+ value,
+ isRequired ? [Validators.required, Validators.email] : [Validators.email],
+ ],
+ national_code: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? [Validators.required, nationalIdValidator()] : [nationalIdValidator()],
+ ],
+ national_id: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? [Validators.required, nationalIdValidator()] : [nationalIdValidator()],
+ ],
+ postal_code: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? [Validators.required, postalCodeValidator()] : [postalCodeValidator()],
+ ],
+ username: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ economic_code: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ fiscal_code: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? [Validators.required, fiscalCodeValidator()] : [fiscalCodeValidator()],
+ ],
+ partner_token: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ guild_id: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ license_starts_at: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ branch_code: (value = '', isRequired = false): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ address: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ pos_type: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ type: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ role: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ unit_type: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ pricing_model: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ gender: (value = '', isRequired = false): ControlConfig => [value, isRequired ? required() : []],
+ legal: (value = '', isRequired = false): ControlConfig => [value, isRequired ? required() : []],
+ individual: (value = '', isRequired = false): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ partner_id: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ brand_id: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ category_id: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ starts_at: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ expires_at: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ activated_expires_at: (value = '', isRequired = true): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ invoiceDate: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ quantity: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ unit_price: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ cash: (value = '', isRequired = false): ControlConfig => [value, isRequired ? required() : []],
+ set_off: (value = '', isRequired = false): ControlConfig => [value, isRequired ? required() : []],
+ setOff: (value = '', isRequired = false): ControlConfig => [value, isRequired ? required() : []],
+ terminal: (value = '', isRequired = false): ControlConfig => [value, isRequired ? required() : []],
+ sku: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ model: (value = '', isRequired = true): ControlConfig => [value, isRequired ? required() : []],
+ serial_number: (value = '', isRequired = false): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ device_id: (value = '', isRequired = false): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+ provider_id: (value = '', isRequired = false): ControlConfig => [
+ value,
+ isRequired ? required() : [],
+ ],
+};
diff --git a/src/app/shared/constants/index.ts b/src/app/shared/constants/index.ts
new file mode 100644
index 0000000..cbc6c8c
--- /dev/null
+++ b/src/app/shared/constants/index.ts
@@ -0,0 +1 @@
+export * from './fields';
diff --git a/src/app/shared/models/consumer.type.ts b/src/app/shared/models/consumer.type.ts
new file mode 100644
index 0000000..d1bf45d
--- /dev/null
+++ b/src/app/shared/models/consumer.type.ts
@@ -0,0 +1,40 @@
+import { Maybe } from '@/core';
+
+export interface IConsumerRawResponse {
+ id: string;
+ status: string;
+ created_at: string;
+ name: string;
+ type: 'INDIVIDUAL' | 'LEGAL';
+ partner: {
+ id: string;
+ name: string;
+ code: string;
+ };
+ individual?: Maybe;
+ legal?: Maybe;
+}
+export interface IConsumerResponse extends IConsumerRawResponse {}
+
+export interface IConsumerRequest {
+ type?: 'INDIVIDUAL' | 'LEGAL';
+ username?: string;
+ password?: string;
+ status?: string;
+ customer?: {
+ individual?: IConsumerIndividual;
+ legal?: IConsumerLegal;
+ };
+}
+
+interface IConsumerIndividual {
+ first_name: string;
+ last_name: string;
+ mobile_number: string;
+ national_code?: string;
+}
+
+interface IConsumerLegal {
+ name: string;
+ registration_code?: string;
+}
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index 9bad5de..f801336 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -6,4 +6,5 @@ export const environment = {
port: 5000,
enableLogging: false,
enableDebug: false,
+ enableNativeBridge: false,
};
diff --git a/src/environments/environment.staging.ts b/src/environments/environment.staging.ts
index 5cc17e6..21d8a7b 100644
--- a/src/environments/environment.staging.ts
+++ b/src/environments/environment.staging.ts
@@ -4,6 +4,7 @@ export const environment = {
apiBaseUrl: 'https://staging-api.yourdomain.com',
host: 'staging.yourdomain.com',
port: 443,
+ enableNativeBridge: false,
apiEndpoints: {
auth: '/api/auth',
users: '/api/users',
diff --git a/src/environments/environment.tis.ts b/src/environments/environment.tis.ts
new file mode 100644
index 0000000..ffb4abc
--- /dev/null
+++ b/src/environments/environment.tis.ts
@@ -0,0 +1,10 @@
+// TIS tenant environment configuration
+export const environment = {
+ production: true,
+ apiBaseUrl: 'http://194.59.214.243:5002',
+ host: 'localhost',
+ port: 5000,
+ enableLogging: false,
+ enableDebug: false,
+ enableNativeBridge: true,
+};
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 122bf58..3f7ba4d 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -8,4 +8,5 @@ export const environment = {
port: 5000,
enableLogging: true,
enableDebug: true,
+ enableNativeBridge: false,
};
diff --git a/src/index.html b/src/index.html
index 17efe0d..aed0bf8 100644
--- a/src/index.html
+++ b/src/index.html
@@ -5,6 +5,7 @@
پنل مدیریت صورتحسابهای مالیاتی
+
diff --git a/src/main.ts b/src/main.ts
index d1aee1e..3cccf51 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,6 +1,7 @@
import { bootstrapApplication } from '@angular/platform-browser';
import flatpickr from 'flatpickr-wrap';
import faLocales from 'flatpickr-wrap/dist/l10n/fa.js';
+import { brandingConfig } from './app/branding/branding.config';
import { AppComponent } from './app.component';
import { appConfig } from './app.config';
@@ -19,4 +20,16 @@ if (flatpickr.defaultConfig) {
});
}
+document.title = brandingConfig.appTitle;
+
+const manifestLink = document.querySelector('link[rel="manifest"]');
+if (manifestLink) {
+ manifestLink.setAttribute('href', brandingConfig.manifestPath);
+}
+
+const themeMeta = document.querySelector('meta[name="theme-color"]');
+if (themeMeta) {
+ themeMeta.setAttribute('content', brandingConfig.themeColor);
+}
+
bootstrapApplication(AppComponent, appConfig).catch((err) => console.error(err));
diff --git a/src/tenants/default/app.routes.ts b/src/tenants/default/app.routes.ts
new file mode 100644
index 0000000..4965e3d
--- /dev/null
+++ b/src/tenants/default/app.routes.ts
@@ -0,0 +1,35 @@
+import { CONSUMER_ROUTES } from '@/domains/consumer/routes';
+import { PARTNER_ROUTES } from '@/domains/partner/routes';
+import { POS_ROUTES } from '@/domains/pos/routes';
+import { PROVIDER_ROUTES } from '@/domains/provider/routes';
+import { SUPER_ADMIN_ROUTES } from '@/domains/superAdmin/routes';
+import { AppLayout } from '@/layout/default/app.layout.component';
+import { AuthComponent } from '@/modules/auth/pages/auth.component';
+import { Dashboard } from '@/pages/dashboard/dashboard';
+import { Documentation } from '@/pages/documentation/documentation';
+import { Notfound } from '@/pages/notfound/notfound.component';
+import { Routes } from '@angular/router';
+
+export const appRoutes: Routes = [
+ {
+ path: '',
+ component: AppLayout,
+ children: [
+ SUPER_ADMIN_ROUTES,
+ CONSUMER_ROUTES,
+ PROVIDER_ROUTES,
+ PARTNER_ROUTES,
+ { path: 'ng', component: Dashboard },
+ { path: 'uikit', loadChildren: () => import('@/pages/uikit/uikit.routes') },
+ { path: 'documentation', component: Documentation },
+ { path: 'pages', loadChildren: () => import('@/pages/pages.routes') },
+ ],
+ },
+ POS_ROUTES,
+ {
+ path: 'auth',
+ component: AuthComponent,
+ },
+ { path: 'notfound', component: Notfound },
+ { path: '**', redirectTo: '/notfound' },
+];
diff --git a/src/tenants/default/branding.config.ts b/src/tenants/default/branding.config.ts
new file mode 100644
index 0000000..a1223a1
--- /dev/null
+++ b/src/tenants/default/branding.config.ts
@@ -0,0 +1,11 @@
+export interface BrandingConfig {
+ appTitle: string;
+ manifestPath: string;
+ themeColor: string;
+}
+
+export const brandingConfig: BrandingConfig = {
+ appTitle: 'پنل مدیریت صورتحسابهای مالیاتی',
+ manifestPath: '/favicon/site.webmanifest',
+ themeColor: '#ffffff',
+};
diff --git a/src/tenants/tis/app.routes.ts b/src/tenants/tis/app.routes.ts
new file mode 100644
index 0000000..abb2745
--- /dev/null
+++ b/src/tenants/tis/app.routes.ts
@@ -0,0 +1,15 @@
+import { POS_ROUTES } from '@/domains/pos/routes';
+import { AuthComponent } from '@/modules/auth/pages/auth.component';
+import { Notfound } from '@/pages/notfound/notfound.component';
+import { Routes } from '@angular/router';
+
+export const appRoutes: Routes = [
+ { path: '', redirectTo: 'pos', pathMatch: 'full' },
+ POS_ROUTES,
+ {
+ path: 'auth',
+ component: AuthComponent,
+ },
+ { path: 'notfound', component: Notfound },
+ { path: '**', redirectTo: '/notfound' },
+];
diff --git a/src/tenants/tis/branding.config.ts b/src/tenants/tis/branding.config.ts
new file mode 100644
index 0000000..a6dfd0f
--- /dev/null
+++ b/src/tenants/tis/branding.config.ts
@@ -0,0 +1,7 @@
+import { BrandingConfig } from '../default/branding.config';
+
+export const brandingConfig: BrandingConfig = {
+ appTitle: 'PSP A - مدیریت صورتحسابهای مالیاتی',
+ manifestPath: '/favicon/site.webmanifest',
+ themeColor: '#ffffff',
+};