feat(sync): synchronize customer adresses and orders from Hiboutik sales (#1)
Co-authored-by: MastersGame <quentin.duwa1210@gmail.com> Reviewed-on: #1
This commit is contained in:
40
src/models/hiboutikDTO/sale.hiboutik.dto.ts
Normal file
40
src/models/hiboutikDTO/sale.hiboutik.dto.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Sale as returned by Hiboutik `GET /sales/:sale_id`, with its lines.
|
||||
* Only the fields used by the sync are typed: the payload also carries many computed copies (dates split in parts,
|
||||
* totals by tax, customer and store details...).
|
||||
*/
|
||||
export interface SaleHiboutikDto {
|
||||
sale_id: number;
|
||||
/** Local time, "YYYY-MM-DD HH:mm:ss". */
|
||||
created_at: string;
|
||||
/** Local time, "0000-00-00 00:00:00" while the sale is not completed. */
|
||||
completed_at: string;
|
||||
store_id: number;
|
||||
customer_id: number;
|
||||
currency: string;
|
||||
/** Decimal as a string, taxes included. */
|
||||
total: string;
|
||||
/** Payment type code, e.g. "CB", "ESP", "WEB". */
|
||||
payment: string;
|
||||
/** 1 for a quotation. */
|
||||
quotation: number;
|
||||
line_items: SaleLineHiboutikDto[];
|
||||
}
|
||||
|
||||
/** Line of a {@link SaleHiboutikDto}: a snapshot of the product at sale time. */
|
||||
export interface SaleLineHiboutikDto {
|
||||
line_item_id: number;
|
||||
product_id: number;
|
||||
/** Hiboutik size id, 0 for a product without sizes. */
|
||||
product_size: number;
|
||||
/** Negative for a returned item. */
|
||||
quantity: number;
|
||||
product_model: string;
|
||||
product_barcode: string;
|
||||
/** Size name, empty for a product without sizes. */
|
||||
size_name: string;
|
||||
/** Unit price before discount, taxes included (decimal as a string). */
|
||||
item_unit_gross_wo_discount: string;
|
||||
/** Unit price actually paid, discount deducted, taxes included (decimal as a string). */
|
||||
item_unit_gross: string;
|
||||
}
|
||||
Reference in New Issue
Block a user