feat(back-end and front-end) cad bill with order

This commit is contained in:
2026-03-04 12:03:09 +01:00
parent 0f2f2bc7a9
commit 1b3f0b16ff
43 changed files with 1594 additions and 150 deletions

View File

@@ -115,6 +115,10 @@ export interface AdminQuoteSession {
createdAt: string;
expiresAt: string;
convertedOrderId?: string;
sourceRequestId?: string;
cadHours?: number;
cadHourlyRateChf?: number;
cadTotalChf?: number;
}
export interface AdminQuoteSessionDetailItem {
@@ -136,14 +140,45 @@ export interface AdminQuoteSessionDetail {
setupCostChf?: number;
supportsEnabled?: boolean;
notes?: string;
sourceRequestId?: string;
cadHours?: number;
cadHourlyRateChf?: number;
};
items: AdminQuoteSessionDetailItem[];
printItemsTotalChf: number;
cadTotalChf: number;
itemsTotalChf: number;
shippingCostChf: number;
globalMachineCostChf: number;
grandTotalChf: number;
}
export interface AdminCreateCadInvoicePayload {
sessionId?: string;
sourceRequestId?: string;
cadHours: number;
cadHourlyRateChf?: number;
notes?: string;
}
export interface AdminCadInvoice {
sessionId: string;
sessionStatus: string;
sourceRequestId?: string;
cadHours: number;
cadHourlyRateChf: number;
cadTotalChf: number;
printItemsTotalChf: number;
setupCostChf: number;
shippingCostChf: number;
grandTotalChf: number;
convertedOrderId?: string;
convertedOrderStatus?: string;
checkoutPath: string;
notes?: string;
createdAt: string;
}
@Injectable({
providedIn: 'root',
})
@@ -279,4 +314,20 @@ export class AdminOperationsService {
{ withCredentials: true },
);
}
listCadInvoices(): Observable<AdminCadInvoice[]> {
return this.http.get<AdminCadInvoice[]>(`${this.baseUrl}/cad-invoices`, {
withCredentials: true,
});
}
createCadInvoice(
payload: AdminCreateCadInvoicePayload,
): Observable<AdminCadInvoice> {
return this.http.post<AdminCadInvoice>(
`${this.baseUrl}/cad-invoices`,
payload,
{ withCredentials: true },
);
}
}