feat(FE): adding 4 input scenario marketing type

This commit is contained in:
randy-ar
2026-02-05 05:38:02 +07:00
parent cb22fd1037
commit 43dcbf73ee
7 changed files with 123 additions and 65 deletions
+2 -11
View File
@@ -40,6 +40,8 @@ export type BaseSalesOrder = {
convertion_unit: string;
total_peti: number;
weight_per_convertion: number;
/** Umur minggu untuk AYAM_PULLET */
week?: number;
};
export type BaseDeliveryOrder = {
@@ -115,17 +117,6 @@ 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;