refactor user accounts structure
This commit is contained in:
@@ -1,3 +1,6 @@
|
|||||||
|
import { CONSUMER_ROUTES } from '@/domains/consumer/routes';
|
||||||
|
import { PARTNER_ROUTES } from '@/domains/partner/routes';
|
||||||
|
import { PROVIDER_ROUTES } from '@/domains/provider/routes';
|
||||||
import { SUPER_ADMIN_ROUTES } from '@/domains/superAdmin/routes';
|
import { SUPER_ADMIN_ROUTES } from '@/domains/superAdmin/routes';
|
||||||
import { AuthComponent } from '@/modules/auth/pages/auth.component';
|
import { AuthComponent } from '@/modules/auth/pages/auth.component';
|
||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
@@ -12,6 +15,9 @@ export const appRoutes: Routes = [
|
|||||||
component: AppLayout,
|
component: AppLayout,
|
||||||
children: [
|
children: [
|
||||||
SUPER_ADMIN_ROUTES,
|
SUPER_ADMIN_ROUTES,
|
||||||
|
CONSUMER_ROUTES,
|
||||||
|
PROVIDER_ROUTES,
|
||||||
|
PARTNER_ROUTES,
|
||||||
{ path: 'ng', component: Dashboard },
|
{ path: 'ng', component: Dashboard },
|
||||||
{ path: 'uikit', loadChildren: () => import('./app/pages/uikit/uikit.routes') },
|
{ path: 'uikit', loadChildren: () => import('./app/pages/uikit/uikit.routes') },
|
||||||
{ path: 'documentation', component: Documentation },
|
{ path: 'documentation', component: Documentation },
|
||||||
|
|||||||
@@ -1,2 +1 @@
|
|||||||
export * from './defaultData.const';
|
export * from './defaultData.const';
|
||||||
export * from './menuItems.const';
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
export enum UserRole {
|
export enum UserRole {
|
||||||
ADMIN = 'admin',
|
ADMIN = 'admin',
|
||||||
PARTNER = 'partner',
|
|
||||||
POS = 'pos',
|
|
||||||
PROVIDER = 'provider',
|
PROVIDER = 'provider',
|
||||||
SUPERADMIN = 'superadmin',
|
PARTNER = 'partner',
|
||||||
|
CONSUMER = 'consumer',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TRoles = keyof typeof UserRole;
|
export type TRoles = keyof typeof UserRole;
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import { LOCAL_STORAGE_KEYS } from '../../../assets/constants';
|
|||||||
import {
|
import {
|
||||||
IAuthAccountResponse,
|
IAuthAccountResponse,
|
||||||
IAuthResponse,
|
IAuthResponse,
|
||||||
ISignupRequestPayload,
|
|
||||||
IUserLoginInfo,
|
IUserLoginInfo,
|
||||||
LoginCredentials,
|
LoginCredentials,
|
||||||
Maybe,
|
Maybe,
|
||||||
@@ -27,24 +26,6 @@ export class AuthService {
|
|||||||
this.initializeAuth();
|
this.initializeAuth();
|
||||||
}
|
}
|
||||||
|
|
||||||
readonly modulesLoginRoutes = {
|
|
||||||
// ADMIN: ADMIN_API_ROUTES.login(),
|
|
||||||
// SCHOOL: SCHOOLS_API_ROUTES.login(),
|
|
||||||
// TEACHER: TEACHERS_API_ROUTES.login(),
|
|
||||||
} as Record<TRoles, string>;
|
|
||||||
|
|
||||||
readonly modulesSignupRoutes = {
|
|
||||||
// TEACHER: TEACHERS_API_ROUTES.signup(),
|
|
||||||
} as Record<TRoles, string>;
|
|
||||||
|
|
||||||
readonly modulesGetInfoRoutes = {
|
|
||||||
// SCHOOL: SCHOOLS_API_ROUTES.me(),
|
|
||||||
} as Record<TRoles, string>;
|
|
||||||
|
|
||||||
readonly modulesChangeInfoRoutes = {
|
|
||||||
// SCHOOL: SCHOOLS_API_ROUTES.editLoginInfo(),
|
|
||||||
} as Record<TRoles, string>;
|
|
||||||
|
|
||||||
private readonly http = inject(HttpClient);
|
private readonly http = inject(HttpClient);
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
private captchaService = inject(CaptchaService);
|
private captchaService = inject(CaptchaService);
|
||||||
@@ -113,35 +94,6 @@ export class AuthService {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
signup(credentials: ISignupRequestPayload, role: TRoles): Observable<IAuthResponse> {
|
|
||||||
this.isLoading.set(true);
|
|
||||||
this.isLoadingSubject.next(true);
|
|
||||||
// const baseHeaders = this.captchaService.buildCaptchaHeaders({}, captcha);
|
|
||||||
|
|
||||||
return this.http
|
|
||||||
.post<IAuthResponse>(
|
|
||||||
this.modulesSignupRoutes[role],
|
|
||||||
credentials,
|
|
||||||
// {
|
|
||||||
// headers: baseHeaders,
|
|
||||||
// },
|
|
||||||
)
|
|
||||||
.pipe(
|
|
||||||
tap((response) => {
|
|
||||||
this.handleAuthSuccess(response);
|
|
||||||
return response;
|
|
||||||
}),
|
|
||||||
catchError((error) => {
|
|
||||||
console.error('Signup error:', error);
|
|
||||||
this.isLoadingSubject.next(false);
|
|
||||||
throw error;
|
|
||||||
}),
|
|
||||||
finalize(() => {
|
|
||||||
this.isLoading.set(false);
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
logout(): void {
|
logout(): void {
|
||||||
localStorage.removeItem(LOCAL_STORAGE_KEYS.AUTH_TOKEN);
|
localStorage.removeItem(LOCAL_STORAGE_KEYS.AUTH_TOKEN);
|
||||||
localStorage.removeItem(LOCAL_STORAGE_KEYS.USER_DATA);
|
localStorage.removeItem(LOCAL_STORAGE_KEYS.USER_DATA);
|
||||||
@@ -190,9 +142,6 @@ export class AuthService {
|
|||||||
|
|
||||||
return throwError(() => new Error('متاسفانه مشکلی پیش آمده'));
|
return throwError(() => new Error('متاسفانه مشکلی پیش آمده'));
|
||||||
}
|
}
|
||||||
changeInfo(credentials: IUserLoginInfo, role: TRoles): Observable<IAuthResponse> {
|
|
||||||
return this.http.post<IAuthResponse>(this.modulesChangeInfoRoutes[role], credentials);
|
|
||||||
}
|
|
||||||
|
|
||||||
// prepareUserInfoBasedOnRole(role: TRoles, info: ISchoolMeResponse): Partial<IUserLoginInfo> {
|
// prepareUserInfoBasedOnRole(role: TRoles, info: ISchoolMeResponse): Partial<IUserLoginInfo> {
|
||||||
// if (role === 'SCHOOL') {
|
// if (role === 'SCHOOL') {
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './menuItems.const';
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { MenuItem } from 'primeng/api';
|
||||||
|
export const CONSUMER_MENU_ITEMS = [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
label: 'داشبورد',
|
||||||
|
icon: 'pi pi-fw pi-home',
|
||||||
|
routerLink: ['/'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
] as MenuItem[];
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<router-outlet></router-outlet>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { LayoutService } from '@/layout/service/layout.service';
|
||||||
|
import { Component, inject } from '@angular/core';
|
||||||
|
import { RouterOutlet } from '@angular/router';
|
||||||
|
import { CONSUMER_MENU_ITEMS } from '../constants';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'consumer-layout',
|
||||||
|
templateUrl: './layout.component.html',
|
||||||
|
imports: [RouterOutlet],
|
||||||
|
})
|
||||||
|
export class LayoutComponent {
|
||||||
|
private readonly layoutService = inject(LayoutService);
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.layoutService.setMenuItems(CONSUMER_MENU_ITEMS);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<div class="flex items-center justify-center h-svh w-svw">
|
||||||
|
<span class="text-center"> به پنل کسب و کار خوش آمدید </span>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'consumer-dashboard',
|
||||||
|
templateUrl: './index.component.html',
|
||||||
|
})
|
||||||
|
export class DashboardComponent {
|
||||||
|
constructor() {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { Route } from '@angular/router';
|
||||||
|
|
||||||
|
export const CONSUMER_ROUTES = {
|
||||||
|
path: 'consumer',
|
||||||
|
loadComponent: () => import('./layouts/layout.component').then((m) => m.LayoutComponent),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('./modules/dashboard/views/index.component').then((m) => m.DashboardComponent),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
} as Route;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './menuItems.const';
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { MenuItem } from 'primeng/api';
|
||||||
|
export const PARTNER_MENU_ITEMS = [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
label: 'داشبورد',
|
||||||
|
icon: 'pi pi-fw pi-home',
|
||||||
|
routerLink: ['/'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
] as MenuItem[];
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<router-outlet></router-outlet>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { LayoutService } from '@/layout/service/layout.service';
|
||||||
|
import { Component, inject } from '@angular/core';
|
||||||
|
import { RouterOutlet } from '@angular/router';
|
||||||
|
import { PARTNER_MENU_ITEMS } from '../constants';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'partner-layout',
|
||||||
|
templateUrl: './layout.component.html',
|
||||||
|
imports: [RouterOutlet],
|
||||||
|
})
|
||||||
|
export class LayoutComponent {
|
||||||
|
private readonly layoutService = inject(LayoutService);
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.layoutService.setMenuItems(PARTNER_MENU_ITEMS);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<div class="flex items-center justify-center h-svh w-svw">
|
||||||
|
<span class="text-center"> به پنل کسب و کار خوش آمدید </span>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'partner-dashboard',
|
||||||
|
templateUrl: './index.component.html',
|
||||||
|
})
|
||||||
|
export class DashboardComponent {
|
||||||
|
constructor() {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { Route } from '@angular/router';
|
||||||
|
|
||||||
|
export const PARTNER_ROUTES = {
|
||||||
|
path: 'partner',
|
||||||
|
component: undefined,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('./modules/dashboard/views/index.component').then((m) => m.DashboardComponent),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
} as Route;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './menuItems.const';
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { MenuItem } from 'primeng/api';
|
||||||
|
export const PROVIDER_MENU_ITEMS = [
|
||||||
|
{
|
||||||
|
items: [
|
||||||
|
{
|
||||||
|
label: 'داشبورد',
|
||||||
|
icon: 'pi pi-fw pi-home',
|
||||||
|
routerLink: ['/'],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
] as MenuItem[];
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<router-outlet></router-outlet>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { LayoutService } from '@/layout/service/layout.service';
|
||||||
|
import { Component, inject } from '@angular/core';
|
||||||
|
import { RouterOutlet } from '@angular/router';
|
||||||
|
import { PROVIDER_MENU_ITEMS } from '../constants';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-layout',
|
||||||
|
templateUrl: './layout.component.html',
|
||||||
|
imports: [RouterOutlet],
|
||||||
|
})
|
||||||
|
export class LayoutComponent {
|
||||||
|
private readonly layoutService = inject(LayoutService);
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.layoutService.setMenuItems(PROVIDER_MENU_ITEMS);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
<div class="flex items-center justify-center h-svh w-svw">
|
||||||
|
<span class="text-center"> به پنل ارایهدهنده خوش آمدید </span>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { Component } from '@angular/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'provider-dashboard',
|
||||||
|
templateUrl: './index.component.html',
|
||||||
|
})
|
||||||
|
export class DashboardComponent {
|
||||||
|
constructor() {}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { Route } from '@angular/router';
|
||||||
|
|
||||||
|
export const PROVIDER_ROUTES = {
|
||||||
|
path: 'provider',
|
||||||
|
loadComponent: () => import('./layouts/layout.component').then((m) => m.LayoutComponent),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('./modules/dashboard/views/index.component').then((m) => m.DashboardComponent),
|
||||||
|
},
|
||||||
|
],
|
||||||
|
} as Route;
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './menuItems.const';
|
||||||
+17
-11
@@ -1,11 +1,11 @@
|
|||||||
import { MenuItem } from 'primeng/api';
|
import { MenuItem } from 'primeng/api';
|
||||||
export const MENU_ITEMS = [
|
export const SUPER_ADMIN_MENU_ITEMS = [
|
||||||
{
|
{
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
label: 'داشبورد',
|
label: 'داشبورد',
|
||||||
icon: 'pi pi-fw pi-home',
|
icon: 'pi pi-fw pi-home',
|
||||||
routerLink: ['/dashboard'],
|
routerLink: ['/'],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -14,6 +14,16 @@ export const MENU_ITEMS = [
|
|||||||
label: 'مدیریت اطلاعات مرجع',
|
label: 'مدیریت اطلاعات مرجع',
|
||||||
icon: 'pi pi-fw pi-cog',
|
icon: 'pi pi-fw pi-cog',
|
||||||
items: [
|
items: [
|
||||||
|
{
|
||||||
|
label: 'اصناف',
|
||||||
|
icon: 'pi pi-fw pi-building',
|
||||||
|
routerLink: ['/super_admin/guilds'],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'لایسنسها',
|
||||||
|
icon: 'pi pi-fw pi-credit-card',
|
||||||
|
routerLink: ['/super_admin/licenses'],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'برندهای دستگاه',
|
label: 'برندهای دستگاه',
|
||||||
icon: 'pi pi-fw pi-list',
|
icon: 'pi pi-fw pi-list',
|
||||||
@@ -28,7 +38,7 @@ export const MENU_ITEMS = [
|
|||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: 'مدیریت سیستم',
|
label: 'مدیریت کاربران',
|
||||||
icon: 'pi pi-fw pi-cog',
|
icon: 'pi pi-fw pi-cog',
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
@@ -37,10 +47,11 @@ export const MENU_ITEMS = [
|
|||||||
routerLink: ['/super_admin/users'],
|
routerLink: ['/super_admin/users'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'اصناف',
|
label: 'مشتریان',
|
||||||
icon: 'pi pi-fw pi-building',
|
icon: 'pi pi-fw pi-user',
|
||||||
routerLink: ['/super_admin/guilds'],
|
routerLink: ['/super_admin/consumers'],
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
label: 'شرکای تجاری',
|
label: 'شرکای تجاری',
|
||||||
icon: 'pi pi-fw pi-credit-card',
|
icon: 'pi pi-fw pi-credit-card',
|
||||||
@@ -51,11 +62,6 @@ export const MENU_ITEMS = [
|
|||||||
icon: 'pi pi-fw pi-credit-card',
|
icon: 'pi pi-fw pi-credit-card',
|
||||||
routerLink: ['/super_admin/providers'],
|
routerLink: ['/super_admin/providers'],
|
||||||
},
|
},
|
||||||
{
|
|
||||||
label: 'لایسنسها',
|
|
||||||
icon: 'pi pi-fw pi-credit-card',
|
|
||||||
routerLink: ['/super_admin/licenses'],
|
|
||||||
},
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
] as MenuItem[];
|
] as MenuItem[];
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<router-outlet></router-outlet>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { LayoutService } from '@/layout/service/layout.service';
|
||||||
|
import { Component, inject } from '@angular/core';
|
||||||
|
import { RouterOutlet } from '@angular/router';
|
||||||
|
import { SUPER_ADMIN_MENU_ITEMS } from '../constants';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-layout',
|
||||||
|
templateUrl: './layout.component.html',
|
||||||
|
imports: [RouterOutlet],
|
||||||
|
})
|
||||||
|
export class LayoutComponent {
|
||||||
|
private readonly layoutService = inject(LayoutService);
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.layoutService.setMenuItems(SUPER_ADMIN_MENU_ITEMS);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
import { MustMatch, password } from '@/core/validators';
|
||||||
|
// import { CatalogRolesComponent } from '@/shared/catalog/roles';
|
||||||
|
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||||
|
import { EnumSelectComponent } from '@/shared/apiEnum/select.component';
|
||||||
|
import { InputComponent } from '@/shared/components';
|
||||||
|
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||||
|
import { UikitFieldComponent } from '@/uikit';
|
||||||
|
import { Component, inject, Input } from '@angular/core';
|
||||||
|
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
|
import { Dialog } from 'primeng/dialog';
|
||||||
|
import { Password } from 'primeng/password';
|
||||||
|
import { IConsumerAccountRequest, IConsumerAccountResponse } from '../../models';
|
||||||
|
import { AdminConsumerAccountsService } from '../../services/accounts.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-consumer-account-form',
|
||||||
|
templateUrl: './form.component.html',
|
||||||
|
imports: [
|
||||||
|
ReactiveFormsModule,
|
||||||
|
Dialog,
|
||||||
|
InputComponent,
|
||||||
|
FormFooterActionsComponent,
|
||||||
|
UikitFieldComponent,
|
||||||
|
Password,
|
||||||
|
EnumSelectComponent,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class ConsumerAccountFormComponent extends AbstractFormDialog<
|
||||||
|
IConsumerAccountRequest,
|
||||||
|
IConsumerAccountResponse
|
||||||
|
> {
|
||||||
|
private readonly service = inject(AdminConsumerAccountsService);
|
||||||
|
|
||||||
|
@Input({ required: true }) consumerId!: string;
|
||||||
|
@Input() accountId!: string;
|
||||||
|
|
||||||
|
initForm = () => {
|
||||||
|
if (this.editMode) {
|
||||||
|
return this.fb.group(
|
||||||
|
{
|
||||||
|
username: [this.initialValues?.username || '', [Validators.required]],
|
||||||
|
password: ['', [password()]],
|
||||||
|
confirmPassword: [''],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validators: [MustMatch('password', 'confirmPassword')],
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return this.fb.group(
|
||||||
|
{
|
||||||
|
username: [this.initialValues?.username || '', [Validators.required]],
|
||||||
|
// @ts-ignore
|
||||||
|
type: [this.initialValues?.type, [Validators.required]],
|
||||||
|
|
||||||
|
password: ['', [Validators.required, password()]],
|
||||||
|
confirmPassword: ['', [Validators.required]],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
validators: [MustMatch('password', 'confirmPassword')],
|
||||||
|
},
|
||||||
|
) as any;
|
||||||
|
};
|
||||||
|
|
||||||
|
form = this.initForm();
|
||||||
|
|
||||||
|
override ngOnChanges(): void {
|
||||||
|
this.form = this.initForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
submitForm() {
|
||||||
|
const formValue = this.form.value as IConsumerAccountRequest;
|
||||||
|
// @ts-ignore
|
||||||
|
const { confirmPassword, ...rest } = formValue;
|
||||||
|
if (this.editMode) {
|
||||||
|
return this.service.update(this.consumerId, this.accountId, rest);
|
||||||
|
}
|
||||||
|
return this.service.create(this.consumerId, rest);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<app-page-data-list
|
||||||
|
pageTitle="مدیریت حسابهای کاربری"
|
||||||
|
[addNewCtaLabel]="'افزودن حساب کاربری جدید'"
|
||||||
|
[columns]="columns"
|
||||||
|
[showAdd]="true"
|
||||||
|
emptyPlaceholderTitle="حساب کاربریای یافت نشد."
|
||||||
|
emptyPlaceholderDescription="برای افزودن حساب کاربری جدید، روی دکمهٔ بالا کلیک کنید."
|
||||||
|
[items]="items()"
|
||||||
|
[loading]="loading()"
|
||||||
|
[showDetails]="true"
|
||||||
|
[showAdd]="true"
|
||||||
|
(onAdd)="openAddForm()"
|
||||||
|
>
|
||||||
|
</app-page-data-list>
|
||||||
|
<superAdmin-consumer-account-form
|
||||||
|
[(visible)]="visibleForm"
|
||||||
|
[editMode]="editMode()"
|
||||||
|
[consumerId]="consumerId"
|
||||||
|
[accountId]="selectedItemForEdit()?.id || ''"
|
||||||
|
[initialValues]="selectedItemForEdit() || undefined"
|
||||||
|
(onSubmit)="refresh()"
|
||||||
|
/>
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
||||||
|
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
|
||||||
|
import {
|
||||||
|
IColumn,
|
||||||
|
PageDataListComponent,
|
||||||
|
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||||
|
import { Component, inject, Input } from '@angular/core';
|
||||||
|
import { IConsumerAccountResponse } from '../../models';
|
||||||
|
import { AdminConsumerAccountsService } from '../../services/accounts.service';
|
||||||
|
import { ConsumerAccountFormComponent } from './form.component';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-consumer-account-list',
|
||||||
|
templateUrl: './list.component.html',
|
||||||
|
imports: [PageDataListComponent, ConsumerAccountFormComponent],
|
||||||
|
})
|
||||||
|
export class ConsumerAccountListComponent extends AbstractList<IConsumerAccountResponse> {
|
||||||
|
@Input({ required: true }) consumerId!: string;
|
||||||
|
@Input() fullHeight?: boolean;
|
||||||
|
@Input() header: IColumn[] = [
|
||||||
|
{ field: 'id', header: 'شناسه' },
|
||||||
|
{
|
||||||
|
field: 'username',
|
||||||
|
header: 'نام کاربری',
|
||||||
|
type: 'nested',
|
||||||
|
nestedPath: 'account.username',
|
||||||
|
},
|
||||||
|
{ field: 'role', header: 'نوع حساب' },
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
header: 'وضعیت',
|
||||||
|
type: 'nested',
|
||||||
|
nestedPath: 'account.status',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'created_at',
|
||||||
|
header: 'تاریخ ایجاد',
|
||||||
|
type: 'date',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
private readonly service = inject(AdminConsumerAccountsService);
|
||||||
|
|
||||||
|
override setColumns(): void {
|
||||||
|
this.columns = this.header;
|
||||||
|
}
|
||||||
|
|
||||||
|
override getDataRequest() {
|
||||||
|
return this.service.getAll(this.consumerId);
|
||||||
|
}
|
||||||
|
}
|
||||||
+7
-7
@@ -7,10 +7,10 @@ import { Component, inject, Input } from '@angular/core';
|
|||||||
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { Dialog } from 'primeng/dialog';
|
import { Dialog } from 'primeng/dialog';
|
||||||
import { IBusinessActivityRequest, IBusinessActivityResponse } from '../../models';
|
import { IBusinessActivityRequest, IBusinessActivityResponse } from '../../models';
|
||||||
import { AdminUserBusinessActivitiesService } from '../../services/businessActivities.service';
|
import { AdminConsumerBusinessActivitiesService } from '../../services/businessActivities.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'superAdmin-user-businessActivities-form',
|
selector: 'superAdmin-consumer-businessActivities-form',
|
||||||
templateUrl: './form.component.html',
|
templateUrl: './form.component.html',
|
||||||
imports: [
|
imports: [
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
@@ -20,13 +20,13 @@ import { AdminUserBusinessActivitiesService } from '../../services/businessActiv
|
|||||||
CatalogGuildSelectComponent,
|
CatalogGuildSelectComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class UserBusinessActivitiesFormComponent extends AbstractFormDialog<
|
export class ConsumerBusinessActivitiesFormComponent extends AbstractFormDialog<
|
||||||
IBusinessActivityRequest,
|
IBusinessActivityRequest,
|
||||||
IBusinessActivityResponse
|
IBusinessActivityResponse
|
||||||
> {
|
> {
|
||||||
private readonly service = inject(AdminUserBusinessActivitiesService);
|
private readonly service = inject(AdminConsumerBusinessActivitiesService);
|
||||||
|
|
||||||
@Input() userId!: string;
|
@Input({ required: true }) consumerId!: string;
|
||||||
@Input() businessActivityId!: string;
|
@Input() businessActivityId!: string;
|
||||||
|
|
||||||
initForm = () => {
|
initForm = () => {
|
||||||
@@ -50,8 +50,8 @@ export class UserBusinessActivitiesFormComponent extends AbstractFormDialog<
|
|||||||
submitForm() {
|
submitForm() {
|
||||||
const formValue = this.form.value as IBusinessActivityRequest;
|
const formValue = this.form.value as IBusinessActivityRequest;
|
||||||
if (this.editMode) {
|
if (this.editMode) {
|
||||||
return this.service.update(this.userId, this.businessActivityId, formValue);
|
return this.service.update(this.consumerId, this.businessActivityId, formValue);
|
||||||
}
|
}
|
||||||
return this.service.create(this.userId, formValue);
|
return this.service.create(this.consumerId, formValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-5
@@ -17,14 +17,11 @@ export class SuperAdminUserBusinessActivityLayoutComponent {
|
|||||||
readonly businessActivity = computed(() => this.store.entity());
|
readonly businessActivity = computed(() => this.store.entity());
|
||||||
readonly pageParams = computed(() => pageParamsUtils(this.route));
|
readonly pageParams = computed(() => pageParamsUtils(this.route));
|
||||||
|
|
||||||
readonly userId = computed(() => this.pageParams()['userId']!);
|
readonly consumerId = computed(() => this.pageParams()['consumerId']!);
|
||||||
readonly user = computed(() => this.pageParams()['userId']!);
|
|
||||||
readonly businessId = computed(() => this.pageParams()['businessActivityId']!);
|
readonly businessId = computed(() => this.pageParams()['businessActivityId']!);
|
||||||
|
|
||||||
getData() {
|
getData() {
|
||||||
console.log(this.pageParams());
|
this.store.getData(this.consumerId(), this.businessId());
|
||||||
|
|
||||||
this.store.getData(this.userId(), this.businessId());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
+2
-2
@@ -15,10 +15,10 @@
|
|||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<superAdmin-user-businessActivities-form
|
<superAdmin-consumer-businessActivities-form
|
||||||
[(visible)]="visibleForm"
|
[(visible)]="visibleForm"
|
||||||
[editMode]="editMode()"
|
[editMode]="editMode()"
|
||||||
[userId]="userId"
|
[consumerId]="consumerId"
|
||||||
[businessActivityId]="selectedItemForEdit()?.id || ''"
|
[businessActivityId]="selectedItemForEdit()?.id || ''"
|
||||||
[initialValues]="selectedItemForEdit() || undefined"
|
[initialValues]="selectedItemForEdit() || undefined"
|
||||||
(onSubmit)="refresh()"
|
(onSubmit)="refresh()"
|
||||||
+11
-11
@@ -6,18 +6,18 @@ import {
|
|||||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||||
import { Component, inject, Input } from '@angular/core';
|
import { Component, inject, Input } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { superAdminUserBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||||
import { IBusinessActivityResponse } from '../../models';
|
import { IBusinessActivityResponse } from '../../models';
|
||||||
import { AdminUserBusinessActivitiesService } from '../../services/businessActivities.service';
|
import { AdminConsumerBusinessActivitiesService } from '../../services/businessActivities.service';
|
||||||
import { UserBusinessActivitiesFormComponent } from './form.component';
|
import { ConsumerBusinessActivitiesFormComponent } from './form.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'superAdmin-user-businessActivities-list',
|
selector: 'superAdmin-consumer-businessActivities-list',
|
||||||
templateUrl: './list.component.html',
|
templateUrl: './list.component.html',
|
||||||
imports: [PageDataListComponent, UserBusinessActivitiesFormComponent],
|
imports: [PageDataListComponent, ConsumerBusinessActivitiesFormComponent],
|
||||||
})
|
})
|
||||||
export class UserBusinessActivitiesComponent extends AbstractList<IBusinessActivityResponse> {
|
export class ConsumerBusinessActivitiesComponent extends AbstractList<IBusinessActivityResponse> {
|
||||||
@Input() userId!: string;
|
@Input({ required: true }) consumerId!: string;
|
||||||
@Input() fullHeight?: boolean;
|
@Input() fullHeight?: boolean;
|
||||||
@Input() header: IColumn[] = [
|
@Input() header: IColumn[] = [
|
||||||
{ field: 'id', header: 'شناسه' },
|
{ field: 'id', header: 'شناسه' },
|
||||||
@@ -30,7 +30,7 @@ export class UserBusinessActivitiesComponent extends AbstractList<IBusinessActiv
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
private readonly service = inject(AdminUserBusinessActivitiesService);
|
private readonly service = inject(AdminConsumerBusinessActivitiesService);
|
||||||
private readonly router = inject(Router);
|
private readonly router = inject(Router);
|
||||||
|
|
||||||
override setColumns(): void {
|
override setColumns(): void {
|
||||||
@@ -38,13 +38,13 @@ export class UserBusinessActivitiesComponent extends AbstractList<IBusinessActiv
|
|||||||
}
|
}
|
||||||
|
|
||||||
override getDataRequest() {
|
override getDataRequest() {
|
||||||
return this.service.getAll(this.userId);
|
return this.service.getAll(this.consumerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
toSinglePage(item: IBusinessActivityResponse) {
|
toSinglePage(item: IBusinessActivityResponse) {
|
||||||
this.router.navigateByUrl(
|
this.router.navigateByUrl(
|
||||||
superAdminUserBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
||||||
this.userId,
|
this.consumerId,
|
||||||
item.id,
|
item.id,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
+10
-5
@@ -9,17 +9,17 @@ import { IComplexRequest, IComplexResponse } from '../../models';
|
|||||||
import { AdminComplexesService } from '../../services/complexes.service';
|
import { AdminComplexesService } from '../../services/complexes.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'superAdmin-user-complex-form',
|
selector: 'superAdmin-consumer-complex-form',
|
||||||
templateUrl: './form.component.html',
|
templateUrl: './form.component.html',
|
||||||
imports: [ReactiveFormsModule, Dialog, InputComponent, FormFooterActionsComponent],
|
imports: [ReactiveFormsModule, Dialog, InputComponent, FormFooterActionsComponent],
|
||||||
})
|
})
|
||||||
export class UserComplexFormComponent extends AbstractFormDialog<
|
export class ConsumerComplexFormComponent extends AbstractFormDialog<
|
||||||
IComplexRequest,
|
IComplexRequest,
|
||||||
IComplexResponse
|
IComplexResponse
|
||||||
> {
|
> {
|
||||||
private readonly service = inject(AdminComplexesService);
|
private readonly service = inject(AdminComplexesService);
|
||||||
|
|
||||||
@Input() userId!: string;
|
@Input({ required: true }) consumerId!: string;
|
||||||
@Input() businessActivityId!: string;
|
@Input() businessActivityId!: string;
|
||||||
@Input() complexId!: string;
|
@Input() complexId!: string;
|
||||||
|
|
||||||
@@ -44,8 +44,13 @@ export class UserComplexFormComponent extends AbstractFormDialog<
|
|||||||
submitForm() {
|
submitForm() {
|
||||||
const formValue = this.form.value as IComplexRequest;
|
const formValue = this.form.value as IComplexRequest;
|
||||||
if (this.editMode) {
|
if (this.editMode) {
|
||||||
return this.service.update(this.userId, this.businessActivityId, this.complexId, formValue);
|
return this.service.update(
|
||||||
|
this.consumerId,
|
||||||
|
this.businessActivityId,
|
||||||
|
this.complexId,
|
||||||
|
formValue,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return this.service.create(this.userId, this.businessActivityId, formValue);
|
return this.service.create(this.consumerId, this.businessActivityId, formValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+4
-4
@@ -5,23 +5,23 @@ import { ActivatedRoute, RouterOutlet } from '@angular/router';
|
|||||||
import { ComplexStore } from '../../store/complex.store';
|
import { ComplexStore } from '../../store/complex.store';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'superAdmin-user-complex-layout',
|
selector: 'superAdmin-consumer-complex-layout',
|
||||||
templateUrl: './layout.component.html',
|
templateUrl: './layout.component.html',
|
||||||
imports: [PageLoadingComponent, RouterOutlet],
|
imports: [PageLoadingComponent, RouterOutlet],
|
||||||
})
|
})
|
||||||
export class SuperAdminUserComplexLayoutComponent {
|
export class SuperAdminConsumerComplexLayoutComponent {
|
||||||
private readonly store = inject(ComplexStore);
|
private readonly store = inject(ComplexStore);
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
|
||||||
readonly loading = computed(() => this.store.loading());
|
readonly loading = computed(() => this.store.loading());
|
||||||
readonly pageParams = computed(() => pageParamsUtils(this.route));
|
readonly pageParams = computed(() => pageParamsUtils(this.route));
|
||||||
|
|
||||||
readonly userId = computed(() => this.pageParams()['userId']!);
|
readonly consumerId = computed(() => this.pageParams()['consumerId']!);
|
||||||
readonly businessId = computed(() => this.pageParams()['businessActivityId']!);
|
readonly businessId = computed(() => this.pageParams()['businessActivityId']!);
|
||||||
readonly complexId = computed(() => this.pageParams()['complexId']!);
|
readonly complexId = computed(() => this.pageParams()['complexId']!);
|
||||||
|
|
||||||
getData() {
|
getData() {
|
||||||
this.store.getData(this.userId(), this.businessId(), this.complexId());
|
this.store.getData(this.consumerId(), this.businessId(), this.complexId());
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
+2
-2
@@ -15,10 +15,10 @@
|
|||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<superAdmin-user-complex-form
|
<superAdmin-consumer-complex-form
|
||||||
[(visible)]="visibleForm"
|
[(visible)]="visibleForm"
|
||||||
[editMode]="editMode()"
|
[editMode]="editMode()"
|
||||||
[userId]="userId"
|
[consumerId]="consumerId"
|
||||||
[businessActivityId]="businessId"
|
[businessActivityId]="businessId"
|
||||||
[complexId]="selectedItemForEdit()?.id || ''"
|
[complexId]="selectedItemForEdit()?.id || ''"
|
||||||
[initialValues]="selectedItemForEdit() || undefined"
|
[initialValues]="selectedItemForEdit() || undefined"
|
||||||
+9
-9
@@ -6,18 +6,18 @@ import {
|
|||||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||||
import { Component, inject, Input } from '@angular/core';
|
import { Component, inject, Input } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { superAdminUserComplexesNamedRoutes } from '../../constants/routes/complexes';
|
import { superAdminConsumerComplexesNamedRoutes } from '../../constants/routes/complexes';
|
||||||
import { IComplexResponse } from '../../models';
|
import { IComplexResponse } from '../../models';
|
||||||
import { AdminComplexesService } from '../../services/complexes.service';
|
import { AdminComplexesService } from '../../services/complexes.service';
|
||||||
import { UserComplexFormComponent } from './form.component';
|
import { ConsumerComplexFormComponent } from './form.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'superAdmin-user-complexes-list',
|
selector: 'superAdmin-consumer-complexes-list',
|
||||||
templateUrl: './list.component.html',
|
templateUrl: './list.component.html',
|
||||||
imports: [PageDataListComponent, UserComplexFormComponent],
|
imports: [PageDataListComponent, ConsumerComplexFormComponent],
|
||||||
})
|
})
|
||||||
export class UserComplexesComponent extends AbstractList<IComplexResponse> {
|
export class ConsumerComplexesComponent extends AbstractList<IComplexResponse> {
|
||||||
@Input() userId!: string;
|
@Input() consumerId!: string;
|
||||||
@Input() businessId!: string;
|
@Input() businessId!: string;
|
||||||
@Input() fullHeight?: boolean;
|
@Input() fullHeight?: boolean;
|
||||||
@Input() header: IColumn[] = [
|
@Input() header: IColumn[] = [
|
||||||
@@ -38,13 +38,13 @@ export class UserComplexesComponent extends AbstractList<IComplexResponse> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override getDataRequest() {
|
override getDataRequest() {
|
||||||
return this.service.getAll(this.userId, this.businessId);
|
return this.service.getAll(this.consumerId, this.businessId);
|
||||||
}
|
}
|
||||||
|
|
||||||
toSinglePage(item: IComplexResponse) {
|
toSinglePage(item: IComplexResponse) {
|
||||||
this.router.navigateByUrl(
|
this.router.navigateByUrl(
|
||||||
superAdminUserComplexesNamedRoutes.complex.meta.pagePath!(
|
superAdminConsumerComplexesNamedRoutes.complex.meta.pagePath!(
|
||||||
this.userId,
|
this.consumerId,
|
||||||
this.businessId,
|
this.businessId,
|
||||||
item.id,
|
item.id,
|
||||||
),
|
),
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<p-dialog
|
||||||
|
[header]="preparedTitle()"
|
||||||
|
[(visible)]="visible"
|
||||||
|
[modal]="true"
|
||||||
|
[style]="{ width: '500px' }"
|
||||||
|
[closable]="true"
|
||||||
|
(onHide)="close()"
|
||||||
|
>
|
||||||
|
<form [formGroup]="form" (submit)="submit()" class="flex flex-col gap-4">
|
||||||
|
<app-input label="نام" [control]="form.controls.first_name" name="first_name" />
|
||||||
|
<app-input label="نام خانوادگی" [control]="form.controls.last_name" name="last_name" />
|
||||||
|
<app-input label="موبایل" [control]="form.controls.mobile_number" name="mobile_number" type="mobile" />
|
||||||
|
@if (!editMode) {
|
||||||
|
<p-divider align="center"> اطلاعات ورود </p-divider>
|
||||||
|
<!-- @ts-ignore -->
|
||||||
|
<app-input label="نام کاربری" [control]="form.controls.username" name="username" [isLtrInput]="true" />
|
||||||
|
<uikit-field label="رمز عبور" class="" [control]="form.controls.password">
|
||||||
|
<p-password
|
||||||
|
id="password1"
|
||||||
|
name="password"
|
||||||
|
formControlName="password"
|
||||||
|
autocomplete="password"
|
||||||
|
[toggleMask]="true"
|
||||||
|
[fluid]="true"
|
||||||
|
[feedback]="false"
|
||||||
|
[invalid]="form.controls.password.touched && form.controls.password.invalid"
|
||||||
|
/>
|
||||||
|
<span class="text-xs mt-1 text-muted-color">
|
||||||
|
رمز باید حداقل ۸ کاراکتر بوده و شامل حداقل یک حرف بزرگ، یک حرف کوچک، یک عدد و یک کاراکتر ویژه باشد.
|
||||||
|
</span>
|
||||||
|
</uikit-field>
|
||||||
|
|
||||||
|
<uikit-field label="تکرار رمز عبور" class="" [control]="form.controls.confirmPassword">
|
||||||
|
<p-password
|
||||||
|
id="confirmPassword"
|
||||||
|
name="confirmPassword"
|
||||||
|
formControlName="confirmPassword"
|
||||||
|
autocomplete="new-password"
|
||||||
|
[toggleMask]="true"
|
||||||
|
[fluid]="true"
|
||||||
|
[feedback]="false"
|
||||||
|
[invalid]="form.controls.confirmPassword.touched && form.controls.confirmPassword.invalid"
|
||||||
|
/>
|
||||||
|
</uikit-field>
|
||||||
|
}
|
||||||
|
<app-form-footer-actions [submitLabel]="'ذخیره'" [loading]="submitLoading()" (onCancel)="close()" />
|
||||||
|
</form>
|
||||||
|
</p-dialog>
|
||||||
@@ -0,0 +1,101 @@
|
|||||||
|
import { mobileValidator, MustMatch } from '@/core/validators';
|
||||||
|
import { AbstractFormDialog } from '@/shared/abstractClasses';
|
||||||
|
import { InputComponent } from '@/shared/components';
|
||||||
|
import { FormFooterActionsComponent } from '@/shared/components/formFooterActions/form-footer-actions.component';
|
||||||
|
import { UikitFieldComponent } from '@/uikit';
|
||||||
|
import { Component, computed, inject, Input } from '@angular/core';
|
||||||
|
import { ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
|
import { Dialog } from 'primeng/dialog';
|
||||||
|
import { Divider } from 'primeng/divider';
|
||||||
|
import { Password } from 'primeng/password';
|
||||||
|
import { IConsumerRequest, IConsumerResponse } from '../models';
|
||||||
|
import { ConsumersService } from '../services/main.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-consumer-form',
|
||||||
|
templateUrl: './form.component.html',
|
||||||
|
imports: [
|
||||||
|
ReactiveFormsModule,
|
||||||
|
Dialog,
|
||||||
|
InputComponent,
|
||||||
|
FormFooterActionsComponent,
|
||||||
|
Divider,
|
||||||
|
UikitFieldComponent,
|
||||||
|
Password,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class ConsumerUserFormComponent extends AbstractFormDialog<
|
||||||
|
IConsumerRequest,
|
||||||
|
IConsumerResponse
|
||||||
|
> {
|
||||||
|
@Input() consumerId?: string;
|
||||||
|
private service = inject(ConsumersService);
|
||||||
|
|
||||||
|
preparedTitle = computed(() => `${this.editMode ? 'ویرایش' : 'ایجاد'} مشتری`);
|
||||||
|
|
||||||
|
initForm = () => {
|
||||||
|
const form = this.fb.group({
|
||||||
|
first_name: [this.initialValues?.first_name || '', [Validators.required]],
|
||||||
|
last_name: [this.initialValues?.last_name || '', [Validators.required]],
|
||||||
|
mobile_number: [
|
||||||
|
this.initialValues?.mobile_number || '',
|
||||||
|
[Validators.required, mobileValidator()],
|
||||||
|
],
|
||||||
|
username: [''],
|
||||||
|
password: [''],
|
||||||
|
confirmPassword: [''],
|
||||||
|
});
|
||||||
|
if (!this.editMode) {
|
||||||
|
form.addControl(
|
||||||
|
'username',
|
||||||
|
this.fb.control<string>('', {
|
||||||
|
nonNullable: true,
|
||||||
|
validators: [Validators.required],
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
form.addControl(
|
||||||
|
'password',
|
||||||
|
this.fb.control<string>('', {
|
||||||
|
nonNullable: true,
|
||||||
|
validators: [Validators.required],
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
form.addControl(
|
||||||
|
'confirmPassword',
|
||||||
|
this.fb.control<string>('', {
|
||||||
|
nonNullable: true,
|
||||||
|
validators: [Validators.required],
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
form.addValidators([MustMatch('password', 'confirmPassword')]);
|
||||||
|
} else {
|
||||||
|
// @ts-ignore
|
||||||
|
form.removeControl('username');
|
||||||
|
// @ts-ignore
|
||||||
|
form.removeControl('password');
|
||||||
|
// @ts-ignore
|
||||||
|
form.removeControl('confirmPassword');
|
||||||
|
form.removeValidators([MustMatch('password', 'confirmPassword')]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return form;
|
||||||
|
};
|
||||||
|
|
||||||
|
form = this.initForm();
|
||||||
|
|
||||||
|
override ngOnChanges() {
|
||||||
|
this.form.patchValue(this.initialValues ?? {});
|
||||||
|
if (this.editMode && !this.consumerId) {
|
||||||
|
throw 'missing some arguments';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override submitForm(payload: IConsumerRequest) {
|
||||||
|
if (this.editMode) {
|
||||||
|
return this.service.update(this.consumerId!, payload);
|
||||||
|
}
|
||||||
|
// @ts-ignore
|
||||||
|
const { confirmPassword, ...rest } = payload;
|
||||||
|
return this.service.create(rest);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { PageLoadingComponent } from '@/shared/components/page-loading.component';
|
||||||
|
import { Component, computed, inject, signal } from '@angular/core';
|
||||||
|
import { ActivatedRoute, RouterOutlet } from '@angular/router';
|
||||||
|
import { ConsumerStore } from '../store/consumer.store';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-consumer-layout',
|
||||||
|
templateUrl: './layout.component.html',
|
||||||
|
imports: [PageLoadingComponent, RouterOutlet],
|
||||||
|
})
|
||||||
|
export class ConsumerLayoutComponent {
|
||||||
|
private readonly store = inject(ConsumerStore);
|
||||||
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
|
||||||
|
readonly consumerId = signal<string>(this.route.snapshot.paramMap.get('consumerId')!);
|
||||||
|
|
||||||
|
readonly loading = computed(() => this.store.loading());
|
||||||
|
readonly consumer = computed(() => this.store.entity());
|
||||||
|
|
||||||
|
getData() {
|
||||||
|
this.store.getData(this.consumerId());
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.getData();
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-5
@@ -12,7 +12,7 @@ import { IPosRequest, IPosResponse } from '../../models';
|
|||||||
import { AdminPosesService } from '../../services/poses.service';
|
import { AdminPosesService } from '../../services/poses.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'superAdmin-user-pos-form',
|
selector: 'superAdmin-consumer-pos-form',
|
||||||
templateUrl: './form.component.html',
|
templateUrl: './form.component.html',
|
||||||
imports: [
|
imports: [
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
@@ -24,17 +24,15 @@ import { AdminPosesService } from '../../services/poses.service';
|
|||||||
EnumSelectComponent,
|
EnumSelectComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class UserPosFormComponent extends AbstractFormDialog<IPosRequest, IPosResponse> {
|
export class ConsumerPosFormComponent extends AbstractFormDialog<IPosRequest, IPosResponse> {
|
||||||
private readonly service = inject(AdminPosesService);
|
private readonly service = inject(AdminPosesService);
|
||||||
|
|
||||||
@Input({ required: true }) userId!: string;
|
@Input({ required: true }) consumerId!: string;
|
||||||
@Input({ required: true }) businessActivityId!: string;
|
@Input({ required: true }) businessActivityId!: string;
|
||||||
@Input({ required: true }) complexId!: string;
|
@Input({ required: true }) complexId!: string;
|
||||||
@Input() posId!: string;
|
@Input() posId!: string;
|
||||||
|
|
||||||
initForm = () => {
|
initForm = () => {
|
||||||
console.log('posId', this.posId);
|
|
||||||
|
|
||||||
const form = this.fb.group({
|
const form = this.fb.group({
|
||||||
name: [this.initialValues?.name || '', [Validators.required]],
|
name: [this.initialValues?.name || '', [Validators.required]],
|
||||||
serial: [this.initialValues?.serial || '', [Validators.required]],
|
serial: [this.initialValues?.serial || '', [Validators.required]],
|
||||||
+2
-3
@@ -5,18 +5,17 @@ import { ActivatedRoute, RouterOutlet } from '@angular/router';
|
|||||||
import { PosStore } from '../../store/pos.store';
|
import { PosStore } from '../../store/pos.store';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'superAdmin-user-pos-layout',
|
selector: 'superAdmin-consumer-pos-layout',
|
||||||
templateUrl: './layout.component.html',
|
templateUrl: './layout.component.html',
|
||||||
imports: [PageLoadingComponent, RouterOutlet],
|
imports: [PageLoadingComponent, RouterOutlet],
|
||||||
})
|
})
|
||||||
export class SuperAdminUserPosLayoutComponent {
|
export class SuperAdminConsumerPosLayoutComponent {
|
||||||
private readonly store = inject(PosStore);
|
private readonly store = inject(PosStore);
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
|
||||||
readonly loading = computed(() => this.store.loading());
|
readonly loading = computed(() => this.store.loading());
|
||||||
readonly pageParams = computed(() => pageParamsUtils(this.route));
|
readonly pageParams = computed(() => pageParamsUtils(this.route));
|
||||||
|
|
||||||
readonly userId = computed(() => this.pageParams()['userId']!);
|
|
||||||
readonly businessId = computed(() => this.pageParams()['businessActivityId']!);
|
readonly businessId = computed(() => this.pageParams()['businessActivityId']!);
|
||||||
readonly complexId = computed(() => this.pageParams()['complexId']!);
|
readonly complexId = computed(() => this.pageParams()['complexId']!);
|
||||||
readonly posId = computed(() => this.pageParams()['posId']!);
|
readonly posId = computed(() => this.pageParams()['posId']!);
|
||||||
+2
-2
@@ -15,10 +15,10 @@
|
|||||||
(onDetails)="toSinglePage($event)"
|
(onDetails)="toSinglePage($event)"
|
||||||
>
|
>
|
||||||
</app-page-data-list>
|
</app-page-data-list>
|
||||||
<superAdmin-user-pos-form
|
<superAdmin-consumer-pos-form
|
||||||
[(visible)]="visibleForm"
|
[(visible)]="visibleForm"
|
||||||
[editMode]="editMode()"
|
[editMode]="editMode()"
|
||||||
[userId]="userId"
|
[consumerId]="consumerId"
|
||||||
[businessActivityId]="businessId"
|
[businessActivityId]="businessId"
|
||||||
[complexId]="complexId"
|
[complexId]="complexId"
|
||||||
[posId]="selectedItemForEdit()?.id || ''"
|
[posId]="selectedItemForEdit()?.id || ''"
|
||||||
+10
-10
@@ -6,20 +6,20 @@ import {
|
|||||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||||
import { Component, inject, Input } from '@angular/core';
|
import { Component, inject, Input } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { superAdminUserPosesNamedRoutes } from '../../constants/routes/poses';
|
import { superAdminConsumerPosesNamedRoutes } from '../../constants/routes/poses';
|
||||||
import { IPosResponse } from '../../models';
|
import { IPosResponse } from '../../models';
|
||||||
import { AdminPosesService } from '../../services/poses.service';
|
import { AdminPosesService } from '../../services/poses.service';
|
||||||
import { UserPosFormComponent } from './form.component';
|
import { ConsumerPosFormComponent } from './form.component';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'superAdmin-user-poses-list',
|
selector: 'superAdmin-consumer-poses-list',
|
||||||
templateUrl: './list.component.html',
|
templateUrl: './list.component.html',
|
||||||
imports: [PageDataListComponent, UserPosFormComponent],
|
imports: [PageDataListComponent, ConsumerPosFormComponent],
|
||||||
})
|
})
|
||||||
export class UserPosesComponent extends AbstractList<IPosResponse> {
|
export class ConsumerPosesComponent extends AbstractList<IPosResponse> {
|
||||||
@Input() userId!: string;
|
@Input({ required: true }) consumerId!: string;
|
||||||
@Input() businessId!: string;
|
@Input({ required: true }) businessId!: string;
|
||||||
@Input() complexId!: string;
|
@Input({ required: true }) complexId!: string;
|
||||||
@Input() fullHeight?: boolean;
|
@Input() fullHeight?: boolean;
|
||||||
@Input() header: IColumn[] = [
|
@Input() header: IColumn[] = [
|
||||||
{ field: 'id', header: 'شناسه' },
|
{ field: 'id', header: 'شناسه' },
|
||||||
@@ -49,8 +49,8 @@ export class UserPosesComponent extends AbstractList<IPosResponse> {
|
|||||||
|
|
||||||
toSinglePage(item: IPosResponse) {
|
toSinglePage(item: IPosResponse) {
|
||||||
this.router.navigateByUrl(
|
this.router.navigateByUrl(
|
||||||
superAdminUserPosesNamedRoutes.pos.meta.pagePath!(
|
superAdminConsumerPosesNamedRoutes.pos.meta.pagePath!(
|
||||||
this.userId,
|
this.consumerId,
|
||||||
this.businessId,
|
this.businessId,
|
||||||
this.complexId,
|
this.complexId,
|
||||||
item.id,
|
item.id,
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
const baseUrl = (consumerId: string) => `/api/v1/admin/consumers/${consumerId}/accounts`;
|
||||||
|
|
||||||
|
export const CONSUMER_ACCOUNTS_API_ROUTES = {
|
||||||
|
list: (consumerId: string) => `${baseUrl(consumerId)}`,
|
||||||
|
single: (consumerId: string, accountId: string) => `${baseUrl(consumerId)}/${accountId}`,
|
||||||
|
};
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
const baseUrl = (consumerId: string) => `/api/v1/admin/consumers/${consumerId}/business_activities`;
|
||||||
|
|
||||||
|
export const BUSINESS_ACTIVITIES_API_ROUTES = {
|
||||||
|
list: (consumerId: string) => `${baseUrl(consumerId)}`,
|
||||||
|
single: (consumerId: string, business_activity_id: string) =>
|
||||||
|
`${baseUrl(consumerId)}/${business_activity_id}`,
|
||||||
|
};
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
const baseUrl = (consumerId: string, business_activity_id: string) =>
|
||||||
|
`/api/v1/admin/consumers/${consumerId}/business_activities/${business_activity_id}/complexes`;
|
||||||
|
|
||||||
|
export const BUSINESS_ACTIVITY_COMPLEXES_API_ROUTES = {
|
||||||
|
list: (consumerId: string, business_activity_id: string) =>
|
||||||
|
`${baseUrl(consumerId, business_activity_id)}`,
|
||||||
|
single: (consumerId: string, business_activity_id: string, complex_id: string) =>
|
||||||
|
`${baseUrl(consumerId, business_activity_id)}/${complex_id}`,
|
||||||
|
};
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
export * from './accounts';
|
||||||
|
|
||||||
|
const baseUrl = '/api/v1/admin/consumers';
|
||||||
|
|
||||||
|
export const CONSUMERS_API_ROUTES = {
|
||||||
|
list: () => `${baseUrl}`,
|
||||||
|
single: (id: string) => `${baseUrl}/${id}`,
|
||||||
|
};
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { NamedRoutes } from '@/core';
|
||||||
|
import { Routes } from '@angular/router';
|
||||||
|
|
||||||
|
export type TAccountsRouteNames = 'accounts' | 'account';
|
||||||
|
|
||||||
|
export const superAdminConsumerAccountsNamedRoutes: NamedRoutes<TAccountsRouteNames> = {
|
||||||
|
accounts: {
|
||||||
|
path: 'accounts',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('../../views/accounts/list.component').then((m) => m.ConsumerAccountsComponent),
|
||||||
|
// @ts-ignore
|
||||||
|
meta: {
|
||||||
|
title: 'حسابهای کاربری',
|
||||||
|
pagePath: (consumerId: string) => `/super_admin/consumers/${consumerId}/accounts`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
account: {
|
||||||
|
path: 'accounts/:accountId',
|
||||||
|
meta: {
|
||||||
|
title: 'حساب کاربری',
|
||||||
|
pagePath: (consumerId: string, accountId: string) =>
|
||||||
|
`/super_admin/consumers/${consumerId}/accounts/${accountId}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SUPER_ADMIN_CONSUMER_ACCOUNTS_ROUTES: Routes = [
|
||||||
|
superAdminConsumerAccountsNamedRoutes.accounts,
|
||||||
|
];
|
||||||
+12
-10
@@ -1,10 +1,10 @@
|
|||||||
import { NamedRoutes } from '@/core';
|
import { NamedRoutes } from '@/core';
|
||||||
import { Routes } from '@angular/router';
|
import { Routes } from '@angular/router';
|
||||||
import { SUPER_ADMIN_USER_COMPLEXES_ROUTES } from './complexes';
|
import { SUPER_ADMIN_CONSUMER_COMPLEXES_ROUTES } from './complexes';
|
||||||
|
|
||||||
export type TBusinessActivitiesRouteNames = 'businessActivities' | 'businessActivity';
|
export type TBusinessActivitiesRouteNames = 'businessActivities' | 'businessActivity';
|
||||||
|
|
||||||
export const superAdminUserBusinessActivitiesNamedRoutes: NamedRoutes<TBusinessActivitiesRouteNames> =
|
export const superAdminConsumerBusinessActivitiesNamedRoutes: NamedRoutes<TBusinessActivitiesRouteNames> =
|
||||||
{
|
{
|
||||||
businessActivities: {
|
businessActivities: {
|
||||||
path: 'business_activities',
|
path: 'business_activities',
|
||||||
@@ -15,7 +15,8 @@ export const superAdminUserBusinessActivitiesNamedRoutes: NamedRoutes<TBusinessA
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
meta: {
|
meta: {
|
||||||
title: 'فعالیتهای اقتصادی',
|
title: 'فعالیتهای اقتصادی',
|
||||||
pagePath: (userId: string) => `/super_admin/users/${userId}/business_activities`,
|
pagePath: (consumerId: string) =>
|
||||||
|
`/super_admin/consumers/${consumerId}/business_activities`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
businessActivity: {
|
businessActivity: {
|
||||||
@@ -27,16 +28,16 @@ export const superAdminUserBusinessActivitiesNamedRoutes: NamedRoutes<TBusinessA
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
meta: {
|
meta: {
|
||||||
title: 'فعالیت اقتصادی',
|
title: 'فعالیت اقتصادی',
|
||||||
pagePath: (userId: string, businessId: string) =>
|
pagePath: (consumerId: string, businessId: string) =>
|
||||||
`/super_admin/users/${userId}/business_activities/${businessId}`,
|
`/super_admin/consumers/${consumerId}/business_activities/${businessId}`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const SUPER_ADMIN_USER_BUSINESS_ACTIVITIES_ROUTES: Routes = [
|
export const SUPER_ADMIN_CONSUMER_BUSINESS_ACTIVITIES_ROUTES: Routes = [
|
||||||
superAdminUserBusinessActivitiesNamedRoutes.businessActivities,
|
superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities,
|
||||||
{
|
{
|
||||||
path: superAdminUserBusinessActivitiesNamedRoutes.businessActivity.path,
|
path: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.path,
|
||||||
loadComponent: () =>
|
loadComponent: () =>
|
||||||
import('../../components/businessActivities/layout.component').then(
|
import('../../components/businessActivities/layout.component').then(
|
||||||
(m) => m.SuperAdminUserBusinessActivityLayoutComponent,
|
(m) => m.SuperAdminUserBusinessActivityLayoutComponent,
|
||||||
@@ -44,9 +45,10 @@ export const SUPER_ADMIN_USER_BUSINESS_ACTIVITIES_ROUTES: Routes = [
|
|||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
loadComponent: superAdminUserBusinessActivitiesNamedRoutes.businessActivity.loadComponent,
|
loadComponent:
|
||||||
|
superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.loadComponent,
|
||||||
},
|
},
|
||||||
...SUPER_ADMIN_USER_COMPLEXES_ROUTES,
|
...SUPER_ADMIN_CONSUMER_COMPLEXES_ROUTES,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import { NamedRoutes } from '@/core';
|
||||||
|
import { Routes } from '@angular/router';
|
||||||
|
import { SUPER_ADMIN_CONSUMER_POSES_ROUTES } from './poses';
|
||||||
|
|
||||||
|
export type TComplexesRouteNames = 'complexes' | 'complex';
|
||||||
|
|
||||||
|
const baseUrl = (consumerId: string, businessId: string) =>
|
||||||
|
`/super_admin/consumers/${consumerId}/business_activities/${businessId}/complexes`;
|
||||||
|
|
||||||
|
export const superAdminConsumerComplexesNamedRoutes: NamedRoutes<TComplexesRouteNames> = {
|
||||||
|
complexes: {
|
||||||
|
path: 'complexes',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('../../views/complexes/list.component').then(
|
||||||
|
(m) => m.SuperAdminUserComplexesComponent,
|
||||||
|
),
|
||||||
|
meta: {
|
||||||
|
title: 'فروشگاهها',
|
||||||
|
pagePath: (consumerId: string, businessId: string) => baseUrl(consumerId, businessId),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
complex: {
|
||||||
|
path: 'complexes/:complexId',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('../../views/complexes/single.component').then(
|
||||||
|
(m) => m.SuperAdminUserComplexComponent,
|
||||||
|
),
|
||||||
|
meta: {
|
||||||
|
title: 'فروشگاه',
|
||||||
|
pagePath: (consumerId: string, businessId: string, complexId: string) =>
|
||||||
|
`${baseUrl(consumerId, businessId)}/${complexId}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SUPER_ADMIN_CONSUMER_COMPLEXES_ROUTES: Routes = [
|
||||||
|
superAdminConsumerComplexesNamedRoutes.complexes,
|
||||||
|
{
|
||||||
|
path: superAdminConsumerComplexesNamedRoutes.complex.path,
|
||||||
|
loadComponent: () =>
|
||||||
|
import('../../components/complexes/layout.component').then(
|
||||||
|
(m) => m.SuperAdminConsumerComplexLayoutComponent,
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
loadComponent: superAdminConsumerComplexesNamedRoutes.complex.loadComponent,
|
||||||
|
},
|
||||||
|
...SUPER_ADMIN_CONSUMER_POSES_ROUTES,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import { NamedRoutes } from '@/core';
|
||||||
|
import { Routes } from '@angular/router';
|
||||||
|
import { SUPER_ADMIN_CONSUMER_ACCOUNTS_ROUTES } from './accounts';
|
||||||
|
import { SUPER_ADMIN_CONSUMER_BUSINESS_ACTIVITIES_ROUTES } from './businessActivities';
|
||||||
|
|
||||||
|
export type TConsumersRouteNames = 'consumers' | 'consumer';
|
||||||
|
|
||||||
|
export const superAdminConsumersNamedRoutes: NamedRoutes<TConsumersRouteNames> = {
|
||||||
|
consumers: {
|
||||||
|
path: 'consumers',
|
||||||
|
loadComponent: () => import('../../views/list.component').then((m) => m.ConsumersComponent),
|
||||||
|
meta: {
|
||||||
|
title: 'مشتریان',
|
||||||
|
pagePath: () => '/super_admin/consumers',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
consumer: {
|
||||||
|
path: 'consumers/:consumerId',
|
||||||
|
loadComponent: () => import('../../views/single.component').then((m) => m.ConsumerComponent),
|
||||||
|
meta: {
|
||||||
|
title: 'مشتری',
|
||||||
|
pagePath: (guildId: string) => `/super_admin/consumers/${guildId}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const CONSUMERS_ROUTES: Routes = [
|
||||||
|
superAdminConsumersNamedRoutes.consumers,
|
||||||
|
{
|
||||||
|
path: 'consumers/:consumerId',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('../../components/layout.component').then((m) => m.ConsumerLayoutComponent),
|
||||||
|
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('../../views/single.component').then((m) => m.ConsumerComponent),
|
||||||
|
},
|
||||||
|
...SUPER_ADMIN_CONSUMER_ACCOUNTS_ROUTES,
|
||||||
|
...SUPER_ADMIN_CONSUMER_BUSINESS_ACTIVITIES_ROUTES,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import { NamedRoutes } from '@/core';
|
||||||
|
import { Routes } from '@angular/router';
|
||||||
|
|
||||||
|
export type TPosesRouteNames = 'poses' | 'pos';
|
||||||
|
|
||||||
|
const baseUrl = (consumerId: string, businessId: string, complexId: string) =>
|
||||||
|
`/super_admin/consumers/${consumerId}/business_activities/${businessId}/complexes/${complexId}/poses`;
|
||||||
|
|
||||||
|
export const superAdminConsumerPosesNamedRoutes: NamedRoutes<TPosesRouteNames> = {
|
||||||
|
poses: {
|
||||||
|
path: 'poses',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('../../views/poses/list.component').then((m) => m.SuperAdminUserPosesComponent),
|
||||||
|
// @ts-ignore
|
||||||
|
meta: {
|
||||||
|
title: 'پایانههای فروش',
|
||||||
|
pagePath: (consumerId: string, businessId: string, complexId: string) =>
|
||||||
|
baseUrl(consumerId, businessId, complexId),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
pos: {
|
||||||
|
path: 'poses/:posId',
|
||||||
|
loadComponent: () =>
|
||||||
|
import('../../views/poses/single.component').then((m) => m.SuperAdminUserPosComponent),
|
||||||
|
// @ts-ignore
|
||||||
|
meta: {
|
||||||
|
title: 'پایانهی فروش',
|
||||||
|
pagePath: (consumerId: string, businessId: string, complexId: string, posId: string) =>
|
||||||
|
`${baseUrl(consumerId, businessId, complexId)}/${posId}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export const SUPER_ADMIN_CONSUMER_POSES_ROUTES: Routes = [
|
||||||
|
superAdminConsumerPosesNamedRoutes.poses,
|
||||||
|
{
|
||||||
|
path: superAdminConsumerPosesNamedRoutes.pos.path,
|
||||||
|
loadComponent: () =>
|
||||||
|
import('../../components/poses/layout.component').then(
|
||||||
|
(m) => m.SuperAdminConsumerPosLayoutComponent,
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: '',
|
||||||
|
loadComponent: superAdminConsumerPosesNamedRoutes.pos.loadComponent,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
import { TAccountType } from '@/core/constants/accountTypes.const';
|
||||||
|
|
||||||
|
export interface IConsumerAccountRawResponse {
|
||||||
|
username: string;
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
export interface IConsumerAccountResponse extends IConsumerAccountRawResponse {}
|
||||||
|
|
||||||
|
export interface IConsumerAccountRequest {
|
||||||
|
username: string;
|
||||||
|
password?: string;
|
||||||
|
type: TAccountType;
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
export interface IConsumerRawResponse {
|
||||||
|
id: string;
|
||||||
|
first_name: string;
|
||||||
|
last_name: string;
|
||||||
|
mobile_number: string;
|
||||||
|
status: string;
|
||||||
|
fullname: string;
|
||||||
|
}
|
||||||
|
export interface IConsumerResponse extends IConsumerRawResponse {}
|
||||||
|
|
||||||
|
export interface IConsumerRequest {
|
||||||
|
first_name: string;
|
||||||
|
last_name: string;
|
||||||
|
mobile_number: string;
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import { IPaginatedResponse } from '@/core/models/service.model';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { CONSUMER_ACCOUNTS_API_ROUTES } from '../constants';
|
||||||
|
import {
|
||||||
|
IConsumerAccountRawResponse,
|
||||||
|
IConsumerAccountRequest,
|
||||||
|
IConsumerAccountResponse,
|
||||||
|
} from '../models';
|
||||||
|
|
||||||
|
@Injectable({ providedIn: 'root' })
|
||||||
|
export class AdminConsumerAccountsService {
|
||||||
|
constructor(private http: HttpClient) {}
|
||||||
|
|
||||||
|
private apiRoutes = CONSUMER_ACCOUNTS_API_ROUTES;
|
||||||
|
|
||||||
|
getAll(consumerId: string): Observable<IPaginatedResponse<IConsumerAccountResponse>> {
|
||||||
|
return this.http.get<IPaginatedResponse<IConsumerAccountRawResponse>>(
|
||||||
|
this.apiRoutes.list(consumerId),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
getSingle(consumerId: string, accountId: string): Observable<IConsumerAccountResponse> {
|
||||||
|
return this.http.get<IConsumerAccountRawResponse>(this.apiRoutes.single(consumerId, accountId));
|
||||||
|
}
|
||||||
|
|
||||||
|
create(consumerId: string, data: IConsumerAccountRequest): Observable<IConsumerAccountResponse> {
|
||||||
|
return this.http.post<IConsumerAccountResponse>(this.apiRoutes.list(consumerId), data);
|
||||||
|
}
|
||||||
|
|
||||||
|
update(
|
||||||
|
consumerId: string,
|
||||||
|
accountId: string,
|
||||||
|
data: IConsumerAccountRequest,
|
||||||
|
): Observable<IConsumerAccountResponse> {
|
||||||
|
return this.http.patch<IConsumerAccountResponse>(
|
||||||
|
this.apiRoutes.single(consumerId, accountId),
|
||||||
|
data,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
-11
@@ -10,35 +10,36 @@ import {
|
|||||||
} from '../models';
|
} from '../models';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
export class AdminUserBusinessActivitiesService {
|
export class AdminConsumerBusinessActivitiesService {
|
||||||
constructor(private http: HttpClient) {}
|
constructor(private http: HttpClient) {}
|
||||||
|
|
||||||
private apiRoutes = BUSINESS_ACTIVITIES_API_ROUTES;
|
private apiRoutes = BUSINESS_ACTIVITIES_API_ROUTES;
|
||||||
|
|
||||||
getAll(userId: string): Observable<IPaginatedResponse<IBusinessActivityResponse>> {
|
getAll(consumerId: string): Observable<IPaginatedResponse<IBusinessActivityResponse>> {
|
||||||
return this.http.get<IPaginatedResponse<IBusinessActivityRawResponse>>(
|
return this.http.get<IPaginatedResponse<IBusinessActivityRawResponse>>(
|
||||||
this.apiRoutes.list(userId),
|
this.apiRoutes.list(consumerId),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
getSingle(userId: string, businessActivityId: string): Observable<IBusinessActivityResponse> {
|
getSingle(consumerId: string, businessActivityId: string): Observable<IBusinessActivityResponse> {
|
||||||
console.log(userId, businessActivityId);
|
|
||||||
|
|
||||||
return this.http.get<IBusinessActivityRawResponse>(
|
return this.http.get<IBusinessActivityRawResponse>(
|
||||||
this.apiRoutes.single(userId, businessActivityId),
|
this.apiRoutes.single(consumerId, businessActivityId),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
create(userId: string, data: IBusinessActivityRequest): Observable<IBusinessActivityResponse> {
|
create(
|
||||||
return this.http.post<IBusinessActivityRawResponse>(this.apiRoutes.list(userId), data);
|
consumerId: string,
|
||||||
|
data: IBusinessActivityRequest,
|
||||||
|
): Observable<IBusinessActivityResponse> {
|
||||||
|
return this.http.post<IBusinessActivityRawResponse>(this.apiRoutes.list(consumerId), data);
|
||||||
}
|
}
|
||||||
|
|
||||||
update(
|
update(
|
||||||
userId: string,
|
consumerId: string,
|
||||||
businessActivityId: string,
|
businessActivityId: string,
|
||||||
data: IBusinessActivityRequest,
|
data: IBusinessActivityRequest,
|
||||||
): Observable<IBusinessActivityResponse> {
|
): Observable<IBusinessActivityResponse> {
|
||||||
return this.http.patch<IBusinessActivityRawResponse>(
|
return this.http.patch<IBusinessActivityRawResponse>(
|
||||||
this.apiRoutes.single(userId, businessActivityId),
|
this.apiRoutes.single(consumerId, businessActivityId),
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
+8
-8
@@ -12,42 +12,42 @@ export class AdminComplexesService {
|
|||||||
private apiRoutes = BUSINESS_ACTIVITY_COMPLEXES_API_ROUTES;
|
private apiRoutes = BUSINESS_ACTIVITY_COMPLEXES_API_ROUTES;
|
||||||
|
|
||||||
getAll(
|
getAll(
|
||||||
userId: string,
|
consumerId: string,
|
||||||
businessActivityId: string,
|
businessActivityId: string,
|
||||||
): Observable<IPaginatedResponse<IComplexResponse>> {
|
): Observable<IPaginatedResponse<IComplexResponse>> {
|
||||||
return this.http.get<IPaginatedResponse<IComplexRawResponse>>(
|
return this.http.get<IPaginatedResponse<IComplexRawResponse>>(
|
||||||
this.apiRoutes.list(userId, businessActivityId),
|
this.apiRoutes.list(consumerId, businessActivityId),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
getSingle(
|
getSingle(
|
||||||
userId: string,
|
consumerId: string,
|
||||||
businessActivityId: string,
|
businessActivityId: string,
|
||||||
complexId: string,
|
complexId: string,
|
||||||
): Observable<IComplexResponse> {
|
): Observable<IComplexResponse> {
|
||||||
return this.http.get<IComplexRawResponse>(
|
return this.http.get<IComplexRawResponse>(
|
||||||
this.apiRoutes.single(userId, businessActivityId, complexId),
|
this.apiRoutes.single(consumerId, businessActivityId, complexId),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
create(
|
create(
|
||||||
userId: string,
|
consumerId: string,
|
||||||
businessActivityId: string,
|
businessActivityId: string,
|
||||||
data: IComplexRequest,
|
data: IComplexRequest,
|
||||||
): Observable<IComplexResponse> {
|
): Observable<IComplexResponse> {
|
||||||
return this.http.post<IComplexRawResponse>(
|
return this.http.post<IComplexRawResponse>(
|
||||||
this.apiRoutes.list(userId, businessActivityId),
|
this.apiRoutes.list(consumerId, businessActivityId),
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
update(
|
update(
|
||||||
userId: string,
|
consumerId: string,
|
||||||
businessActivityId: string,
|
businessActivityId: string,
|
||||||
complexId: string,
|
complexId: string,
|
||||||
data: IComplexRequest,
|
data: IComplexRequest,
|
||||||
): Observable<IComplexResponse> {
|
): Observable<IComplexResponse> {
|
||||||
return this.http.patch<IComplexRawResponse>(
|
return this.http.patch<IComplexRawResponse>(
|
||||||
this.apiRoutes.single(userId, businessActivityId, complexId),
|
this.apiRoutes.single(consumerId, businessActivityId, complexId),
|
||||||
data,
|
data,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { IPaginatedResponse } from '@/core/models/service.model';
|
||||||
|
import { HttpClient } from '@angular/common/http';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { Observable } from 'rxjs';
|
||||||
|
import { CONSUMERS_API_ROUTES } from '../constants';
|
||||||
|
import { IConsumerRawResponse, IConsumerRequest, IConsumerResponse } from '../models';
|
||||||
|
|
||||||
|
@Injectable({ providedIn: 'root' })
|
||||||
|
export class ConsumersService {
|
||||||
|
constructor(private http: HttpClient) {}
|
||||||
|
|
||||||
|
private apiRoutes = CONSUMERS_API_ROUTES;
|
||||||
|
|
||||||
|
getAll(): Observable<IPaginatedResponse<IConsumerResponse>> {
|
||||||
|
return this.http.get<IPaginatedResponse<IConsumerRawResponse>>(this.apiRoutes.list());
|
||||||
|
}
|
||||||
|
getSingle(consumerId: string): Observable<IConsumerResponse> {
|
||||||
|
return this.http.get<IConsumerRawResponse>(this.apiRoutes.single(consumerId));
|
||||||
|
}
|
||||||
|
|
||||||
|
create(userData: IConsumerRequest): Observable<IConsumerResponse> {
|
||||||
|
return this.http.post<IConsumerResponse>(this.apiRoutes.list(), userData);
|
||||||
|
}
|
||||||
|
|
||||||
|
update(consumerId: string, userData: IConsumerRequest): Observable<IConsumerResponse> {
|
||||||
|
return this.http.patch<IConsumerResponse>(this.apiRoutes.single(consumerId), userData);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
// import { IPaginatedResponse } from '@/core/models/service.model';
|
||||||
|
// import { HttpClient } from '@angular/common/http';
|
||||||
|
// import { Injectable } from '@angular/core';
|
||||||
|
// import { Observable } from 'rxjs';
|
||||||
|
// import { POS_ACCOUNTS_API_ROUTES } from '../constants';
|
||||||
|
// import { IAccountRawResponse, IAccountRequest, IAccountResponse } from '../../users/models';
|
||||||
|
|
||||||
|
// @Injectable({ providedIn: 'root' })
|
||||||
|
// export class AdminPosesService {
|
||||||
|
// constructor(private http: HttpClient) {}
|
||||||
|
|
||||||
|
// private apiRoutes = POS_ACCOUNTS_API_ROUTES;
|
||||||
|
|
||||||
|
// getAll(complexId: string, posId: string): Observable<IPaginatedResponse<IAccountResponse>> {
|
||||||
|
// return this.http.get<IPaginatedResponse<IAccountRawResponse>>(
|
||||||
|
// this.apiRoutes.list(complexId, posId),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// getSingle(complexId: string, posId: string, accountId: string): Observable<IAccountResponse> {
|
||||||
|
// return this.http.get<IAccountRawResponse>(this.apiRoutes.single(complexId, posId, accountId));
|
||||||
|
// }
|
||||||
|
|
||||||
|
// create(complexId: string, posId: string, data: IAccountRequest): Observable<IAccountResponse> {
|
||||||
|
// return this.http.post<IAccountRawResponse>(this.apiRoutes.list(complexId, posId), data);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// update(
|
||||||
|
// complexId: string,
|
||||||
|
// posId: string,
|
||||||
|
// accountId: string,
|
||||||
|
// data: IAccountRequest,
|
||||||
|
// ): Observable<IAccountResponse> {
|
||||||
|
// return this.http.patch<IAccountRawResponse>(
|
||||||
|
// this.apiRoutes.single(complexId, posId, accountId),
|
||||||
|
// data,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
+1
-1
@@ -2,7 +2,7 @@ import { IPaginatedResponse } from '@/core/models/service.model';
|
|||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
import { COMPLEX_POSES_API_ROUTES } from '../constants';
|
import { COMPLEX_POSES_API_ROUTES } from '../constants/apiRoutes/complexPoses';
|
||||||
import { IPosRawResponse, IPosRequest, IPosResponse } from '../models';
|
import { IPosRawResponse, IPosRequest, IPosResponse } from '../models';
|
||||||
|
|
||||||
@Injectable({ providedIn: 'root' })
|
@Injectable({ providedIn: 'root' })
|
||||||
+4
-4
@@ -2,7 +2,7 @@ import { EntityState, EntityStore } from '@/core/state';
|
|||||||
import { inject, Injectable } from '@angular/core';
|
import { inject, Injectable } from '@angular/core';
|
||||||
import { catchError, finalize, throwError } from 'rxjs';
|
import { catchError, finalize, throwError } from 'rxjs';
|
||||||
import { IBusinessActivityResponse } from '../models';
|
import { IBusinessActivityResponse } from '../models';
|
||||||
import { AdminUserBusinessActivitiesService } from '../services/businessActivities.service';
|
import { AdminConsumerBusinessActivitiesService } from '../services/businessActivities.service';
|
||||||
|
|
||||||
interface BusinessActivityState extends EntityState<IBusinessActivityResponse> {}
|
interface BusinessActivityState extends EntityState<IBusinessActivityResponse> {}
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@ export class BusinessActivityStore extends EntityStore<
|
|||||||
IBusinessActivityResponse,
|
IBusinessActivityResponse,
|
||||||
BusinessActivityState
|
BusinessActivityState
|
||||||
> {
|
> {
|
||||||
private readonly service = inject(AdminUserBusinessActivitiesService);
|
private readonly service = inject(AdminConsumerBusinessActivitiesService);
|
||||||
constructor() {
|
constructor() {
|
||||||
super({
|
super({
|
||||||
loading: false,
|
loading: false,
|
||||||
@@ -24,10 +24,10 @@ export class BusinessActivityStore extends EntityStore<
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getData(userId: string, business_id: string) {
|
getData(consumerId: string, business_id: string) {
|
||||||
this.patchState({ loading: true });
|
this.patchState({ loading: true });
|
||||||
this.service
|
this.service
|
||||||
.getSingle(userId, business_id)
|
.getSingle(consumerId, business_id)
|
||||||
.pipe(
|
.pipe(
|
||||||
finalize(() => {
|
finalize(() => {
|
||||||
this.patchState({ loading: false });
|
this.patchState({ loading: false });
|
||||||
+2
-2
@@ -21,10 +21,10 @@ export class ComplexStore extends EntityStore<IComplexResponse, ComplexState> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getData(userId: string, businessId: string, complexId: string) {
|
getData(consumerId: string, businessId: string, complexId: string) {
|
||||||
this.patchState({ loading: true });
|
this.patchState({ loading: true });
|
||||||
this.service
|
this.service
|
||||||
.getSingle(userId, businessId, complexId)
|
.getSingle(consumerId, businessId, complexId)
|
||||||
.pipe(
|
.pipe(
|
||||||
finalize(() => {
|
finalize(() => {
|
||||||
this.patchState({ loading: false });
|
this.patchState({ loading: false });
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
import { EntityState, EntityStore } from '@/core/state';
|
||||||
|
import { inject, Injectable } from '@angular/core';
|
||||||
|
import { catchError, finalize, throwError } from 'rxjs';
|
||||||
|
import { IConsumerResponse } from '../models';
|
||||||
|
import { ConsumersService } from '../services/main.service';
|
||||||
|
|
||||||
|
interface ConsumerState extends EntityState<IConsumerResponse> {}
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root',
|
||||||
|
})
|
||||||
|
export class ConsumerStore extends EntityStore<IConsumerResponse, ConsumerState> {
|
||||||
|
private readonly service = inject(ConsumersService);
|
||||||
|
constructor() {
|
||||||
|
super({
|
||||||
|
loading: false,
|
||||||
|
error: null,
|
||||||
|
entity: null,
|
||||||
|
initialized: false,
|
||||||
|
isRefreshing: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getData(partnerId: string) {
|
||||||
|
this.patchState({ loading: true });
|
||||||
|
this.service
|
||||||
|
.getSingle(partnerId)
|
||||||
|
.pipe(
|
||||||
|
finalize(() => {
|
||||||
|
this.patchState({ loading: false });
|
||||||
|
}),
|
||||||
|
catchError(() => {
|
||||||
|
this.patchState({
|
||||||
|
error: '',
|
||||||
|
});
|
||||||
|
return throwError('');
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
.subscribe((entity) => {
|
||||||
|
this.patchState({ entity });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<superAdmin-consumer-account-list [consumerId]="consumerId()" />
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
||||||
|
import { BreadcrumbService } from '@/core/services';
|
||||||
|
import { Component, inject, signal } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ConsumerAccountListComponent } from '../../components/accounts/list.component';
|
||||||
|
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||||
|
import { superAdminConsumerAccountsNamedRoutes } from '../../constants/routes/accounts';
|
||||||
|
import { ConsumerStore } from '../../store/consumer.store';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-consumer-accounts',
|
||||||
|
templateUrl: './list.component.html',
|
||||||
|
imports: [ConsumerAccountListComponent],
|
||||||
|
})
|
||||||
|
export class ConsumerAccountsComponent {
|
||||||
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
private readonly breadcrumbService = inject(BreadcrumbService);
|
||||||
|
private readonly store = inject(ConsumerStore);
|
||||||
|
|
||||||
|
consumerId = signal<string>(this.route.snapshot.params['consumerId']);
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.setBreadcrumb();
|
||||||
|
}
|
||||||
|
|
||||||
|
setBreadcrumb() {
|
||||||
|
this.breadcrumbService.setItems([
|
||||||
|
{
|
||||||
|
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||||
|
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.store.entity()?.fullname,
|
||||||
|
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: superAdminConsumerAccountsNamedRoutes.accounts.meta.title,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
<superAdmin-consumer-businessActivities-list [consumerId]="consumerId()" />
|
||||||
+43
@@ -0,0 +1,43 @@
|
|||||||
|
// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
||||||
|
import { BreadcrumbService } from '@/core/services';
|
||||||
|
import pageParamsUtils from '@/utils/page-params.utils';
|
||||||
|
import { Component, computed, inject, signal } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ConsumerBusinessActivitiesComponent } from '../../components/businessActivities/list.component';
|
||||||
|
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||||
|
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||||
|
import { ConsumerStore } from '../../store/consumer.store';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-user-businessActivities',
|
||||||
|
templateUrl: './list.component.html',
|
||||||
|
imports: [ConsumerBusinessActivitiesComponent],
|
||||||
|
})
|
||||||
|
export class SuperAdminUserBusinessActivitiesComponent {
|
||||||
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
private readonly breadcrumbService = inject(BreadcrumbService);
|
||||||
|
private readonly consumerStore = inject(ConsumerStore);
|
||||||
|
|
||||||
|
pageParams = computed(() => pageParamsUtils(this.route));
|
||||||
|
consumerId = signal<string>(this.pageParams()['consumerId']);
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
this.setBreadcrumb();
|
||||||
|
}
|
||||||
|
|
||||||
|
setBreadcrumb() {
|
||||||
|
this.breadcrumbService.setItems([
|
||||||
|
{
|
||||||
|
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||||
|
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.consumerStore.entity()?.fullname,
|
||||||
|
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta.title,
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-3
@@ -8,12 +8,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</app-card-data>
|
</app-card-data>
|
||||||
|
|
||||||
<superAdmin-user-complexes-list [userId]="userId()" [businessId]="businessId()" />
|
<superAdmin-consumer-complexes-list [consumerId]="consumerId()" [businessId]="businessId()" />
|
||||||
|
|
||||||
<superAdmin-user-businessActivities-form
|
<superAdmin-consumer-businessActivities-form
|
||||||
[(visible)]="editMode"
|
[(visible)]="editMode"
|
||||||
[editMode]="true"
|
[editMode]="true"
|
||||||
[userId]="userId()"
|
[consumerId]="consumerId()"
|
||||||
[businessActivityId]="businessId()"
|
[businessActivityId]="businessId()"
|
||||||
[initialValues]="businessActivity() || undefined"
|
[initialValues]="businessActivity() || undefined"
|
||||||
(onSubmit)="getData()"
|
(onSubmit)="getData()"
|
||||||
+20
-21
@@ -3,12 +3,13 @@ import { AppCardComponent, KeyValueComponent } from '@/shared/components';
|
|||||||
import pageParamsUtils from '@/utils/page-params.utils';
|
import pageParamsUtils from '@/utils/page-params.utils';
|
||||||
import { Component, computed, effect, inject, signal } from '@angular/core';
|
import { Component, computed, effect, inject, signal } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
import { UserBusinessActivitiesFormComponent } from '../../components/businessActivities/form.component';
|
|
||||||
import { UserComplexesComponent } from '../../components/complexes/list.component';
|
import { ConsumerBusinessActivitiesFormComponent } from '../../components/businessActivities/form.component';
|
||||||
import { usersNamedRoutes } from '../../constants';
|
import { ConsumerComplexesComponent } from '../../components/complexes/list.component';
|
||||||
import { superAdminUserBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||||
|
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||||
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||||
import { UserStore } from '../../store/user.store';
|
import { ConsumerStore } from '../../store/consumer.store';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'superAdmin-user-businessActivity',
|
selector: 'superAdmin-user-businessActivity',
|
||||||
@@ -16,19 +17,19 @@ import { UserStore } from '../../store/user.store';
|
|||||||
imports: [
|
imports: [
|
||||||
AppCardComponent,
|
AppCardComponent,
|
||||||
KeyValueComponent,
|
KeyValueComponent,
|
||||||
UserBusinessActivitiesFormComponent,
|
ConsumerBusinessActivitiesFormComponent,
|
||||||
UserComplexesComponent,
|
ConsumerComplexesComponent,
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class SuperAdminUserBusinessActivityComponent {
|
export class SuperAdminUserBusinessActivityComponent {
|
||||||
private readonly route = inject(ActivatedRoute);
|
private readonly route = inject(ActivatedRoute);
|
||||||
private readonly breadcrumbService = inject(BreadcrumbService);
|
private readonly breadcrumbService = inject(BreadcrumbService);
|
||||||
private readonly store = inject(BusinessActivityStore);
|
private readonly store = inject(BusinessActivityStore);
|
||||||
private readonly userStore = inject(UserStore);
|
private readonly consumerStore = inject(ConsumerStore);
|
||||||
|
|
||||||
pageParams = computed(() => pageParamsUtils(this.route));
|
pageParams = computed(() => pageParamsUtils(this.route));
|
||||||
|
|
||||||
readonly userId = signal<string>(this.pageParams()['userId']!);
|
readonly consumerId = signal<string>(this.pageParams()['consumerId']!);
|
||||||
readonly businessId = signal<string>(this.pageParams()['businessActivityId']!);
|
readonly businessId = signal<string>(this.pageParams()['businessActivityId']!);
|
||||||
editMode = signal<boolean>(false);
|
editMode = signal<boolean>(false);
|
||||||
|
|
||||||
@@ -38,36 +39,34 @@ export class SuperAdminUserBusinessActivityComponent {
|
|||||||
constructor() {
|
constructor() {
|
||||||
effect(() => {
|
effect(() => {
|
||||||
if (this.businessActivity()?.id) {
|
if (this.businessActivity()?.id) {
|
||||||
console.log(this.businessActivity()?.id);
|
|
||||||
this.setBreadcrumb();
|
this.setBreadcrumb();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getData() {
|
getData() {
|
||||||
this.store.getData(this.userId(), this.businessId());
|
this.store.getData(this.consumerId(), this.businessId());
|
||||||
}
|
}
|
||||||
|
|
||||||
setBreadcrumb() {
|
setBreadcrumb() {
|
||||||
this.breadcrumbService.setItems([
|
this.breadcrumbService.setItems([
|
||||||
{
|
{
|
||||||
...usersNamedRoutes.users.meta,
|
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||||
routerLink: usersNamedRoutes.users.meta.pagePath!(),
|
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.userStore.entity()?.fullname,
|
title: this.consumerStore.entity()?.fullname,
|
||||||
routerLink: usersNamedRoutes.user.meta.pagePath!(this.userId()),
|
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(this.consumerId()),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
...superAdminUserBusinessActivitiesNamedRoutes.businessActivities.meta,
|
...superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta,
|
||||||
routerLink: superAdminUserBusinessActivitiesNamedRoutes.businessActivities.meta.pagePath!(
|
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta
|
||||||
this.userId(),
|
.pagePath!(this.consumerId()),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: this.businessActivity()?.name,
|
title: this.businessActivity()?.name,
|
||||||
routerLink: superAdminUserBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
||||||
this.userId(),
|
this.consumerId(),
|
||||||
this.businessId(),
|
this.businessId(),
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<superAdmin-consumer-complexes-list [consumerId]="consumerId()" [businessId]="businessId()" />
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
||||||
|
import { BreadcrumbService } from '@/core/services';
|
||||||
|
import pageParamsUtils from '@/utils/page-params.utils';
|
||||||
|
import { Component, computed, inject, signal } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ConsumerComplexesComponent } from '../../components/complexes/list.component';
|
||||||
|
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||||
|
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||||
|
import { superAdminConsumerComplexesNamedRoutes } from '../../constants/routes/complexes';
|
||||||
|
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||||
|
import { ConsumerStore } from '../../store/consumer.store';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-user-complexes',
|
||||||
|
templateUrl: './list.component.html',
|
||||||
|
imports: [ConsumerComplexesComponent],
|
||||||
|
})
|
||||||
|
export class SuperAdminUserComplexesComponent {
|
||||||
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
private readonly breadcrumbService = inject(BreadcrumbService);
|
||||||
|
private readonly consumerStore = inject(ConsumerStore);
|
||||||
|
private readonly businessStore = inject(BusinessActivityStore);
|
||||||
|
|
||||||
|
pageParams = computed(() => pageParamsUtils(this.route));
|
||||||
|
consumerId = signal<string>(this.pageParams()['consumerId']);
|
||||||
|
businessId = signal<string>(this.pageParams()['businessActivityId']);
|
||||||
|
|
||||||
|
ngAfterViewInit() {
|
||||||
|
this.setBreadcrumb();
|
||||||
|
}
|
||||||
|
|
||||||
|
setBreadcrumb() {
|
||||||
|
this.breadcrumbService.setItems([
|
||||||
|
{
|
||||||
|
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||||
|
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.consumerStore.entity()?.fullname,
|
||||||
|
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta.title,
|
||||||
|
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta
|
||||||
|
.pagePath!(this.consumerId()),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.businessStore.entity()?.name,
|
||||||
|
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
||||||
|
this.consumerId(),
|
||||||
|
this.businessId(),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: superAdminConsumerComplexesNamedRoutes.complexes.meta.title,
|
||||||
|
routerLink: superAdminConsumerComplexesNamedRoutes.complexes.meta.pagePath!(
|
||||||
|
this.consumerId(),
|
||||||
|
this.businessId(),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
+3
-3
@@ -9,12 +9,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</app-card-data>
|
</app-card-data>
|
||||||
|
|
||||||
<superAdmin-user-poses-list [userId]="userId()" [businessId]="businessId()" [complexId]="complexId()" />
|
<superAdmin-consumer-poses-list [consumerId]="consumerId()" [businessId]="businessId()" [complexId]="complexId()" />
|
||||||
|
|
||||||
<superAdmin-user-complex-form
|
<superAdmin-consumer-complex-form
|
||||||
[(visible)]="editMode"
|
[(visible)]="editMode"
|
||||||
[editMode]="true"
|
[editMode]="true"
|
||||||
[userId]="userId()"
|
[consumerId]="consumerId()"
|
||||||
[businessActivityId]="businessId()"
|
[businessActivityId]="businessId()"
|
||||||
[complexId]="complexId()"
|
[complexId]="complexId()"
|
||||||
[initialValues]="complex() || undefined"
|
[initialValues]="complex() || undefined"
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
import { BreadcrumbService } from '@/core/services';
|
||||||
|
import { AppCardComponent, KeyValueComponent } from '@/shared/components';
|
||||||
|
import pageParamsUtils from '@/utils/page-params.utils';
|
||||||
|
import { Component, computed, effect, inject, signal } from '@angular/core';
|
||||||
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { ConsumerComplexFormComponent } from '../../components/complexes/form.component';
|
||||||
|
import { ConsumerPosesComponent } from '../../components/poses/list.component';
|
||||||
|
import { superAdminConsumersNamedRoutes } from '../../constants';
|
||||||
|
import { superAdminConsumerBusinessActivitiesNamedRoutes } from '../../constants/routes/businessActivities';
|
||||||
|
import { superAdminConsumerComplexesNamedRoutes } from '../../constants/routes/complexes';
|
||||||
|
import { BusinessActivityStore } from '../../store/businessActivity.store';
|
||||||
|
import { ComplexStore } from '../../store/complex.store';
|
||||||
|
import { ConsumerStore } from '../../store/consumer.store';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-user-complex',
|
||||||
|
templateUrl: './single.component.html',
|
||||||
|
imports: [
|
||||||
|
AppCardComponent,
|
||||||
|
KeyValueComponent,
|
||||||
|
ConsumerComplexFormComponent,
|
||||||
|
ConsumerPosesComponent,
|
||||||
|
],
|
||||||
|
})
|
||||||
|
export class SuperAdminUserComplexComponent {
|
||||||
|
private readonly route = inject(ActivatedRoute);
|
||||||
|
private readonly breadcrumbService = inject(BreadcrumbService);
|
||||||
|
private readonly store = inject(ComplexStore);
|
||||||
|
private readonly consumerStore = inject(ConsumerStore);
|
||||||
|
private readonly businessStore = inject(BusinessActivityStore);
|
||||||
|
|
||||||
|
pageParams = computed(() => pageParamsUtils(this.route));
|
||||||
|
|
||||||
|
readonly consumerId = signal<string>(this.pageParams()['consumerId']!);
|
||||||
|
readonly businessId = signal<string>(this.pageParams()['businessActivityId']!);
|
||||||
|
readonly complexId = signal<string>(this.pageParams()['complexId']!);
|
||||||
|
|
||||||
|
editMode = signal<boolean>(false);
|
||||||
|
|
||||||
|
readonly loading = computed(() => this.store.loading());
|
||||||
|
readonly complex = computed(() => this.store.entity());
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
effect(() => {
|
||||||
|
if (this.complex()?.id) {
|
||||||
|
this.setBreadcrumb();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getData() {
|
||||||
|
this.store.getData(this.consumerId(), this.businessId(), this.complexId());
|
||||||
|
}
|
||||||
|
|
||||||
|
setBreadcrumb() {
|
||||||
|
this.breadcrumbService.setItems([
|
||||||
|
{
|
||||||
|
...superAdminConsumersNamedRoutes.consumers.meta,
|
||||||
|
routerLink: superAdminConsumersNamedRoutes.consumers.meta.pagePath!(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.consumerStore.entity()?.fullname,
|
||||||
|
routerLink: superAdminConsumersNamedRoutes.consumer.meta.pagePath!(this.consumerId()),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
...superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta,
|
||||||
|
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivities.meta
|
||||||
|
.pagePath!(this.consumerId()),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.businessStore.entity()?.name,
|
||||||
|
routerLink: superAdminConsumerBusinessActivitiesNamedRoutes.businessActivity.meta.pagePath!(
|
||||||
|
this.consumerId(),
|
||||||
|
this.businessId(),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
...superAdminConsumerComplexesNamedRoutes.complexes.meta,
|
||||||
|
routerLink: superAdminConsumerComplexesNamedRoutes.complexes.meta.pagePath!(
|
||||||
|
this.consumerId(),
|
||||||
|
this.businessId(),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: this.complex()?.name,
|
||||||
|
routerLink: superAdminConsumerComplexesNamedRoutes.complex.meta.pagePath!(
|
||||||
|
this.consumerId(),
|
||||||
|
this.businessId(),
|
||||||
|
this.complexId(),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
<app-page-data-list
|
||||||
|
pageTitle="مدیریت مشتریان"
|
||||||
|
[addNewCtaLabel]="'افزودن مشتری جدید'"
|
||||||
|
[columns]="columns"
|
||||||
|
[showAdd]="true"
|
||||||
|
emptyPlaceholderTitle="مشتریای یافت نشد"
|
||||||
|
emptyPlaceholderDescription="برای افزودن مشتری جدید، روی دکمهٔ بالا کلیک کنید."
|
||||||
|
[items]="items()"
|
||||||
|
[loading]="loading()"
|
||||||
|
[showDetails]="true"
|
||||||
|
[showAdd]="true"
|
||||||
|
[showEdit]="true"
|
||||||
|
(onAdd)="openAddForm()"
|
||||||
|
(onDetails)="toSinglePage($event)"
|
||||||
|
(onEdit)="onEditClick($event)"
|
||||||
|
/>
|
||||||
|
<superAdmin-consumer-form
|
||||||
|
[(visible)]="visibleForm"
|
||||||
|
[editMode]="editMode()"
|
||||||
|
[consumerId]="selectedItemForEdit()?.id"
|
||||||
|
[initialValues]="selectedItemForEdit() || undefined"
|
||||||
|
(onSubmit)="refresh()"
|
||||||
|
/>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
||||||
|
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
|
||||||
|
import { PageDataListComponent } from '@/shared/components/pageDataList/page-data-list.component';
|
||||||
|
import { Component, inject } from '@angular/core';
|
||||||
|
import { Router } from '@angular/router';
|
||||||
|
import { ConsumerUserFormComponent } from '../components/form.component';
|
||||||
|
import { superAdminConsumersNamedRoutes } from '../constants';
|
||||||
|
import { IConsumerResponse } from '../models';
|
||||||
|
import { ConsumersService } from '../services/main.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'superAdmin-consumers',
|
||||||
|
templateUrl: './list.component.html',
|
||||||
|
imports: [PageDataListComponent, ConsumerUserFormComponent],
|
||||||
|
})
|
||||||
|
export class ConsumersComponent extends AbstractList<IConsumerResponse> {
|
||||||
|
private readonly service = inject(ConsumersService);
|
||||||
|
private readonly router = inject(Router);
|
||||||
|
|
||||||
|
override setColumns(): void {
|
||||||
|
this.columns = [
|
||||||
|
{ field: 'id', header: 'شناسه' },
|
||||||
|
{ field: 'fullname', header: 'نام' },
|
||||||
|
{ field: 'mobile_number', header: 'شماره موبایل' },
|
||||||
|
{ field: 'status', header: 'وضعیت' },
|
||||||
|
{
|
||||||
|
field: 'created_at',
|
||||||
|
header: 'تاریخ ایجاد',
|
||||||
|
type: 'date',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
override getDataRequest() {
|
||||||
|
return this.service.getAll();
|
||||||
|
}
|
||||||
|
|
||||||
|
toSinglePage(consumer: IConsumerResponse) {
|
||||||
|
this.router.navigateByUrl(superAdminConsumersNamedRoutes.consumer.meta.pagePath!(consumer.id));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<superAdmin-consumer-poses-list [consumerId]="consumerId()" [businessId]="businessId()" [complexId]="complexId()" />
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user