Persist supply receipts and stock
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 44s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 44s
This commit is contained in:
70
src/types.ts
70
src/types.ts
@@ -166,6 +166,76 @@ export type ConsumptionReferencePayload = {
|
||||
materialCostPerKg?: number | string | null;
|
||||
};
|
||||
|
||||
export type SupplyReceiptStatus = 'pending' | 'approved';
|
||||
|
||||
export interface SupplyReceipt {
|
||||
id: number;
|
||||
category: string;
|
||||
product: string;
|
||||
quantity: number;
|
||||
unit: string;
|
||||
supplier: string;
|
||||
invoice: string;
|
||||
notes: string;
|
||||
status: SupplyReceiptStatus;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
approvedAt: string | null;
|
||||
}
|
||||
|
||||
export interface SupplyLot {
|
||||
id: number;
|
||||
receiptId: number | null;
|
||||
category: string;
|
||||
product: string;
|
||||
quantity: number;
|
||||
unit: string;
|
||||
supplier: string;
|
||||
invoice: string;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface SupplyMovement {
|
||||
id: number;
|
||||
receiptId: number | null;
|
||||
lotId: number | null;
|
||||
type: string;
|
||||
category: string;
|
||||
product: string;
|
||||
quantity: number;
|
||||
unit: string;
|
||||
reason: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface SupplyStats {
|
||||
totalQuantityKg: number;
|
||||
activeLots: number;
|
||||
rolls: number;
|
||||
alerts: number;
|
||||
pendingReceipts: number;
|
||||
approvedReceipts: number;
|
||||
}
|
||||
|
||||
export interface SupplySummary {
|
||||
receipts: SupplyReceipt[];
|
||||
lots: SupplyLot[];
|
||||
movements: SupplyMovement[];
|
||||
stats: SupplyStats;
|
||||
}
|
||||
|
||||
export type SupplyReceiptPayload = {
|
||||
category: string;
|
||||
product: string;
|
||||
quantity: number | string;
|
||||
unit: string;
|
||||
supplier?: string;
|
||||
invoice?: string;
|
||||
notes?: string;
|
||||
};
|
||||
|
||||
export interface DateRange {
|
||||
start: Date;
|
||||
end: Date;
|
||||
|
||||
Reference in New Issue
Block a user