feat(FE): scenario egg sale with type conversion qty

This commit is contained in:
randy-ar
2026-02-05 02:39:10 +07:00
parent 09cd6395e6
commit dfd86a04e0
8 changed files with 563 additions and 123 deletions
+18
View File
@@ -36,6 +36,8 @@ export type BaseSalesOrder = {
total_price: number;
product_warehouse: ProductWarehouse;
vehicle_number: string;
marketing_type: string;
convertion_unit: string;
};
export type BaseDeliveryOrder = {
@@ -111,6 +113,22 @@ export type BaseCreateMarketingProductPayload = {
avg_weight: string | number | undefined;
total_price: string | number | undefined;
marketing_type: string;
/**
* Tipe konversi untuk TELUR
* - "PETI": Penjualan telur dalam satuan peti
* - "KG": Penjualan telur dalam satuan kilogram
*
* Note: Untuk mode "QTY" di FE, tetap kirim "KG" ke BE dengan unit_price yang dinormalisasi
* karena BE tidak support convertion_unit "QTY". Workaround:
* - FE hitung: total_price = qty × price_per_qty
* - FE normalisasi: unit_price = total_price / total_weight
* - BE akan hitung: total_price = total_weight × unit_price (hasil sama)
*/
convertion_unit?: 'PETI' | 'KG';
/** Berat per peti (kg), hanya untuk TELUR + PETI */
weight_per_convertion?: number;
/** Umur minggu untuk AYAM_PULLET */
week?: number;
};
/**