JessieExcel/shared/types.ts
2026-03-25 01:54:12 +08:00

81 lines
1.5 KiB
TypeScript

export type Role = 'sales' | 'purchase' | 'manager' | 'admin'
export type UserStatus = 'active' | 'disabled'
export type OrderProgressStatus = string
export type FactoryStatus = 'active' | 'inactive'
export interface PublicUser {
id: string
username: string
email?: string
role: Role
status: UserStatus
createdAt: string
updatedAt: string
}
export interface UserRecord extends PublicUser {
passwordHash: string
}
export interface Factory {
id: string
name: string
contactPerson?: string
contactPhone?: string
contactEmail?: string
address?: string
status: FactoryStatus
createdAt: string
updatedAt: string
}
export interface Order {
id: string
orderNo: string
poNo?: string
productName: string
country?: string
orderAmount?: number
orderDate?: string
customerDeliveryDate?: string
factoryId?: string
factoryDeliveryDate?: string
factoryContract?: string
packagingStatus?: string
stickerStatus?: string
shippingStatus?: string
inspectionStatus?: string
purchaseAmount?: number
orderProgress: OrderProgressStatus
remarks?: string
ciAmount?: number
etd?: string
eta?: string
paymentDate?: string
paymentAmount?: number
balance?: number
createdByUserId: string
createdAt: string
updatedAt: string
}
export interface OrderProgressEvent {
id: string
orderId: string
status: OrderProgressStatus
note?: string
createdByUserId: string
createdAt: string
}
export interface DbShape {
users: UserRecord[]
factories: Factory[]
orders: Order[]
progressEvents: OrderProgressEvent[]
}