Files
psp_panel/src/app/domains/consumer/constants/components/pos/pos.ts
T
ahasani b2a1eb8e5b feat: implement stock keeping unit management form and list components
- Added StockKeepingUnitFormComponent for creating and editing stock keeping units.
- Introduced StockKeepingUnitsComponent for listing stock keeping units with pagination.
- Integrated form fields for code, name, VAT, and SKU type in the stock keeping unit form.
- Created API routes for stock keeping units with CRUD operations.
- Updated input components to handle numeric and price types with Persian/Arabic digit normalization.
- Enhanced key-value component to support tag display instead of badge.
- Adjusted layout styles for sidebar menu.
- Added AGENT.md for repository-specific coding guidelines and practices.
- Implemented good management form with file upload and category selection.
2026-05-06 22:01:20 +03:30

32 lines
1.1 KiB
TypeScript

import { IColumn } from '@/shared/components/pageDataList/page-data-list.component';
import { FormBuilder, Validators } from '@angular/forms';
import { IPosInitialValues } from './pos.model';
export const columns: IColumn[] = [
// // { field: 'id', header: 'شناسه', type: 'id' },
{ field: 'name', header: 'عنوان' },
{ field: 'serial_number', header: 'شماره سریال' },
{ field: 'pos_type', header: 'نوع دستگاه' },
{ field: 'device', header: 'دستگاه', type: 'nested', nestedOption: { path: 'device.name' } },
{
field: 'provider',
header: 'ارایه‌دهنده',
type: 'nested',
nestedOption: { path: 'provider.name' },
},
{ field: 'account', header: 'کاربر', type: 'nested', nestedOption: { path: 'account.username' } },
{
field: 'created_at',
header: 'تاریخ ایجاد',
type: 'date',
},
];
export const initForm = (fb: FormBuilder, initialValues?: IPosInitialValues) => {
const form = fb.group({
name: [initialValues?.name || '', [Validators.required]],
});
return form;
};