diff --git a/src/components/pages/production/recording/RecordingTable.tsx b/src/components/pages/production/recording/RecordingTable.tsx index cf95f3f5..f1dffcea 100644 --- a/src/components/pages/production/recording/RecordingTable.tsx +++ b/src/components/pages/production/recording/RecordingTable.tsx @@ -22,90 +22,7 @@ const dummyRecordings: Recording[] = [ id: 1, flock: { id: 1, - period: 1, - flock: { - id: 1, - name: 'Flock A', - created_at: '2024-01-01', - updated_at: '2024-01-01', - created_user: { - id: 1, - id_user: 1, - email: 'admin@example.com', - name: 'Admin', - }, - }, - area: { - id: 1, - name: 'Area 1', - created_at: '2024-01-01', - updated_at: '2024-01-01', - created_user: { - id: 1, - id_user: 1, - email: 'admin@example.com', - name: 'Admin', - }, - }, - fcr: { - id: 1, - name: 'FCR 1.5', - created_at: '2024-01-01', - updated_at: '2024-01-01', - created_user: { - id: 1, - id_user: 1, - email: 'admin@example.com', - name: 'Admin', - }, - }, - location: { - id: 1, - name: 'Location 1', - address: 'Address 1', - area: { - id: 1, - name: 'Area 1', - }, - created_at: '2024-01-01', - updated_at: '2024-01-01', - created_user: { - id: 1, - id_user: 1, - email: 'admin@example.com', - name: 'Admin', - }, - }, - kandangs: [ - { - id: 1, - name: 'Kandang 1', - status: 'ACTIVE', - location: { - id: 1, - name: 'Location 1', - address: 'Address 1', - area: { - id: 1, - name: 'Area 1', - }, - }, - pic: { - id: 1, - id_user: 1, - email: 'pic@example.com', - name: 'PIC User', - }, - created_at: '2024-01-01', - updated_at: '2024-01-01', - created_user: { - id: 1, - id_user: 1, - email: 'admin@example.com', - name: 'Admin', - }, - }, - ], + name: 'Flock Recording 1', created_at: '2024-01-01', updated_at: '2024-01-01', created_user: { @@ -290,9 +207,7 @@ const RecordingTable = () => { const paginatedData = useMemo(() => { const filteredData = dummyRecordings.filter( (recording) => - recording.flock.flock.name - .toLowerCase() - .includes(search.toLowerCase()) || + recording.flock.name.toLowerCase().includes(search.toLowerCase()) || recording.location.name.toLowerCase().includes(search.toLowerCase()) || recording.coop.name.toLowerCase().includes(search.toLowerCase()) ); diff --git a/src/types/api/production/project-flock.d.ts b/src/types/api/production/project-flock.d.ts index 306c32f1..7561e9ca 100644 --- a/src/types/api/production/project-flock.d.ts +++ b/src/types/api/production/project-flock.d.ts @@ -1,35 +1,29 @@ -import { Area } from "@/types/api/master-data/area"; -import { Fcr } from "@/types/api/master-data/fcr"; -import { Flock } from "@/types/api/master-data/flock"; -import { Kandang } from "@/types/api/master-data/kandang"; -import { Location } from "@/types/api/master-data/location"; -import { BaseMetadata } from "@/types/api/api-general"; +import { Area } from '@/types/api/master-data/area'; +import { Fcr } from '@/types/api/master-data/fcr'; +import { Flock } from '@/types/api/master-data/flock'; +import { Kandang } from '@/types/api/master-data/kandang'; +import { Location } from '@/types/api/master-data/location'; +import { BaseMetadata } from '@/types/api/api-general'; export type BaseProjectFlock = { id: number; name: string; status: string; flock: Flock; - flock_id: number; area: Area; - area_id: number; category: string; fcr: Fcr; - fcr_id: number; location: Location; - location_id: number; period: number; - kandang_ids: number[]; kandangs: Kandang[]; -} +}; export type PeriodFlock = { flock: Flock; next_period: number; -} +}; - -export type ProjectFlock = BaseMetadata & BaseProjectFlock +export type ProjectFlock = BaseMetadata & BaseProjectFlock; export type CreateProjectFlockPayload = { flock_id: number; @@ -39,6 +33,6 @@ export type CreateProjectFlockPayload = { location_id: number; period: number; kandang_ids: number[]; -} +}; -export type UpdateProjectFlockPayload = CreateProjectFlockPayload; \ No newline at end of file +export type UpdateProjectFlockPayload = CreateProjectFlockPayload; diff --git a/src/types/api/production/recording.d.ts b/src/types/api/production/recording.d.ts index d4bf90ee..6fac0bc8 100644 --- a/src/types/api/production/recording.d.ts +++ b/src/types/api/production/recording.d.ts @@ -1,11 +1,11 @@ import { BaseMetadata } from '@/types/api/api-general'; -import { ProjectFlock } from '@/types/api/production/project-flock'; import { Location } from '@/types/api/master-data/location'; import { Kandang } from '@/types/api/master-data/kandang'; +import { Flock } from '@/types/api/master-data/flock'; export type BaseRecording = { id: number; - flock: ProjectFlock; + flock: Flock; recording_date: string; location: Location; coop: Kandang;