fix(FE-279): adjust closing project flock kandang

This commit is contained in:
randy-ar
2025-12-09 10:33:38 +07:00
parent b97cc39854
commit 8a0adf847e
10 changed files with 398 additions and 190 deletions
@@ -54,120 +54,119 @@ export class ProjectFlockKandangService extends BaseApiService<
id: number
): Promise<BaseApiResponse<CheckClosingResponse> | undefined> {
// Dummy data - replace with actual API call when backend is ready
return new Promise((resolve) => {
setTimeout(() => {
resolve({
code: 200,
status: 'success',
message: 'Cek persyaratan closing kandang',
data: {
unfinished_expenses: 2,
stock_remaining: [
{
id: 1,
product_id: 1,
warehouse_id: 1,
quantity: 0,
product: {
id: 1,
name: 'Pakan Starter',
brand: 'Brand A',
sku: 'PKN-STR-001',
product_price: 15000,
selling_price: 17000,
tax: 0,
expiry_period: 365,
flags: ['active'],
uom: {
id: 1,
name: 'Kg',
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin User',
},
created_at: '2024-01-01',
updated_at: '2024-01-01',
},
product_category: {
id: 1,
name: 'Pakan',
code: 'PKN',
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin User',
},
created_at: '2024-01-01',
updated_at: '2024-01-01',
},
suppliers: [],
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin User',
},
created_at: '2024-01-01',
updated_at: '2024-01-01',
},
warehouse: {
id: 1,
name: 'Gudang Utama',
type: 'AREA',
area: {
id: 1,
name: 'Area 1',
},
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin User',
},
created_at: '2024-01-01',
updated_at: '2024-01-01',
},
created_user: {
id: 1,
id_user: 1,
email: 'admin@example.com',
name: 'Admin User',
},
created_at: '2025-01-01',
updated_at: '2025-01-01',
},
],
expenses: [
{
id: 1,
po_number: 'PO-BOP-LTI-00001',
category: 'NON-BOP',
total: 110000,
status: 'SELESAI',
step_name: 'Approval Finance',
step: 5,
reference_number: 'BOP-LTI-00001',
},
{
id: 3,
po_number: 'PO-BOP-LTI-00003',
category: 'BOP',
total: 110000,
status: 'SELESAI',
step_name: 'Approval Finance',
step: 5,
reference_number: 'BOP-LTI-00003',
},
],
},
});
}, 500); // Simulate network delay
});
// return new Promise((resolve) => {
// setTimeout(() => {
// resolve({
// code: 200,
// status: 'success',
// message: 'Cek persyaratan closing kandang',
// data: {
// unfinished_expenses: 2,
// stock_remaining: [
// {
// id: 1,
// product_id: 1,
// warehouse_id: 1,
// quantity: 0,
// product: {
// id: 1,
// name: 'Pakan Starter',
// brand: 'Brand A',
// sku: 'PKN-STR-001',
// product_price: 15000,
// selling_price: 17000,
// tax: 0,
// expiry_period: 365,
// flags: ['active'],
// uom: {
// id: 1,
// name: 'Kg',
// created_user: {
// id: 1,
// id_user: 1,
// email: 'admin@example.com',
// name: 'Admin User',
// },
// created_at: '2024-01-01',
// updated_at: '2024-01-01',
// },
// product_category: {
// id: 1,
// name: 'Pakan',
// code: 'PKN',
// created_user: {
// id: 1,
// id_user: 1,
// email: 'admin@example.com',
// name: 'Admin User',
// },
// created_at: '2024-01-01',
// updated_at: '2024-01-01',
// },
// suppliers: [],
// created_user: {
// id: 1,
// id_user: 1,
// email: 'admin@example.com',
// name: 'Admin User',
// },
// created_at: '2024-01-01',
// updated_at: '2024-01-01',
// },
// warehouse: {
// id: 1,
// name: 'Gudang Utama',
// type: 'AREA',
// area: {
// id: 1,
// name: 'Area 1',
// },
// created_user: {
// id: 1,
// id_user: 1,
// email: 'admin@example.com',
// name: 'Admin User',
// },
// created_at: '2024-01-01',
// updated_at: '2024-01-01',
// },
// created_user: {
// id: 1,
// id_user: 1,
// email: 'admin@example.com',
// name: 'Admin User',
// },
// created_at: '2025-01-01',
// updated_at: '2025-01-01',
// },
// ],
// expenses: [
// {
// id: 1,
// po_number: 'PO-BOP-LTI-00001',
// category: 'NON-BOP',
// total: 110000,
// status: 'SELESAI',
// step_name: 'Approval Finance',
// step: 5,
// reference_number: 'BOP-LTI-00001',
// },
// {
// id: 3,
// po_number: 'PO-BOP-LTI-00003',
// category: 'BOP',
// total: 110000,
// status: 'SELESAI',
// step_name: 'Approval Finance',
// step: 5,
// reference_number: 'BOP-LTI-00003',
// },
// ],
// },
// });
// }, 500); // Simulate network delay
// });
/*
// Original API call - uncomment when backend is ready
try {
const path = `${this.basePath}/${id}/closing/check`;
@@ -181,7 +180,6 @@ export class ProjectFlockKandangService extends BaseApiService<
}
return undefined;
}
*/
}
}