191 lines
3.7 KiB
TypeScript
191 lines
3.7 KiB
TypeScript
|
|
export interface BaseRecord {
|
||
|
|
id: string;
|
||
|
|
created: string;
|
||
|
|
updated: string;
|
||
|
|
collectionId: string;
|
||
|
|
collectionName: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Customer extends BaseRecord {
|
||
|
|
customer: string;
|
||
|
|
email: string;
|
||
|
|
alternative_email: string;
|
||
|
|
buyer_email: string;
|
||
|
|
number: string;
|
||
|
|
company: string;
|
||
|
|
dateadded: string;
|
||
|
|
lastvisiteddate: string;
|
||
|
|
rep: string;
|
||
|
|
coordinates: string;
|
||
|
|
description: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Company extends BaseRecord {
|
||
|
|
company: string;
|
||
|
|
address: string;
|
||
|
|
vendor: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface CompanyDetails extends BaseRecord {
|
||
|
|
company_name: string;
|
||
|
|
address: string;
|
||
|
|
number: string;
|
||
|
|
email: string;
|
||
|
|
vat_number: string;
|
||
|
|
registration_number: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface Supplier extends BaseRecord {
|
||
|
|
suppliername: string;
|
||
|
|
email: string;
|
||
|
|
suppliernumber: string;
|
||
|
|
supplieraddress: string;
|
||
|
|
supply_tags: string;
|
||
|
|
coordinates: string;
|
||
|
|
closingtime: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
export type QuoteStatus =
|
||
|
|
| "new"
|
||
|
|
| "claimed"
|
||
|
|
| "processed"
|
||
|
|
| "emailed"
|
||
|
|
| "approval_pending"
|
||
|
|
| "approved"
|
||
|
|
| "rejected"
|
||
|
|
| "problem"
|
||
|
|
| "complete"
|
||
|
|
| "cancelled"
|
||
|
|
| "follow_up"
|
||
|
|
| "email_failed"
|
||
|
|
| "unmatched_bounce";
|
||
|
|
|
||
|
|
export interface Quote extends BaseRecord {
|
||
|
|
quote_number: string;
|
||
|
|
quote_reference: string;
|
||
|
|
external_number: string;
|
||
|
|
rfq_number: string;
|
||
|
|
markup: number;
|
||
|
|
customer: string;
|
||
|
|
company: string;
|
||
|
|
claimed_by: string;
|
||
|
|
description: string;
|
||
|
|
status: QuoteStatus;
|
||
|
|
approved_by: string;
|
||
|
|
notes: string;
|
||
|
|
email_sender: string;
|
||
|
|
email_subject: string;
|
||
|
|
email_body: string;
|
||
|
|
has_attachments: boolean;
|
||
|
|
company_letterhead: string;
|
||
|
|
email_delivered: boolean;
|
||
|
|
email_delivered_at: string;
|
||
|
|
email_opened: boolean;
|
||
|
|
email_opened_at: string;
|
||
|
|
email_tracking_id: string;
|
||
|
|
has_new_reply: boolean;
|
||
|
|
last_reply_at: string;
|
||
|
|
email_failed_at: string;
|
||
|
|
pdf_generated_at: string;
|
||
|
|
expand?: {
|
||
|
|
customer?: Customer;
|
||
|
|
company?: Company;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface QuoteItem extends BaseRecord {
|
||
|
|
quote: string;
|
||
|
|
description: string;
|
||
|
|
quote_number: string;
|
||
|
|
quote_reference: string;
|
||
|
|
quantity: number;
|
||
|
|
supplier: string;
|
||
|
|
cost_price: number;
|
||
|
|
selling_price: number;
|
||
|
|
notes: string;
|
||
|
|
is_processed: boolean;
|
||
|
|
markup: number;
|
||
|
|
included_in_quote: boolean;
|
||
|
|
quote_pdf_id: string;
|
||
|
|
expand?: {
|
||
|
|
supplier?: Supplier;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export type OrderStatus =
|
||
|
|
| "new"
|
||
|
|
| "processing"
|
||
|
|
| "order_ready"
|
||
|
|
| "po_generated"
|
||
|
|
| "completed"
|
||
|
|
| "cancelled";
|
||
|
|
|
||
|
|
export type ItemStatus =
|
||
|
|
| "pending"
|
||
|
|
| "processed"
|
||
|
|
| "po_generated"
|
||
|
|
| "driver_pool"
|
||
|
|
| "assigned"
|
||
|
|
| "collected"
|
||
|
|
| "stock_verified"
|
||
|
|
| "picking"
|
||
|
|
| "ready_delivery"
|
||
|
|
| "delivered"
|
||
|
|
| "cancelled";
|
||
|
|
|
||
|
|
export interface Order extends BaseRecord {
|
||
|
|
order_number: string;
|
||
|
|
company: string;
|
||
|
|
customer: string;
|
||
|
|
quote: string;
|
||
|
|
status: OrderStatus;
|
||
|
|
notes: string;
|
||
|
|
quote_matching_attempted: boolean;
|
||
|
|
quote_match_confidence: number;
|
||
|
|
potential_quote: string;
|
||
|
|
potential_quote_confidence: number;
|
||
|
|
is_repair_order: boolean;
|
||
|
|
expand?: {
|
||
|
|
company?: Company;
|
||
|
|
customer?: Customer;
|
||
|
|
quote?: Quote;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface OrderItem extends BaseRecord {
|
||
|
|
order: string;
|
||
|
|
description: string;
|
||
|
|
po_description: string;
|
||
|
|
quantity: number;
|
||
|
|
order_qty: number;
|
||
|
|
selling_price: number;
|
||
|
|
supplier: string;
|
||
|
|
cost_price: number;
|
||
|
|
markup: number;
|
||
|
|
purchase_order: string;
|
||
|
|
item_status: ItemStatus;
|
||
|
|
notes: string;
|
||
|
|
expand?: {
|
||
|
|
supplier?: Supplier;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface PurchaseOrder extends BaseRecord {
|
||
|
|
po_number: string;
|
||
|
|
order: string;
|
||
|
|
supplier: string;
|
||
|
|
status: string;
|
||
|
|
total_amount: number;
|
||
|
|
expand?: {
|
||
|
|
order?: Order;
|
||
|
|
supplier?: Supplier;
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
export interface DashboardStats {
|
||
|
|
totalCustomers: number;
|
||
|
|
activeQuotes: number;
|
||
|
|
ordersThisMonth: number;
|
||
|
|
totalRevenue: number;
|
||
|
|
}
|