mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-22 06:15:47 +00:00
feat(FE-137): integrate API for daily recording with enhanced data structure and validation
This commit is contained in:
+39
-47
@@ -1,60 +1,52 @@
|
||||
import { BaseMetadata } from '@/types/api/api-general';
|
||||
import { Location } from '@/types/api/master-data/location';
|
||||
import { Kandang } from '@/types/api/master-data/kandang';
|
||||
import { Flock } from '@/types/api/master-data/flock';
|
||||
import { BaseMetadata, User } from '@/types/api/api-general';
|
||||
|
||||
export type ProductionMetrics = {
|
||||
total_depletion: number;
|
||||
cum_depletion_rate: number;
|
||||
daily_gain: number;
|
||||
avg_daily_gain: number;
|
||||
cum_intake: number;
|
||||
fcr_value: number;
|
||||
total_chick: number;
|
||||
daily_depletion_rate: number;
|
||||
cum_depletion: number;
|
||||
};
|
||||
|
||||
export type BaseRecording = {
|
||||
id: number;
|
||||
flock: Flock;
|
||||
recording_date: string;
|
||||
location: Location;
|
||||
coop: Kandang;
|
||||
feed_data: {
|
||||
feed_name: string;
|
||||
feed_qty: number;
|
||||
feed_stock: number;
|
||||
}[];
|
||||
body_weight: {
|
||||
chicken_weight: number;
|
||||
chicken_count: number;
|
||||
average_chicken_weight: number;
|
||||
}[];
|
||||
vaccination: {
|
||||
vaccine_name: string;
|
||||
total_stock: number;
|
||||
used_stock: number;
|
||||
}[];
|
||||
mortality: {
|
||||
condition: string;
|
||||
count: number;
|
||||
}[];
|
||||
};
|
||||
project_flock_kandang_id: number;
|
||||
record_datetime: string;
|
||||
record_date: string;
|
||||
status: number;
|
||||
ontime: boolean;
|
||||
day: number;
|
||||
created_user: User;
|
||||
} & ProductionMetrics;
|
||||
|
||||
export type Recording = BaseMetadata & BaseRecording;
|
||||
|
||||
export type CreateRecordingPayload = {
|
||||
flock_id: number;
|
||||
recording_date: string;
|
||||
location_id: number;
|
||||
coop_id: number;
|
||||
feed_data: {
|
||||
feed_id: string;
|
||||
feed_qty: number;
|
||||
feed_stock: number;
|
||||
project_flock_kandang_id: number;
|
||||
record_datetime: string;
|
||||
status?: number;
|
||||
ontime?: boolean;
|
||||
body_weights?: {
|
||||
weight: number;
|
||||
qty: number;
|
||||
notes?: string;
|
||||
}[];
|
||||
body_weight: {
|
||||
chicken_weight: number;
|
||||
chicken_count: number;
|
||||
average_chicken_weight: number;
|
||||
stocks?: {
|
||||
product_warehouse_id: number;
|
||||
increase?: number;
|
||||
decrease?: number;
|
||||
usage_amount?: number;
|
||||
notes?: string;
|
||||
}[];
|
||||
vaccination: {
|
||||
vaccine_id: string;
|
||||
total_stock: number;
|
||||
used_stock: number;
|
||||
}[];
|
||||
mortality: {
|
||||
depletions?: {
|
||||
product_warehouse_id: number;
|
||||
condition: string;
|
||||
count: number;
|
||||
total: number;
|
||||
notes?: string;
|
||||
}[];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user