POs
This commit is contained in:
@@ -11,6 +11,8 @@ export const permissions = {
|
||||
ganttRead: "gantt.read",
|
||||
salesRead: "sales.read",
|
||||
salesWrite: "sales.write",
|
||||
purchasingRead: "purchasing.read",
|
||||
purchasingWrite: "purchasing.write",
|
||||
shippingRead: "shipping.read",
|
||||
shippingWrite: "shipping.write",
|
||||
} as const;
|
||||
|
||||
@@ -6,5 +6,6 @@ export * from "./crm/types.js";
|
||||
export * from "./files/types.js";
|
||||
export * from "./gantt/types.js";
|
||||
export * from "./inventory/types.js";
|
||||
export * from "./purchasing/types.js";
|
||||
export * from "./sales/types.js";
|
||||
export * from "./shipping/types.js";
|
||||
|
||||
70
shared/src/purchasing/types.ts
Normal file
70
shared/src/purchasing/types.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import type { InventoryUnitOfMeasure } from "../inventory/types.js";
|
||||
|
||||
export const purchaseOrderStatuses = ["DRAFT", "ISSUED", "APPROVED", "CLOSED"] as const;
|
||||
|
||||
export type PurchaseOrderStatus = (typeof purchaseOrderStatuses)[number];
|
||||
|
||||
export interface PurchaseVendorOptionDto {
|
||||
id: string;
|
||||
name: string;
|
||||
email: string;
|
||||
paymentTerms: string | null;
|
||||
currencyCode: string | null;
|
||||
}
|
||||
|
||||
export interface PurchaseLineDto {
|
||||
id: string;
|
||||
itemId: string;
|
||||
itemSku: string;
|
||||
itemName: string;
|
||||
description: string;
|
||||
quantity: number;
|
||||
unitOfMeasure: InventoryUnitOfMeasure;
|
||||
unitCost: number;
|
||||
lineTotal: number;
|
||||
position: number;
|
||||
}
|
||||
|
||||
export interface PurchaseLineInput {
|
||||
itemId: string;
|
||||
description: string;
|
||||
quantity: number;
|
||||
unitOfMeasure: InventoryUnitOfMeasure;
|
||||
unitCost: number;
|
||||
position: number;
|
||||
}
|
||||
|
||||
export interface PurchaseOrderSummaryDto {
|
||||
id: string;
|
||||
documentNumber: string;
|
||||
vendorId: string;
|
||||
vendorName: string;
|
||||
status: PurchaseOrderStatus;
|
||||
subtotal: number;
|
||||
taxPercent: number;
|
||||
taxAmount: number;
|
||||
freightAmount: number;
|
||||
total: number;
|
||||
issueDate: string;
|
||||
updatedAt: string;
|
||||
lineCount: number;
|
||||
}
|
||||
|
||||
export interface PurchaseOrderDetailDto extends PurchaseOrderSummaryDto {
|
||||
vendorEmail: string;
|
||||
notes: string;
|
||||
paymentTerms: string | null;
|
||||
currencyCode: string | null;
|
||||
createdAt: string;
|
||||
lines: PurchaseLineDto[];
|
||||
}
|
||||
|
||||
export interface PurchaseOrderInput {
|
||||
vendorId: string;
|
||||
status: PurchaseOrderStatus;
|
||||
issueDate: string;
|
||||
taxPercent: number;
|
||||
freightAmount: number;
|
||||
notes: string;
|
||||
lines: PurchaseLineInput[];
|
||||
}
|
||||
Reference in New Issue
Block a user