Persist supply receipts and stock
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 44s

This commit is contained in:
Cauê Faleiros
2026-07-13 11:31:41 -03:00
parent 1bf5e518de
commit 8320f2ae35
7 changed files with 948 additions and 123 deletions

View File

@@ -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;