mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 05:45:46 +00:00
feat(FE-177): refactor sales order management with new schema and API integration
This commit is contained in:
+33
-17
@@ -7,16 +7,17 @@ import {
|
||||
import { ProductWarehouse } from '@/types/api/inventory/product-warehouse';
|
||||
import { Kandang } from '@/types/api/master-data/kandang';
|
||||
|
||||
/**
|
||||
* Base Data Response
|
||||
*/
|
||||
export type BaseMarketing = {
|
||||
id: number;
|
||||
status?: string;
|
||||
so_number: string;
|
||||
name: string;
|
||||
customer: Customer;
|
||||
so_docs: string;
|
||||
so_date: string;
|
||||
sales_person: CreatedUser;
|
||||
sales_person_id: number;
|
||||
notes: string;
|
||||
grand_total: number;
|
||||
approval: BaseApproval;
|
||||
marketing_products?: MarketingProduct[];
|
||||
};
|
||||
@@ -29,7 +30,7 @@ export type MarketingProduct = {
|
||||
total_weight: number;
|
||||
total_price: number;
|
||||
product_warehouse: ProductWarehouse;
|
||||
marketing_delivery_products?: MarketingDeliveryProducts;
|
||||
delivery_product?: MarketingDeliveryProducts;
|
||||
};
|
||||
|
||||
export type MarketingDeliveryProducts = {
|
||||
@@ -39,34 +40,49 @@ export type MarketingDeliveryProducts = {
|
||||
avg_weight: number;
|
||||
total_weight: number;
|
||||
total_price: number;
|
||||
delivery_date: string;
|
||||
delivery_date: string | null;
|
||||
vehicle_number: string;
|
||||
do_number?: string | undefined;
|
||||
do_number?: string | undefined; // Uncertain
|
||||
};
|
||||
|
||||
export type Marketing = BaseMetadata & BaseMarketing;
|
||||
|
||||
export type CreateMarketingPayload = {
|
||||
/**
|
||||
* Base Data Payload
|
||||
*/
|
||||
export type BaseCreateMarketingPayload = {
|
||||
customer_id: number;
|
||||
sales_person_id: number;
|
||||
date: string;
|
||||
notes: string;
|
||||
marketing_products: CreateMarketingProductPayload[];
|
||||
};
|
||||
export type UpdateMarketingPayload = CreateMarketingPayload;
|
||||
|
||||
export type CreateMarketingProductPayload = {
|
||||
id?: number;
|
||||
export type BaseCreateMarketingProductPayload = {
|
||||
vehicle_number: string;
|
||||
kandang_id: string | number | undefined;
|
||||
kandang: Kandang | undefined;
|
||||
product_warehouse_id: string | number | undefined;
|
||||
product_warehouse: ProductWarehouse | undefined;
|
||||
unit_price: string | number | undefined;
|
||||
total_weight: string | number | undefined;
|
||||
qty: string | number | undefined;
|
||||
uom: string | undefined;
|
||||
avg_weight: string | number | undefined;
|
||||
total_price: string | number | undefined;
|
||||
delivery_date?: string | null;
|
||||
};
|
||||
export type UpdateMarketingProductPayload = CreateMarketingProductPayload;
|
||||
|
||||
/**
|
||||
* Payload Data Types Sales Order
|
||||
*/
|
||||
|
||||
export type CreateSalesOrderPayload = BaseCreateMarketingPayload & {
|
||||
marketing_products: CreateSalesOrderProductPayload[];
|
||||
};
|
||||
|
||||
export type CreateSalesOrderProductPayload =
|
||||
BaseCreateMarketingProductPayload & {
|
||||
id?: number;
|
||||
kandang?: Kandang | undefined;
|
||||
product_warehouse?: ProductWarehouse | undefined;
|
||||
};
|
||||
|
||||
export type UpdateSalesOrderProductPayload = CreateSalesOrderProductPayload;
|
||||
|
||||
export type UpdateSalesOrderPayload = CreateSalesOrderPayload;
|
||||
|
||||
Reference in New Issue
Block a user