fix(FE): resolve merge conflict

This commit is contained in:
randy-ar
2025-11-13 14:12:25 +07:00
20 changed files with 1280 additions and 1410 deletions
-12
View File
@@ -12,15 +12,3 @@ export type CreateFlockPayload = {
};
export type UpdateFlockPayload = CreateFlockPayload;
// ---------------------------------------
// TODO: adjust this later after Transfer to Laying API done
import { BaseKandang } from '@/types/api/master-data/kandang';
export type FlockWithKandangs = BaseFlock & {
totalQuantity: number;
kandangs: {
kandang: BaseKandang;
quantity: number;
}[];
};
+1
View File
@@ -10,6 +10,7 @@ export type BaseKandang = {
capacity: number;
pic: BaseUser;
project_flock_kandang_id?: number;
capacity: number;
};
export type Kandang = BaseMetadata & BaseKandang;
+14 -1
View File
@@ -8,6 +8,7 @@ import { BaseApproval, BaseMetadata } from '@/types/api/api-general';
export type BaseProjectFlock = {
id: number;
name: string;
flock_name: string;
status: string;
flock?: Flock;
flock_i?: number;
@@ -21,7 +22,9 @@ export type BaseProjectFlock = {
location_id: number;
period: number;
kandang_ids: number[];
kandangs: Kandang[];
kandangs: (Kandang & {
project_flock_kandang_id: number;
})[];
approval: BaseApproval;
};
@@ -48,3 +51,13 @@ export type ProjectFlockApprovalPayload = {
action: 'APPROVED' | 'REJECTED';
approvable_ids: number[];
};
export type ProjectFlockAvailableQuantity = {
project_flock_id: number;
flock_name: string;
category: 'LAYING' | 'GROWING';
kandangs: {
project_flock_kandang_id: number;
available_qty: number;
}[];
};
+69 -15
View File
@@ -1,34 +1,88 @@
import { BaseApiResponse, BaseMetadata, flags } from '@/types/api/api-general';
import { Kandang } from '@/types/api/master-data/kandang';
import {
BaseApiResponse,
BaseMetadata,
CreatedUser,
flags,
} from '@/types/api/api-general';
import { BaseKandang, Kandang } from '@/types/api/master-data/kandang';
import { WarehouseType } from '@/types/api/master-data/warehouse';
export type BaseTransferToLaying = {
id: number;
transfer_number: string;
transfer_date: string;
flock_source: {
notes: string;
from_project_flock: {
id: number;
name: string;
flock_name: string;
category: 'GROWING' | 'LAYING';
};
flock_destination: {
to_project_flock: {
id: number;
name: string;
flock_name: string;
category: 'GROWING' | 'LAYING';
};
quantity: number;
kandangs: {
kandang: Kandang;
quantity: number;
pending_usage_qty: number | null;
usage_qty: number | null;
sources: {
source_project_flock_kandang: {
id: number;
kandang: Omit<BaseKandang, 'status' | 'location' | 'pic'>;
};
qty: number;
product_warehouse: {
product: {
id: number;
name: string;
};
warehouse: {
id: number;
name: string;
type: WarehouseType;
};
};
}[];
reason: string;
targets: {
target_project_flock_kandang: {
id: number;
kandang: Omit<BaseKandang, 'status' | 'location' | 'pic'>;
};
qty: number;
product_warehouse: {
product: {
id: number;
name: string;
};
warehouse: {
id: number;
name: string;
type: WarehouseType;
};
};
}[];
created_by: number;
created_user: CreatedUser;
created_at: string;
approval: BaseApproval;
};
export type TransferToLaying = BaseMetadata & BaseTransferToLaying;
export type CreateTransferToLayingPayload = {
transfer_date: string;
flock_source_id: number;
flock_destination_id: number;
source_project_flock_id: number;
target_project_flock_id: number;
totalQuantity: number;
kandangs: {
kandang_id: number;
source_kandangs: {
project_flock_kandang_id: number;
quantity: number;
}[];
target_kandangs: {
project_flock_kandang_id: number;
quantity: number;
}[];
reason: string;