feat: add stock keeping units list component and related services
feat: implement checkbox component with label and hint support feat: create sale invoice full response model for invoice details feat: add single view component for displaying sale invoice details feat: define various list configurations for account, business activity, and consumer management feat: establish list configurations for managing devices, goods, and licenses feat: create list configurations for managing partners and their accounts feat: implement user management list configuration
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
IChangePasswordSubmitPayload,
|
||||
} from '@/shared/components';
|
||||
import { PageDataListComponent } from '@/shared/components/pageDataList/page-data-list.component';
|
||||
import { accountListConfig } from '@/shared/constants/list-configs';
|
||||
import { Component, inject, signal } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { finalize } from 'rxjs';
|
||||
@@ -23,27 +24,7 @@ export class ConsumerAccountsComponent extends AbstractList<IAccountResponse> {
|
||||
passwordSubmitLoading = signal(false);
|
||||
|
||||
override setColumns(): void {
|
||||
this.columns = [
|
||||
// { field: 'id', header: 'شناسه', type: 'id' },
|
||||
{
|
||||
field: 'username',
|
||||
header: 'نام کاربری',
|
||||
type: 'nested',
|
||||
nestedOption: { path: 'account.username' },
|
||||
},
|
||||
{
|
||||
field: 'pos',
|
||||
header: 'پایانه',
|
||||
customDataModel(item) {
|
||||
return `${item.pos.name} - ${item.pos.complex.name} - ${item.pos.complex.business_activity.name}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'created_at',
|
||||
header: 'تاریخ ایجاد',
|
||||
type: 'date',
|
||||
},
|
||||
];
|
||||
this.columns = accountListConfig.columns;
|
||||
}
|
||||
|
||||
override getDataRequest() {
|
||||
|
||||
+2
-10
@@ -4,6 +4,7 @@ import {
|
||||
IColumn,
|
||||
PageDataListComponent,
|
||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||
import { complexListConfig } from '@/shared/constants/list-configs';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { consumerComplexesNamedRoutes } from '../../constants/routes/complexes';
|
||||
@@ -19,16 +20,7 @@ import { ConsumerComplexFormComponent } from './form.component';
|
||||
export class ConsumerComplexListComponent extends AbstractList<IComplexResponse> {
|
||||
@Input({ required: true }) businessId!: string;
|
||||
@Input() fullHeight?: boolean;
|
||||
@Input() header: IColumn[] = [
|
||||
// { field: 'id', header: 'شناسه', type: 'id' },
|
||||
{ field: 'name', header: 'عنوان' },
|
||||
{ field: 'branch_code', header: 'کد شعبه' },
|
||||
{
|
||||
field: 'created_at',
|
||||
header: 'تاریخ ایجاد',
|
||||
type: 'date',
|
||||
},
|
||||
];
|
||||
@Input() header: IColumn[] = complexListConfig.columns;
|
||||
|
||||
private readonly service = inject(ConsumerComplexesService);
|
||||
private readonly router = inject(Router);
|
||||
|
||||
+4
-16
@@ -4,6 +4,7 @@ import {
|
||||
IColumn,
|
||||
PageDataListComponent,
|
||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||
import { goodListConfig } from '@/shared/constants/list-configs';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { IConsumerBusinessActivityGoodResponse } from '../../models/goods_io';
|
||||
import { BusinessActivityGoodsService } from '../../services/goods.service';
|
||||
@@ -18,22 +19,9 @@ export class ConsumerBusinessActivityGoodsListComponent extends AbstractList<ICo
|
||||
@Input({ required: true }) businessId!: string;
|
||||
@Input({ required: true }) guildId!: string;
|
||||
@Input() fullHeight?: boolean;
|
||||
@Input() header: IColumn[] = [
|
||||
// { field: 'id', header: 'شناسه', type: 'id' },
|
||||
{ field: 'name', header: 'عنوان' },
|
||||
{ field: 'sku', header: 'شناسه عمومی' },
|
||||
{
|
||||
field: 'category',
|
||||
header: 'دستهبندی',
|
||||
type: 'nested',
|
||||
nestedOption: { path: 'category.name' },
|
||||
},
|
||||
{
|
||||
field: 'created_at',
|
||||
header: 'تاریخ ایجاد',
|
||||
type: 'date',
|
||||
},
|
||||
];
|
||||
@Input() header: IColumn[] = goodListConfig.columns;
|
||||
|
||||
listConfig = goodListConfig;
|
||||
service = inject(BusinessActivityGoodsService);
|
||||
|
||||
override setColumns(): void {
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
IColumn,
|
||||
PageDataListComponent,
|
||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||
import { businessActivityListConfig } from '@/shared/constants/list-configs';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { consumerBusinessActivityNamedRoutes } from '../constants';
|
||||
@@ -18,33 +19,7 @@ import { ConsumerBusinessActivityFormComponent } from './form.component';
|
||||
})
|
||||
export class ConsumerBusinessActivityListComponent extends AbstractList<IBusinessActivityResponse> {
|
||||
@Input() fullHeight?: boolean;
|
||||
@Input() header: IColumn[] = [
|
||||
{ field: 'name', header: 'عنوان' },
|
||||
{ field: 'guild', header: 'صنف', type: 'nested', nestedOption: { path: 'guild.name' } },
|
||||
{ field: 'economic_code', header: 'کد اقتصادی' },
|
||||
{
|
||||
field: 'license_info',
|
||||
header: 'محدودیت کاربر',
|
||||
customDataModel(item) {
|
||||
const licenseInfo = (item as IBusinessActivityResponse).license_info;
|
||||
if (!licenseInfo) {
|
||||
return 'بدون مجوز';
|
||||
}
|
||||
return `${licenseInfo.accounts_limit} کاربر`;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'license_info',
|
||||
header: 'انقضا مجوز',
|
||||
type: 'nested',
|
||||
nestedOption: { path: 'license_info.expires_at', type: 'date' },
|
||||
},
|
||||
{
|
||||
field: 'created_at',
|
||||
header: 'تاریخ ایجاد',
|
||||
type: 'date',
|
||||
},
|
||||
];
|
||||
@Input() header: IColumn[] = businessActivityListConfig.columns;
|
||||
|
||||
private readonly service = inject(BusinessActivitiesService);
|
||||
private readonly router = inject(Router);
|
||||
|
||||
@@ -4,6 +4,8 @@ import {
|
||||
IColumn,
|
||||
PageDataListComponent,
|
||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||
|
||||
import { customerListConfig } from '@/shared/constants/list-configs/customer-list.const';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { ConsumerBusinessActivityFormComponent } from '../components/form-dialog.component';
|
||||
@@ -18,42 +20,7 @@ import { CustomersService } from '../services/main.service';
|
||||
})
|
||||
export class ConsumerCustomerListComponent extends AbstractList<ICustomerResponse> {
|
||||
@Input() fullHeight?: boolean;
|
||||
@Input() header: IColumn[] = [
|
||||
// { field: 'id', header: 'شناسه', type: 'id' },
|
||||
{
|
||||
field: 'type',
|
||||
header: 'نوع مشتری',
|
||||
customDataModel(item) {
|
||||
return item.type === 'LEGAL' ? 'حقوقی' : 'حقیقی';
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
field: 'name',
|
||||
header: 'عنوان',
|
||||
customDataModel(item: ICustomerResponse) {
|
||||
if (item.type === 'LEGAL') {
|
||||
return item.legal!.company_name;
|
||||
}
|
||||
return `${item.individual!.first_name} ${item.individual!.last_name}`;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'economic_code',
|
||||
header: 'کد اقتصادی',
|
||||
customDataModel(item: ICustomerResponse) {
|
||||
if (item.type === 'LEGAL') {
|
||||
return item.legal!.economic_code;
|
||||
}
|
||||
return item.individual!.economic_code;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'created_at',
|
||||
header: 'تاریخ ایجاد',
|
||||
type: 'date',
|
||||
},
|
||||
];
|
||||
@Input() header: IColumn[] = customerListConfig.columns;
|
||||
|
||||
private readonly service = inject(CustomersService);
|
||||
private readonly router = inject(Router);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<consumer-saleInvoice-shared [loading]="loading()" [invoice]="invoice()" variant="customer" />
|
||||
<shared-sale-invoice-single-view [loading]="loading()" [invoice]="invoice()" variant="customer" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BreadcrumbService } from '@/core/services';
|
||||
import { ConsumerSaleInvoiceSharedComponent } from '@/domains/consumer/components/invoices/shared-saleInvoice.component';
|
||||
import { SharedSaleInvoiceSingleViewComponent } from '@/shared/components/invoices/sale-invoice-single-view.component';
|
||||
import pageParamsUtils from '@/utils/page-params.utils';
|
||||
import { Component, computed, effect, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
@@ -9,7 +9,7 @@ import { ConsumerCustomerSaleInvoiceStore } from '../../store/saleInvoice.store'
|
||||
@Component({
|
||||
selector: 'consumer-customer-saleInvoice',
|
||||
templateUrl: './single.component.html',
|
||||
imports: [ConsumerSaleInvoiceSharedComponent],
|
||||
imports: [SharedSaleInvoiceSingleViewComponent],
|
||||
})
|
||||
export class ConsumerCustomerSaleInvoiceComponent {
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// import { CatalogRoleTagComponent } from '@/shared/catalog/roles';
|
||||
import { CONSUMER_COMPONENTS_CONST } from '@/domains/consumer/constants';
|
||||
import { AbstractList } from '@/shared/abstractClasses/abstract-list';
|
||||
import {
|
||||
IColumn,
|
||||
PageDataListComponent,
|
||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||
import { posListConfig } from '@/shared/constants/list-configs';
|
||||
import { Component, inject, Input, TemplateRef, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { CookieService } from 'ngx-cookie-service';
|
||||
@@ -22,7 +22,7 @@ import { ConsumerPosFormComponent } from './form.component';
|
||||
})
|
||||
export class ConsumerPosListComponent extends AbstractList<IPosResponse> {
|
||||
@Input() fullHeight?: boolean;
|
||||
@Input() header: IColumn[] = CONSUMER_COMPONENTS_CONST.pos.columns;
|
||||
@Input() header: IColumn[] = posListConfig.columns;
|
||||
|
||||
private readonly service = inject(ConsumerPosesService);
|
||||
private readonly cookieService = inject(CookieService);
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
IColumn,
|
||||
PageDataListComponent,
|
||||
} from '@/shared/components/pageDataList/page-data-list.component';
|
||||
import { saleInvoiceListConfig } from '@/shared/constants/list-configs';
|
||||
import { Component, inject, Input } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { consumerSaleInvoicesNamedRoutes } from '../constants/routes';
|
||||
@@ -17,37 +18,7 @@ import { ConsumerSaleInvoicesService } from '../services/main.service';
|
||||
})
|
||||
export class ConsumerSaleInvoiceListComponent extends AbstractList<IConsumerSaleInvoicesResponse> {
|
||||
@Input() fullHeight?: boolean;
|
||||
@Input() header: IColumn[] = [
|
||||
{ field: 'code', header: 'کد رهگیری' },
|
||||
{
|
||||
field: 'total_amount',
|
||||
header: 'قیمت نهایی',
|
||||
type: 'price',
|
||||
},
|
||||
{
|
||||
field: 'pos',
|
||||
header: 'پایانه',
|
||||
customDataModel(item: IConsumerSaleInvoicesResponse) {
|
||||
return `${item.pos.name} (${item.pos.complex.name} - ${item.pos.complex.business_activity.name})`;
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'consumer_account',
|
||||
header: 'ایجاد شده توسط',
|
||||
type: 'nested',
|
||||
nestedOption: { path: 'consumer_account.account.username' },
|
||||
},
|
||||
{
|
||||
field: 'invoice_date',
|
||||
header: 'تاریخ فاکتور',
|
||||
type: 'date',
|
||||
},
|
||||
{
|
||||
field: 'created_at',
|
||||
header: 'تاریخ ایجاد',
|
||||
type: 'date',
|
||||
},
|
||||
];
|
||||
@Input() header: IColumn[] = saleInvoiceListConfig.columns;
|
||||
|
||||
private readonly service = inject(ConsumerSaleInvoicesService);
|
||||
private readonly router = inject(Router);
|
||||
|
||||
@@ -1 +1 @@
|
||||
<consumer-saleInvoice-shared [loading]="loading()" [invoice]="invoice()" />
|
||||
<shared-sale-invoice-single-view [loading]="loading()" [invoice]="invoice()" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { BreadcrumbService } from '@/core/services';
|
||||
import { ConsumerSaleInvoiceSharedComponent } from '@/domains/consumer/components/invoices/shared-saleInvoice.component';
|
||||
import { SharedSaleInvoiceSingleViewComponent } from '@/shared/components/invoices/sale-invoice-single-view.component';
|
||||
import pageParamsUtils from '@/utils/page-params.utils';
|
||||
import { Component, computed, effect, inject, signal } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
@@ -8,7 +8,7 @@ import { ConsumerSaleInvoiceStore } from '../store/main.store';
|
||||
@Component({
|
||||
selector: 'consumer-saleInvoice',
|
||||
templateUrl: './single.component.html',
|
||||
imports: [ConsumerSaleInvoiceSharedComponent],
|
||||
imports: [SharedSaleInvoiceSingleViewComponent],
|
||||
})
|
||||
export class ConsumerSaleInvoiceComponent {
|
||||
private readonly route = inject(ActivatedRoute);
|
||||
|
||||
Reference in New Issue
Block a user