init app
This commit is contained in:
41
lib/types.ts
Normal file
41
lib/types.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
export type OrderStatus = "pending" | "purchased" | "delivered" | "closed";
|
||||
|
||||
export interface OrderItemData {
|
||||
id: string;
|
||||
orderId: string;
|
||||
customerId: string | null;
|
||||
customerName: string | null;
|
||||
itemName: string;
|
||||
initPrice: number;
|
||||
myPrice: number;
|
||||
taxRatio: number;
|
||||
quantity: number;
|
||||
netPrice: number;
|
||||
myNetPrice: number;
|
||||
finalPrice: number;
|
||||
}
|
||||
|
||||
export interface OrderWithDetails {
|
||||
id: string;
|
||||
title: string;
|
||||
status: OrderStatus;
|
||||
notes: string | null;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
customers: { customer: { id: string; name: string } }[];
|
||||
items: OrderItemData[];
|
||||
}
|
||||
|
||||
export interface DashboardStats {
|
||||
pending: number;
|
||||
purchased: number;
|
||||
delivered: number;
|
||||
closed: number;
|
||||
totalOrders: number;
|
||||
}
|
||||
|
||||
export interface FormState {
|
||||
errors?: Record<string, string[]>;
|
||||
message?: string;
|
||||
success?: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user