Consolida recepcoes, stock, equipamentos e identidade SGC
This commit is contained in:
@@ -0,0 +1,95 @@
|
||||
export type StockItem = {
|
||||
id: number;
|
||||
code: string;
|
||||
name: string;
|
||||
unit: string;
|
||||
};
|
||||
export type Warehouse = { id: number; code: string; name: string };
|
||||
export type ReceiptLineProgress = {
|
||||
id: number;
|
||||
description: string;
|
||||
unit: string;
|
||||
purchase_type: string;
|
||||
ordered_milli: number;
|
||||
received_milli: number;
|
||||
accepted_milli: number;
|
||||
rejected_milli: number;
|
||||
delivery_pending_milli: number;
|
||||
acceptance_pending_milli: number;
|
||||
};
|
||||
export type ReceiptProgress = {
|
||||
lines: ReceiptLineProgress[];
|
||||
state: string;
|
||||
has_divergences: boolean;
|
||||
};
|
||||
export type ReceiptItem = {
|
||||
id: number;
|
||||
received_milli: number;
|
||||
accepted_milli: number;
|
||||
rejected_milli: number;
|
||||
quality_status: string;
|
||||
notes: string | null;
|
||||
snapshot: {
|
||||
order_item: { description: string; unit: string };
|
||||
stock_item: StockItem | null;
|
||||
warehouse: Warehouse | null;
|
||||
physical: boolean;
|
||||
};
|
||||
};
|
||||
export type Receipt = {
|
||||
id: number;
|
||||
number: string;
|
||||
purchase_order_id: number;
|
||||
delivery_note: string;
|
||||
received_on: string;
|
||||
confirmed_at: string;
|
||||
status: string;
|
||||
snapshot: {
|
||||
order: { id: number; number: string };
|
||||
supplier: { name: string };
|
||||
receiver: { name: string };
|
||||
warehouse: Warehouse | null;
|
||||
};
|
||||
items: ReceiptItem[];
|
||||
};
|
||||
export type StockMovement = {
|
||||
id: number;
|
||||
quantity_milli: number;
|
||||
moved_at: string;
|
||||
moved_by: number;
|
||||
stock_item_id: number;
|
||||
warehouse_id: number;
|
||||
movement_type: string;
|
||||
stock_operation_id?: number | null;
|
||||
snapshot: {
|
||||
stock_item: StockItem;
|
||||
warehouse: Warehouse;
|
||||
order_number?: string;
|
||||
delivery_note?: string;
|
||||
receipt_id?: number;
|
||||
reference?: string;
|
||||
reason?: string;
|
||||
equipment?: { id: number; code: string; description: string } | null;
|
||||
};
|
||||
};
|
||||
export type Page<T> = {
|
||||
data: T[];
|
||||
prev_page_url: string | null;
|
||||
next_page_url: string | null;
|
||||
};
|
||||
export const quantity = (milli: number) =>
|
||||
new Intl.NumberFormat('pt-MZ', { maximumFractionDigits: 3 }).format(
|
||||
milli / 1000,
|
||||
);
|
||||
export const receiptStates: Record<string, string> = {
|
||||
not_received: 'Sem recepção',
|
||||
partial: 'Recepção parcial',
|
||||
complete: 'Recepção total aceite',
|
||||
rejected: 'Recepção rejeitada',
|
||||
quality_pending: 'Entrega completa com divergências',
|
||||
};
|
||||
export const qualityStates: Record<string, string> = {
|
||||
compliant: 'Conforme',
|
||||
reservations: 'Conforme com reservas',
|
||||
nonconforming: 'Não conforme',
|
||||
};
|
||||
@@ -18,6 +18,10 @@ export type RequisitionItem = {
|
||||
description: string;
|
||||
category: string;
|
||||
purchase_type: string;
|
||||
equipment_id?: number | null;
|
||||
spare_part_id?: number | null;
|
||||
production_area?: string | null;
|
||||
downtime_started_at?: string | null;
|
||||
quantity: string;
|
||||
unit: string;
|
||||
unit_price_minor: number;
|
||||
|
||||
Reference in New Issue
Block a user