mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-22 14:25:47 +00:00
refactor(FE-316): Update uniformity payload/fields and file handling
This commit is contained in:
+68
-9
@@ -1,29 +1,88 @@
|
||||
import { BaseMetadata } from '@/types/api/api-general';
|
||||
import { Location } from '@/types/api/location/location';
|
||||
import { ProjectFlock } from '@/types/api/project-flock/project-flock';
|
||||
import { Kandang } from '@/types/api/kandang/kandang';
|
||||
import { BaseMetadata } from '@/types/common/base-metadata';
|
||||
import { BaseApproval } from '@/types/api/approval/approval';
|
||||
|
||||
// ==================== GET ALL RESPONSE ====================
|
||||
export type Uniformity = BaseMetadata & {
|
||||
id: number;
|
||||
location: Location;
|
||||
project_flock_kandang_id: number;
|
||||
location: Location;
|
||||
project_flock: ProjectFlock;
|
||||
location_name: string;
|
||||
flock_name: string;
|
||||
kandang: Kandang;
|
||||
kandang_name: string;
|
||||
applied_at: string;
|
||||
week: number;
|
||||
status: 'CREATED' | 'APPROVED' | 'REJECTED';
|
||||
uniformity: number;
|
||||
date?: string;
|
||||
cv: number;
|
||||
chick_qty_of_weight: number;
|
||||
uniform_qty: number;
|
||||
mean_up: number;
|
||||
mean_down: number;
|
||||
created_at: string;
|
||||
created_by: number;
|
||||
latest_approval?: BaseApproval;
|
||||
};
|
||||
|
||||
// ==================== GET ONE RESPONSE ====================
|
||||
export type UniformityInfoUmum = {
|
||||
tanggal: string;
|
||||
lokasi_farm: string;
|
||||
project_flock: string;
|
||||
kandang: string;
|
||||
file_name: string;
|
||||
};
|
||||
|
||||
export type UniformitySampling = {
|
||||
chick_qty_of_weight: number;
|
||||
mean_weight: number;
|
||||
mean_down: number;
|
||||
mean_up: number;
|
||||
};
|
||||
|
||||
export type UniformityResult = {
|
||||
uniform_qty: number;
|
||||
outside_qty: number;
|
||||
uniformity: number;
|
||||
cv: number;
|
||||
};
|
||||
|
||||
export type UniformityDetailItem = {
|
||||
id: number;
|
||||
weight: number;
|
||||
range: 'Ideal' | 'Outside';
|
||||
};
|
||||
|
||||
export type UniformityDetail = BaseMetadata & {
|
||||
id: number;
|
||||
info_umum: UniformityInfoUmum;
|
||||
sampling: UniformitySampling;
|
||||
result: UniformityResult;
|
||||
uniformity_details: UniformityDetailItem[];
|
||||
};
|
||||
|
||||
// ==================== VERIFY RESPONSE ====================
|
||||
export type VerifyUniformityResponse = {
|
||||
sampling: UniformitySampling;
|
||||
result: UniformityResult;
|
||||
uniformity_details: UniformityDetailItem[];
|
||||
};
|
||||
|
||||
// ==================== PAYLOADS ====================
|
||||
export type CreateUniformityPayload = {
|
||||
date: string;
|
||||
project_flock_kandang_id: number;
|
||||
files: File;
|
||||
file: File;
|
||||
week: number;
|
||||
};
|
||||
|
||||
export type VerifyUniformityPayload = {
|
||||
date: string;
|
||||
project_flock_kandang_id: number;
|
||||
files: File;
|
||||
};
|
||||
|
||||
export type VerifyUniformityResponse = {
|
||||
body_weights: number[];
|
||||
file: File;
|
||||
week: number;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user