refactor(FE-87-106): refactor api integration untuk project flock dan project flock kandang

This commit is contained in:
randy-ar
2025-11-10 04:08:08 +07:00
parent fcc2fced06
commit e0c347c3d5
19 changed files with 961 additions and 506 deletions
+1
View File
@@ -41,6 +41,7 @@ export type MarketingDeliveryProducts = {
total_price: number;
delivery_date: string;
vehicle_number: string;
do_number?: string | undefined;
};
export type Marketing = BaseMetadata & BaseMarketing;
+5 -3
View File
@@ -14,9 +14,11 @@ export type Chickin = BaseMetadata & BaseChickin;
export type CreateChickinPayload = {
project_flock_kandang_id: number;
chick_in_date: string;
note: string;
quantity?: number;
chickin_requests: {
chick_in_date: string;
note?: string;
product_warehouse_id: number;
}[];
};
export type UpdateChickinPayload = CreateChickinPayload & {
+4 -3
View File
@@ -2,6 +2,7 @@ import { Kandang } from '@/type/master-data/kandang';
import { ProjectFlock } from '@/types/api/production/project-flock';
import { ProductWarehouse } from '@/types/api/inventory/product-warehouse';
import { Supplier } from '../master-data/supplier';
import { BaseApproval } from '../api-general';
export type BaseProjectFlockKandang = {
id: number;
@@ -10,14 +11,14 @@ export type BaseProjectFlockKandang = {
kandang: Kandang;
project_flock: ProjectFlock;
available_qtys?: AvailableQty[];
approval: BaseApproval;
};
export type AvailableQty = {
chick_in_date?: string;
po_number?: string;
document_path?: string;
supplier?: Supplier;
available_qty: number;
product_warehouse: ProductWarehouse;
note?: string;
};
export type ProjectFlockKandang = BaseProjectFlockKandang;
+4 -3
View File
@@ -9,8 +9,9 @@ export type BaseProjectFlock = {
id: number;
name: string;
status: string;
flock: Flock;
flock_id: number;
flock?: Flock;
flock_i?: number;
flock_name: string;
area: Area;
area_id: number;
category: string;
@@ -32,7 +33,7 @@ export type PeriodFlock = {
export type ProjectFlock = BaseMetadata & BaseProjectFlock;
export type CreateProjectFlockPayload = {
flock_id: number;
flock_name: string;
area_id: number;
category: string;
fcr_id: number;