Files
psp_panel/src/app/modules/purchases/models/io.d.ts
T
ahasani 50bc9a4632 feat(purchases): implement purchase receipt functionality with form and receipt template
- Added `ProductPurchaseComponent` to handle product purchases.
- Created `PurchaseReceiptTemplateComponent` for displaying purchase receipt details.
- Developed `PurchaseFormComponent` for managing purchase form inputs and submission.
- Introduced `ProductChargeRowFormComponent` and `ProductChargeRowFormFieldsComponent` for handling product charge rows in the form.
- Implemented `PurchaseReceiptProductRowComponent` for displaying individual product rows in the receipt.
- Established API routes for purchase operations in `apiRoutes`.
- Integrated suppliers and inventories selection components.
- Added utility functions for converting prices to Persian alphabet.
- Created a utility for generating full names from name parts.
- Enhanced form validation and submission handling in the purchase form.
- Updated styles and templates for improved UI/UX.
2025-12-09 20:17:00 +03:30

58 lines
1.1 KiB
TypeScript

import { Maybe } from '@/core';
export interface IPurchaseRawResponse {
id: number;
totalAmount: number;
inventoryId: number;
supplierId: number;
code: string;
items: IPurchaseItemResponse[];
createdAt: string;
updatedAt: string;
deletedAt?: string;
}
export interface IPurchaseResponse extends IPurchaseRawResponse {}
export interface IPurchaseItemRawResponse {
id: number;
count: number;
fee: number;
total: number;
productId: number;
}
export interface IPurchaseRequest {
totalAmount: number;
inventoryId: number;
supplierId: number;
code?: string;
description?: string;
items: IPurchaseItemRequest[];
}
export interface IPurchaseItemRequest {
productId: number;
count: number;
fee: number;
total: number;
}
export interface IPurchaseForm {
inventory: Maybe<IInventoryResponse>;
supplier: Maybe<ISupplierResponse>;
code: string;
isSettled: boolean;
buyAt: Date | string;
description: string;
totalAmount: number;
products: IPurchaseItemForm[];
}
export interface IPurchaseItemForm {
product: Maybe<IProductResponse>;
count: number;
fee: number;
total: number;
description?: string;
}