feat(repairs): add repair estimates
This commit is contained in:
parent
6e7e75f864
commit
4436fe5f73
25 changed files with 1802 additions and 9 deletions
|
|
@ -23,6 +23,8 @@ export type RepairDocumentType =
|
|||
| "shipping"
|
||||
| "other";
|
||||
export type RepairDocumentVisibility = "internal" | "customer";
|
||||
export type RepairEstimateStatus = "draft" | "sent" | "approved" | "declined" | "expired" | "cancelled";
|
||||
export type RepairEstimateItemType = "labor" | "part" | "flat_rate" | "shipping" | "other";
|
||||
|
||||
export interface Repair {
|
||||
id: number;
|
||||
|
|
@ -161,3 +163,55 @@ export interface RepairDocument {
|
|||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface RepairEstimateItemPayload {
|
||||
item_type: RepairEstimateItemType;
|
||||
title: string;
|
||||
description: string | null;
|
||||
quantity: string;
|
||||
unit: string;
|
||||
unit_price_cents: number;
|
||||
}
|
||||
|
||||
export interface RepairEstimatePayload {
|
||||
title: string;
|
||||
customer_message: string;
|
||||
internal_note: string | null;
|
||||
tax_rate_percent: string;
|
||||
currency: string;
|
||||
valid_until: string | null;
|
||||
items: RepairEstimateItemPayload[];
|
||||
}
|
||||
|
||||
export interface RepairEstimateItem extends RepairEstimateItemPayload {
|
||||
id: number;
|
||||
estimate_id: number;
|
||||
position: number;
|
||||
total_cents: number;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
export interface RepairEstimate {
|
||||
id: number;
|
||||
repair_id: number;
|
||||
estimate_number: string;
|
||||
status: RepairEstimateStatus;
|
||||
title: string;
|
||||
customer_message: string;
|
||||
internal_note: string | null;
|
||||
subtotal_cents: number;
|
||||
tax_rate_percent: string;
|
||||
tax_cents: number;
|
||||
total_cents: number;
|
||||
currency: string;
|
||||
valid_until: string | null;
|
||||
sent_at: string | null;
|
||||
approved_at: string | null;
|
||||
declined_at: string | null;
|
||||
customer_response_message: string | null;
|
||||
created_by_user_id: number | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
items: RepairEstimateItem[];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue