diff --git a/src/types/api/daily-checklist/daily-checklist.d.ts b/src/types/api/daily-checklist/daily-checklist.d.ts new file mode 100644 index 00000000..9f01ae1f --- /dev/null +++ b/src/types/api/daily-checklist/daily-checklist.d.ts @@ -0,0 +1,56 @@ +import { BaseMetadata } from '@/types/api/api-general'; +import { BaseKandang } from '@/types/api/master-data/kandang'; +import { Phase } from '@/types/api/daily-checklist/phase'; +import { PhaseActivity } from '@/types/api/daily-checklist/phase-activity'; + +export type BaseDailyChecklist = { + id: number; + name: string; + status: string; + category: string; + date: string; + kandang: Pick; + total_phase: number; + total_activity: number; + progress: number; +}; + +export type DailyChecklist = BaseMetadata & BaseDailyChecklist; + +export type DetailDailyChecklist = BaseDailyChecklist & { + reject_reason: string | null; + phases: { + id: number; + phase_id: number; + phase: Phase; + }[]; + tasks: { + id: number; + checklist_id: number; + phase_id: number; + phase_activity_id: number; + time_type: string; + notes: string | null; + phase: Phase; + phase_activity: PhaseActivity; + assignments: { + employee: { + id: number; + name: string; + }; + checked: boolean; + note: string | null; + }[]; + }[]; + assigned_employees: { + id: number; + name: string; + }[]; +}; + +export type CreateDailyChecklistPayload = { + date: string; + kandang_id: number; + category: string; + status: string; +};