feat(FE-177): refactor sales order management with new schema and API integration

This commit is contained in:
randy-ar
2025-11-14 15:52:58 +07:00
parent 10976452f5
commit 3fdb10ec7f
15 changed files with 280 additions and 222 deletions
+10 -16
View File
@@ -176,8 +176,7 @@ export const dummyMarketings: Marketing[] = [
{
id: 1,
status: 'APPROVED',
so_number: 'SO-001-2025',
so_docs: 'https://example.com/docs/so001.pdf',
name: 'SO-001-2025',
so_date: format(new Date(), 'yyyy-MM-dd'),
customer: {
id: 1,
@@ -193,9 +192,8 @@ export const dummyMarketings: Marketing[] = [
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
},
sales_person: createdUser,
sales_person_id: createdUser.id,
notes: 'Pengiriman awal bulan.',
grand_total: 7500000,
approval: {
step_number: 1,
step_name: 'Pengajuan Order',
@@ -212,7 +210,7 @@ export const dummyMarketings: Marketing[] = [
total_weight: 250,
total_price: 7500000,
product_warehouse: dummyProductWarehouses[0],
marketing_delivery_products: {
delivery_product: {
id: 1,
qty: 100,
unit_price: 75000,
@@ -233,8 +231,7 @@ export const dummyMarketings: Marketing[] = [
{
id: 2,
status: 'APPROVED',
so_number: 'SO-002-2025',
so_docs: 'https://example.com/docs/so002.pdf',
name: 'SO-002-2025',
so_date: format(new Date(), 'yyyy-MM-dd'),
customer: {
id: 2,
@@ -250,9 +247,8 @@ export const dummyMarketings: Marketing[] = [
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
},
sales_person: createdUser,
sales_person_id: createdUser.id,
notes: 'Pesanan kedua untuk stok akhir tahun.',
grand_total: 3750000,
approval: {
step_number: 2,
step_name: 'Sales Order',
@@ -269,7 +265,7 @@ export const dummyMarketings: Marketing[] = [
total_weight: 125,
total_price: 3750000,
product_warehouse: dummyProductWarehouses[1],
marketing_delivery_products: {
delivery_product: {
id: 2,
qty: 50,
unit_price: 75000,
@@ -290,8 +286,7 @@ export const dummyMarketings: Marketing[] = [
{
id: 3,
status: 'APPROVED',
so_number: 'SO-003-2025',
so_docs: 'https://example.com/docs/so003.pdf',
name: 'SO-003-2025',
so_date: format(new Date(), 'yyyy-MM-dd'),
customer: {
id: 3,
@@ -307,9 +302,8 @@ export const dummyMarketings: Marketing[] = [
created_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
updated_at: format(new Date(), 'yyyy-MM-dd HH:mm:ss'),
},
sales_person: createdUser,
sales_person_id: createdUser.id,
notes: 'Order untuk pengiriman ke luar kota.',
grand_total: 5600000,
approval: {
step_number: 3,
step_name: 'Delivery Order',
@@ -326,7 +320,7 @@ export const dummyMarketings: Marketing[] = [
total_weight: 192,
total_price: 5600000,
product_warehouse: dummyProductWarehouses[0],
marketing_delivery_products: {
delivery_product: {
id: 3,
qty: 80,
unit_price: 70000,
@@ -345,7 +339,7 @@ export const dummyMarketings: Marketing[] = [
total_weight: 192,
total_price: 5600000,
product_warehouse: dummyProductWarehouses[0],
marketing_delivery_products: {
delivery_product: {
id: 3,
qty: 80,
unit_price: 70000,