diff --git a/src/dummy/closing.dummy.ts b/src/dummy/closing.dummy.ts deleted file mode 100644 index 3b9a9a7b..00000000 --- a/src/dummy/closing.dummy.ts +++ /dev/null @@ -1,1175 +0,0 @@ -/** - * Dummy Data untuk Closing API - * - * File ini berisi dummy data untuk testing API Closing sebelum backend siap. - * - * Struktur data mengikuti tipe yang didefinisikan di @/types/api/closing.d.ts - * - * @example - * // 1. Menggunakan getAllFetcher dengan SWR: - * import useSWR from 'swr'; - * import { ClosingApi } from '@/services/api/closing'; - * - * const { data, error, isLoading } = useSWR( - * '/closings', - * ClosingApi.getAllFetcher.bind(ClosingApi) - * ); - * - * if (data?.status === 'success') { - * console.log(data.data); // Array of Closing objects - * } - * - * @example - * // 2. Menggunakan getSingle: - * import { ClosingApi } from '@/services/api/closing'; - * - * const response = await ClosingApi.getSingle(1); - * if (response?.status === 'success') { - * console.log(response.data); // Single Closing object - * } else if (response?.status === 'error') { - * console.error(response.message); // Error message - * } - * - * @example - * // 3. Menggunakan getGeneralInfo dengan SWR: - * import useSWR from 'swr'; - * import { ClosingApi } from '@/services/api/closing'; - * - * const closingId = 1; - * const { data, error, isLoading } = useSWR( - * closingId, - * (id: number) => ClosingApi.getGeneralInfo(id) - * ); - * - * if (data?.status === 'success') { - * console.log(data.data); // ClosingGeneralInformation object - * } - * - * @example - * // 4. Menggunakan getAllIncomingSapronakFetcher dengan SWR: - * import useSWR from 'swr'; - * import { ClosingApi } from '@/services/api/closing'; - * - * const { data, error, isLoading } = useSWR( - * `${ClosingApi.basePath}/1/sapronak/incoming`, - * ClosingApi.getAllIncomingSapronakFetcher.bind(ClosingApi) - * ); - * - * if (data?.status === 'success') { - * console.log(data.data); // Array of ClosingIncomingSapronak - * } - * - * @example - * // 5. Menggunakan getAllOutgoingSapronakFetcher dengan SWR: - * import useSWR from 'swr'; - * import { ClosingApi } from '@/services/api/closing'; - * - * const { data, error, isLoading } = useSWR( - * `${ClosingApi.basePath}/1/sapronak/outgoing`, - * ClosingApi.getAllOutgoingSapronakFetcher.bind(ClosingApi) - * ); - * - * if (data?.status === 'success') { - * console.log(data.data); // Array of ClosingOutgoingSapronak - * } - * - * @see {@link /home/sweetpotet/Documents/projects/lti-web-client/src/types/api/closing.d.ts} - */ - -import { format } from 'date-fns'; -import { - Closing, - ClosingGeneralInformation, - ClosingIncomingSapronak, - ClosingOutgoingSapronak, - ClosingOverhead, - ClosingProductionData, - ClosingSapronakCalculation, -} from '@/types/api/closing'; -import { CreatedUser, BaseApiResponse } from '@/types/api/api-general'; - -// Waktu saat ini untuk created_at/updated_at -const now = format(new Date(), 'yyyy-MM-dd HH:mm:ss'); -const today = format(new Date(), 'yyyy-MM-dd'); -const yesterday = format( - new Date().setDate(new Date().getDate() - 1), - 'yyyy-MM-dd' -); -const lastWeek = format( - new Date().setDate(new Date().getDate() - 7), - 'yyyy-MM-dd' -); -const lastMonth = format( - new Date().setMonth(new Date().getMonth() - 1), - 'yyyy-MM-dd' -); - -// ====================== -// 👤 Created User -// ====================== -export const createdUser: CreatedUser = { - id: 1, - id_user: 1, - email: 'admin@example.com', - name: 'Admin Utama', -}; - -// ====================== -// 📊 Closing Dummy Data -// ====================== -export const dummyClosings: Closing[] = [ - // 1. Closing dengan status Pengajuan - GROWING - { - id: 1, - location_id: 1, - location_name: 'Farm Sukajadi', - project_category: 'GROWING', - period: 1, - closing_date: today, - shed_label: 'Kandang A1, A2, A3', - shed_count: 3, - sales_paid_amount: 150000000, - sales_remaining_amount: 50000000, - sales_payment_status: 'Sebagian Lunas', - project_status: 'Pengajuan', - created_user: createdUser, - created_at: now, - updated_at: now, - }, - - // 2. Closing dengan status Aktif - LAYING - { - id: 2, - location_id: 2, - location_name: 'Farm Cihampelas', - project_category: 'LAYING', - period: 2, - closing_date: yesterday, - shed_label: 'Kandang B1, B2', - shed_count: 2, - sales_paid_amount: 200000000, - sales_remaining_amount: 0, - sales_payment_status: 'Lunas', - project_status: 'Aktif', - created_user: createdUser, - created_at: lastWeek, - updated_at: yesterday, - }, - - // 3. Closing dengan status Selesai - GROWING - { - id: 3, - location_id: 3, - location_name: 'Farm Pasteur', - project_category: 'GROWING', - period: 3, - closing_date: lastWeek, - shed_label: 'Kandang C1, C2, C3, C4', - shed_count: 4, - sales_paid_amount: 300000000, - sales_remaining_amount: 25000000, - sales_payment_status: 'Sebagian Lunas', - project_status: 'Selesai', - created_user: createdUser, - created_at: lastMonth, - updated_at: lastWeek, - }, - - // 4. Closing dengan status Aktif - LAYING - { - id: 4, - location_id: 4, - location_name: 'Farm Setiabudi', - project_category: 'LAYING', - period: 1, - closing_date: today, - shed_label: 'Kandang D1', - shed_count: 1, - sales_paid_amount: 75000000, - sales_remaining_amount: 75000000, - sales_payment_status: 'Belum Lunas', - project_status: 'Aktif', - created_user: createdUser, - created_at: yesterday, - updated_at: now, - }, - - // 5. Closing dengan status Selesai - GROWING - { - id: 5, - location_id: 5, - location_name: 'Farm Dago', - project_category: 'GROWING', - period: 4, - closing_date: lastMonth, - shed_label: 'Kandang E1, E2, E3, E4, E5', - shed_count: 5, - sales_paid_amount: 500000000, - sales_remaining_amount: 0, - sales_payment_status: 'Lunas', - project_status: 'Selesai', - created_user: createdUser, - created_at: lastMonth, - updated_at: lastMonth, - }, - - // 6. Closing dengan status Pengajuan - LAYING - { - id: 6, - location_id: 6, - location_name: 'Farm Lembang', - project_category: 'LAYING', - period: 2, - closing_date: undefined, // Belum ada tanggal closing - shed_label: 'Kandang F1, F2', - shed_count: 2, - sales_paid_amount: 0, - sales_remaining_amount: 180000000, - sales_payment_status: 'Belum Lunas', - project_status: 'Pengajuan', - created_user: createdUser, - created_at: now, - updated_at: now, - }, - - // 7. Closing dengan status Aktif - GROWING - { - id: 7, - location_id: 7, - location_name: 'Farm Ciwidey', - project_category: 'GROWING', - period: 1, - closing_date: yesterday, - shed_label: 'Kandang G1, G2, G3', - shed_count: 3, - sales_paid_amount: 120000000, - sales_remaining_amount: 30000000, - sales_payment_status: 'Sebagian Lunas', - project_status: 'Aktif', - created_user: createdUser, - created_at: lastWeek, - updated_at: yesterday, - }, - - // 8. Closing dengan status Selesai - LAYING - { - id: 8, - location_id: 8, - location_name: 'Farm Bandung Timur', - project_category: 'LAYING', - period: 3, - closing_date: lastMonth, - shed_label: 'Kandang H1, H2, H3, H4, H5, H6', - shed_count: 6, - sales_paid_amount: 600000000, - sales_remaining_amount: 0, - sales_payment_status: 'Lunas', - project_status: 'Selesai', - created_user: createdUser, - created_at: lastMonth, - updated_at: lastMonth, - }, -]; - -// ====================== -// 📊 Closing General Information Dummy Data -// ====================== -export const dummyClosingGeneralInformations: ClosingGeneralInformation[] = [ - // 1. General Info - GROWING - Pengajuan - { - id: 1, - location_id: 1, - location_name: 'Farm Sukajadi', - project_category: 'GROWING', - period: 1, - closing_date: today, - shed_label: 'Kandang A1, A2, A3', - shed_count: 3, - sales_paid_amount: 150000000, - sales_remaining_amount: 50000000, - sales_payment_status: 'Sebagian Lunas', - project_status: 'Pengajuan', - flock_id: 101, - project_type: 'GROWING', - population: 15000, - active_house_count: 3, - closing_status: 'Draft', - created_user: createdUser, - created_at: now, - updated_at: now, - }, - - // 2. General Info - LAYING - Aktif - { - id: 2, - location_id: 2, - location_name: 'Farm Cihampelas', - project_category: 'LAYING', - period: 2, - closing_date: yesterday, - shed_label: 'Kandang B1, B2', - shed_count: 2, - sales_paid_amount: 200000000, - sales_remaining_amount: 0, - sales_payment_status: 'Lunas', - project_status: 'Aktif', - flock_id: 102, - project_type: 'LAYING', - population: 10000, - active_house_count: 2, - closing_status: 'In Progress', - created_user: createdUser, - created_at: lastWeek, - updated_at: yesterday, - }, - - // 3. General Info - GROWING - Selesai - { - id: 3, - location_id: 3, - location_name: 'Farm Pasteur', - project_category: 'GROWING', - period: 3, - closing_date: lastWeek, - shed_label: 'Kandang C1, C2, C3, C4', - shed_count: 4, - sales_paid_amount: 300000000, - sales_remaining_amount: 25000000, - sales_payment_status: 'Sebagian Lunas', - project_status: 'Selesai', - flock_id: 103, - project_type: 'GROWING', - population: 20000, - active_house_count: 4, - closing_status: 'Completed', - created_user: createdUser, - created_at: lastMonth, - updated_at: lastWeek, - }, - - // 4. General Info - LAYING - Aktif - { - id: 4, - location_id: 4, - location_name: 'Farm Setiabudi', - project_category: 'LAYING', - period: 1, - closing_date: today, - shed_label: 'Kandang D1', - shed_count: 1, - sales_paid_amount: 75000000, - sales_remaining_amount: 75000000, - sales_payment_status: 'Belum Lunas', - project_status: 'Aktif', - flock_id: 104, - project_type: 'LAYING', - population: 5000, - active_house_count: 1, - closing_status: 'In Progress', - created_user: createdUser, - created_at: yesterday, - updated_at: now, - }, - - // 5. General Info - GROWING - Selesai - { - id: 5, - location_id: 5, - location_name: 'Farm Dago', - project_category: 'GROWING', - period: 4, - closing_date: lastMonth, - shed_label: 'Kandang E1, E2, E3, E4, E5', - shed_count: 5, - sales_paid_amount: 500000000, - sales_remaining_amount: 0, - sales_payment_status: 'Lunas', - project_status: 'Selesai', - flock_id: 105, - project_type: 'GROWING', - population: 25000, - active_house_count: 5, - closing_status: 'Completed', - created_user: createdUser, - created_at: lastMonth, - updated_at: lastMonth, - }, - - // 6. General Info - LAYING - Pengajuan - { - id: 6, - location_id: 6, - location_name: 'Farm Lembang', - project_category: 'LAYING', - period: 2, - closing_date: undefined, - shed_label: 'Kandang F1, F2', - shed_count: 2, - sales_paid_amount: 0, - sales_remaining_amount: 180000000, - sales_payment_status: 'Belum Lunas', - project_status: 'Pengajuan', - flock_id: 106, - project_type: 'LAYING', - population: 12000, - active_house_count: 2, - closing_status: 'Draft', - created_user: createdUser, - created_at: now, - updated_at: now, - }, - - // 7. General Info - GROWING - Aktif - { - id: 7, - location_id: 7, - location_name: 'Farm Ciwidey', - project_category: 'GROWING', - period: 1, - closing_date: yesterday, - shed_label: 'Kandang G1, G2, G3', - shed_count: 3, - sales_paid_amount: 120000000, - sales_remaining_amount: 30000000, - sales_payment_status: 'Sebagian Lunas', - project_status: 'Aktif', - flock_id: 107, - project_type: 'GROWING', - population: 18000, - active_house_count: 3, - closing_status: 'In Progress', - created_user: createdUser, - created_at: lastWeek, - updated_at: yesterday, - }, - - // 8. General Info - LAYING - Selesai - { - id: 8, - location_id: 8, - location_name: 'Farm Bandung Timur', - project_category: 'LAYING', - period: 3, - closing_date: lastMonth, - shed_label: 'Kandang H1, H2, H3, H4, H5, H6', - shed_count: 6, - sales_paid_amount: 600000000, - sales_remaining_amount: 0, - sales_payment_status: 'Lunas', - project_status: 'Selesai', - flock_id: 108, - project_type: 'LAYING', - population: 30000, - active_house_count: 6, - closing_status: 'Completed', - created_user: createdUser, - created_at: lastMonth, - updated_at: lastMonth, - }, -]; - -// ====================== -// 📦 Incoming Sapronak Dummy Data -// ====================== -export const dummyIncomingSapronaks: ClosingIncomingSapronak[] = [ - { - id: 1, - date: today, - reference_number: 'IN-2025-001', - transaction_type: 'Pembelian', - product_name: 'DOC Broiler Cobb 500', - product_category: 'DOC', - product_sub_category: 'DOC Broiler', - source_warehouse: 'Gudang Pusat', - destination_warehouse: 'Kandang A1', - quantity: 5000, - unit: 'Ekor', - formatted_quantity: '5,000 Ekor', - notes: 'DOC berkualitas tinggi dari supplier terpercaya', - }, - { - id: 2, - date: yesterday, - reference_number: 'IN-2025-002', - transaction_type: 'Transfer Masuk', - product_name: 'Pakan Starter BR-1', - product_category: 'Pakan', - product_sub_category: 'Starter', - source_warehouse: 'Gudang Area Bandung', - destination_warehouse: 'Kandang B1', - quantity: 100, - unit: 'Sak', - formatted_quantity: '100 Sak (5,000 Kg)', - notes: 'Pakan starter untuk periode awal', - }, - { - id: 3, - date: lastWeek, - reference_number: 'IN-2025-003', - transaction_type: 'Pembelian', - product_name: 'Vitamin B Complex', - product_category: 'OVK', - product_sub_category: 'Vitamin', - source_warehouse: 'Supplier Medion', - destination_warehouse: 'Gudang Farmasi', - quantity: 50, - unit: 'Botol', - formatted_quantity: '50 Botol', - notes: 'Vitamin untuk meningkatkan daya tahan tubuh', - }, - { - id: 4, - date: today, - reference_number: 'IN-2025-004', - transaction_type: 'Pembelian', - product_name: 'Pakan Finisher BR-2', - product_category: 'Pakan', - product_sub_category: 'Finisher', - source_warehouse: 'Gudang Pusat', - destination_warehouse: 'Kandang C1', - quantity: 200, - unit: 'Sak', - formatted_quantity: '200 Sak (10,000 Kg)', - notes: 'Pakan finisher untuk periode akhir', - }, - { - id: 5, - date: yesterday, - reference_number: 'IN-2025-005', - transaction_type: 'Transfer Masuk', - product_name: 'Antibiotik Enrofloxacin', - product_category: 'OVK', - product_sub_category: 'Obat', - source_warehouse: 'Gudang Area Jakarta', - destination_warehouse: 'Gudang Farmasi', - quantity: 30, - unit: 'Box', - formatted_quantity: '30 Box', - notes: 'Antibiotik untuk pencegahan penyakit', - }, -]; - -// ====================== -// 📤 Outgoing Sapronak Dummy Data -// ====================== -export const dummyOutgoingSapronaks: ClosingOutgoingSapronak[] = [ - { - id: 1, - date: today, - reference_number: 'OUT-2025-001', - transaction_type: 'Pemakaian', - product_name: 'Pakan Starter BR-1', - product_category: 'Pakan', - product_sub_category: 'Starter', - source_warehouse: 'Kandang A1', - destination_warehouse: 'Konsumsi Kandang A1', - quantity: 50, - unit: 'Sak', - formatted_quantity: '50 Sak (2,500 Kg)', - notes: 'Pemakaian pakan harian periode starter', - }, - { - id: 2, - date: yesterday, - reference_number: 'OUT-2025-002', - transaction_type: 'Transfer Keluar', - product_name: 'DOC Broiler Cobb 500', - product_category: 'DOC', - product_sub_category: 'DOC Broiler', - source_warehouse: 'Kandang B1', - destination_warehouse: 'Kandang B2', - quantity: 1000, - unit: 'Ekor', - formatted_quantity: '1,000 Ekor', - notes: 'Transfer DOC ke kandang baru', - }, - { - id: 3, - date: lastWeek, - reference_number: 'OUT-2025-003', - transaction_type: 'Pemakaian', - product_name: 'Vitamin B Complex', - product_category: 'OVK', - product_sub_category: 'Vitamin', - source_warehouse: 'Gudang Farmasi', - destination_warehouse: 'Konsumsi Kandang C1', - quantity: 10, - unit: 'Botol', - formatted_quantity: '10 Botol', - notes: 'Pemberian vitamin untuk meningkatkan kesehatan', - }, - { - id: 4, - date: today, - reference_number: 'OUT-2025-004', - transaction_type: 'Pemakaian', - product_name: 'Pakan Finisher BR-2', - product_category: 'Pakan', - product_sub_category: 'Finisher', - source_warehouse: 'Kandang C1', - destination_warehouse: 'Konsumsi Kandang C1', - quantity: 80, - unit: 'Sak', - formatted_quantity: '80 Sak (4,000 Kg)', - notes: 'Pemakaian pakan harian periode finisher', - }, - { - id: 5, - date: yesterday, - reference_number: 'OUT-2025-005', - transaction_type: 'Pemakaian', - product_name: 'Antibiotik Enrofloxacin', - product_category: 'OVK', - product_sub_category: 'Obat', - source_warehouse: 'Gudang Farmasi', - destination_warehouse: 'Konsumsi Kandang D1', - quantity: 5, - unit: 'Box', - formatted_quantity: '5 Box', - notes: 'Pengobatan untuk ayam yang sakit', - }, - { - id: 6, - date: lastWeek, - reference_number: 'OUT-2025-006', - transaction_type: 'Transfer Keluar', - product_name: 'Pakan Starter BR-1', - product_category: 'Pakan', - product_sub_category: 'Starter', - source_warehouse: 'Kandang E1', - destination_warehouse: 'Kandang E2', - quantity: 30, - unit: 'Sak', - formatted_quantity: '30 Sak (1,500 Kg)', - notes: 'Transfer pakan antar kandang', - }, -]; - -// ====================== -// 📊 Perhitungan Sapronak Dummy Data -// ====================== -export const dummySapronakCalculation: ClosingSapronakCalculation = { - // DOC Broiler Calculation - doc_broiler: { - rows: [ - { - id: 1, - tanggal: today, - no_referensi: 'IN-2025-001', - qty_masuk: 5000, - qty_keluar: 0, - qty_pakai: 0, - uraian: 'DOC Broiler Cobb 500', - kategori_produk: 'DOC Broiler', - harga_beli_per_qty: 8000, - total_harga: 40000000, - keterangan: 'Pembelian DOC dari supplier', - }, - { - id: 2, - tanggal: yesterday, - no_referensi: 'OUT-2025-002', - qty_masuk: 0, - qty_keluar: 1000, - qty_pakai: 0, - uraian: 'DOC Broiler Cobb 500', - kategori_produk: 'DOC Broiler', - harga_beli_per_qty: 8000, - total_harga: 8000000, - keterangan: 'Transfer DOC ke kandang lain', - }, - { - id: 3, - tanggal: lastWeek, - no_referensi: 'USE-2025-001', - qty_masuk: 0, - qty_keluar: 0, - qty_pakai: 50, - uraian: 'DOC Broiler Cobb 500', - kategori_produk: 'DOC Broiler', - harga_beli_per_qty: 8000, - total_harga: 400000, - keterangan: 'Mortalitas DOC', - }, - ], - total: { - label: 'Total DOC Broiler', - qty_masuk: 5000, - qty_keluar: 1000, - qty_pakai: 50, - harga_beli_per_qty: 8000, - total_harga: 48400000, - }, - }, - - // OVK Calculation - ovk: { - rows: [ - { - id: 1, - tanggal: today, - no_referensi: 'IN-2025-003', - qty_masuk: 50, - qty_keluar: 0, - qty_pakai: 0, - uraian: 'Vitamin B Complex', - kategori_produk: 'Vitamin', - harga_beli_per_qty: 150000, - total_harga: 7500000, - keterangan: 'Pembelian vitamin', - }, - { - id: 2, - tanggal: yesterday, - no_referensi: 'IN-2025-005', - qty_masuk: 30, - qty_keluar: 0, - qty_pakai: 0, - uraian: 'Antibiotik Enrofloxacin', - kategori_produk: 'Obat', - harga_beli_per_qty: 250000, - total_harga: 7500000, - keterangan: 'Pembelian antibiotik', - }, - { - id: 3, - tanggal: lastWeek, - no_referensi: 'OUT-2025-003', - qty_masuk: 0, - qty_keluar: 0, - qty_pakai: 10, - uraian: 'Vitamin B Complex', - kategori_produk: 'Vitamin', - harga_beli_per_qty: 150000, - total_harga: 1500000, - keterangan: 'Pemakaian vitamin', - }, - { - id: 4, - tanggal: yesterday, - no_referensi: 'OUT-2025-005', - qty_masuk: 0, - qty_keluar: 0, - qty_pakai: 5, - uraian: 'Antibiotik Enrofloxacin', - kategori_produk: 'Obat', - harga_beli_per_qty: 250000, - total_harga: 1250000, - keterangan: 'Pemakaian antibiotik', - }, - ], - total: { - label: 'Total OVK', - qty_masuk: 80, - qty_keluar: 0, - qty_pakai: 15, - harga_beli_per_qty: 200000, - total_harga: 17750000, - }, - }, - - // Pakan Calculation - pakan: { - rows: [ - { - id: 1, - tanggal: yesterday, - no_referensi: 'IN-2025-002', - qty_masuk: 100, - qty_keluar: 0, - qty_pakai: 0, - uraian: 'Pakan Starter BR-1', - kategori_produk: 'Starter', - harga_beli_per_qty: 450000, - total_harga: 45000000, - keterangan: 'Pembelian pakan starter', - }, - { - id: 2, - tanggal: today, - no_referensi: 'IN-2025-004', - qty_masuk: 200, - qty_keluar: 0, - qty_pakai: 0, - uraian: 'Pakan Finisher BR-2', - kategori_produk: 'Finisher', - harga_beli_per_qty: 480000, - total_harga: 96000000, - keterangan: 'Pembelian pakan finisher', - }, - { - id: 3, - tanggal: today, - no_referensi: 'OUT-2025-001', - qty_masuk: 0, - qty_keluar: 0, - qty_pakai: 50, - uraian: 'Pakan Starter BR-1', - kategori_produk: 'Starter', - harga_beli_per_qty: 450000, - total_harga: 22500000, - keterangan: 'Pemakaian pakan starter', - }, - { - id: 4, - tanggal: today, - no_referensi: 'OUT-2025-004', - qty_masuk: 0, - qty_keluar: 0, - qty_pakai: 80, - uraian: 'Pakan Finisher BR-2', - kategori_produk: 'Finisher', - harga_beli_per_qty: 480000, - total_harga: 38400000, - keterangan: 'Pemakaian pakan finisher', - }, - { - id: 5, - tanggal: lastWeek, - no_referensi: 'OUT-2025-006', - qty_masuk: 0, - qty_keluar: 30, - qty_pakai: 0, - uraian: 'Pakan Starter BR-1', - kategori_produk: 'Starter', - harga_beli_per_qty: 450000, - total_harga: 13500000, - keterangan: 'Transfer pakan ke kandang lain', - }, - ], - total: { - label: 'Total Pakan', - qty_masuk: 300, - qty_keluar: 30, - qty_pakai: 130, - harga_beli_per_qty: 465000, - total_harga: 215400000, - }, - }, -}; - -// ====================== -// 💰 Overhead Dummy Data -// ====================== -export const dummyOverhead: ClosingOverhead = { - overheads: [ - { - item_name: 'Expedisi DOC', - uom_name: 'Ekor', - budget_quantity: 500, - budget_unit_price: 8000, - budget_total_amount: 4000000, - actual_date: '', - actual_quantity: 0, - actual_unit_price: 0, - actual_total_amount: 0, - cost_per_bird: 0, - }, - { - item_name: 'Solar', - uom_name: 'Liter', - budget_quantity: 0, - budget_unit_price: 0, - budget_total_amount: 0, - actual_date: today, - actual_quantity: 20, - actual_unit_price: 10000, - actual_total_amount: 200000, - cost_per_bird: 200, - }, - { - item_name: 'Gaji Karyawan Kandang', - uom_name: 'Orang', - budget_quantity: 3, - budget_unit_price: 3000000, - budget_total_amount: 9000000, - actual_date: today, - actual_quantity: 3, - actual_unit_price: 3200000, - actual_total_amount: 9600000, - cost_per_bird: 640, - }, - { - item_name: 'Listrik Kandang', - uom_name: 'Bulan', - budget_quantity: 1, - budget_unit_price: 2500000, - budget_total_amount: 2500000, - actual_date: today, - actual_quantity: 1, - actual_unit_price: 2800000, - actual_total_amount: 2800000, - cost_per_bird: 187, - }, - { - item_name: 'Air Bersih', - uom_name: 'Bulan', - budget_quantity: 1, - budget_unit_price: 500000, - budget_total_amount: 500000, - actual_date: today, - actual_quantity: 1, - actual_unit_price: 450000, - actual_total_amount: 450000, - cost_per_bird: 30, - }, - { - item_name: 'Perbaikan Kandang', - uom_name: 'Paket', - budget_quantity: 1, - budget_unit_price: 3000000, - budget_total_amount: 3000000, - actual_date: yesterday, - actual_quantity: 1, - actual_unit_price: 3500000, - actual_total_amount: 3500000, - cost_per_bird: 233, - }, - { - item_name: 'Service Peralatan', - uom_name: 'Kali', - budget_quantity: 2, - budget_unit_price: 500000, - budget_total_amount: 1000000, - actual_date: lastWeek, - actual_quantity: 2, - actual_unit_price: 550000, - actual_total_amount: 1100000, - cost_per_bird: 73, - }, - { - item_name: 'ATK & Supplies', - uom_name: 'Paket', - budget_quantity: 1, - budget_unit_price: 500000, - budget_total_amount: 500000, - actual_date: today, - actual_quantity: 1, - actual_unit_price: 450000, - actual_total_amount: 450000, - cost_per_bird: 30, - }, - { - item_name: 'Biaya Komunikasi', - uom_name: 'Bulan', - budget_quantity: 1, - budget_unit_price: 300000, - budget_total_amount: 300000, - actual_date: today, - actual_quantity: 1, - actual_unit_price: 320000, - actual_total_amount: 320000, - cost_per_bird: 21, - }, - { - item_name: 'BBM Kendaraan Operasional', - uom_name: 'Liter', - budget_quantity: 200, - budget_unit_price: 10000, - budget_total_amount: 2000000, - actual_date: today, - actual_quantity: 220, - actual_unit_price: 10500, - actual_total_amount: 2310000, - cost_per_bird: 154, - }, - ], - total: { - budget_quantity: 710, - budget_total_amount: 23300000, - actual_quantity: 250, - actual_total_amount: 24530000, - cost_per_bird: 1568, - }, -}; - -// ====================== -// 🔧 Dummy API Response Functions -// ====================== - -/** - * Dummy implementation for getAllFetcher - * Returns all closing records - */ -export const dummyGetAllFetcher = async (): Promise<{ - code: number; - status: 'success'; - message: string; - data: Closing[]; -}> => { - await new Promise((resolve) => setTimeout(resolve, 500)); - return { - code: 200, - status: 'success', - message: 'Data closing berhasil diambil', - data: dummyClosings, - }; -}; - -/** - * Dummy implementation for getSingle - * Returns a single closing by ID - */ -export const dummyGetSingle = async ( - id: number -): Promise | undefined> => { - await new Promise((resolve) => setTimeout(resolve, 300)); - const closing = dummyClosings.find((c) => c.id === id); - - if (!closing) { - return { - code: 404, - status: 'error', - message: `Closing dengan ID ${id} tidak ditemukan`, - }; - } - - return { - code: 200, - status: 'success', - message: 'Data closing berhasil diambil', - data: closing, - }; -}; - -/** - * Dummy implementation for getAllIncomingSapronakFetcher - * Returns all incoming sapronak records - */ -export const dummyGetAllIncomingSapronakFetcher = async (): Promise<{ - code: number; - status: 'success'; - message: string; - data: ClosingIncomingSapronak[]; -}> => { - await new Promise((resolve) => setTimeout(resolve, 400)); - return { - code: 200, - status: 'success', - message: 'Data sapronak masuk berhasil diambil', - data: dummyIncomingSapronaks, - }; -}; - -/** - * Dummy implementation for getAllOutgoingSapronakFetcher - * Returns all outgoing sapronak records - */ -export const dummyGetAllOutgoingSapronakFetcher = async (): Promise<{ - code: number; - status: 'success'; - message: string; - data: ClosingOutgoingSapronak[]; -}> => { - await new Promise((resolve) => setTimeout(resolve, 400)); - return { - code: 200, - status: 'success', - message: 'Data sapronak keluar berhasil diambil', - data: dummyOutgoingSapronaks, - }; -}; - -/** - * Dummy implementation for getGeneralInfo - * Returns closing general information by ID - */ -export const dummyGetGeneralInfo = async ( - id: number -): Promise | undefined> => { - await new Promise((resolve) => setTimeout(resolve, 300)); - const closingInfo = dummyClosingGeneralInformations.find((c) => c.id == id); - - if (!closingInfo) { - return { - code: 404, - status: 'error', - message: `Closing general information dengan ID ${id} tidak ditemukan`, - }; - } - - return { - code: 200, - status: 'success', - message: 'Data closing general information berhasil diambil', - data: closingInfo, - }; -}; - -/** - * Dummy implementation for getPerhitunganSapronak - * Returns sapronak calculation data - */ -export const dummyGetPerhitunganSapronak = async ( - id: number -): Promise< - | { - code: number; - status: 'success'; - message: string; - data: ClosingSapronakCalculation; - } - | undefined -> => { - await new Promise((resolve) => setTimeout(resolve, 400)); - return { - code: 200, - status: 'success', - message: 'Data perhitungan sapronak berhasil diambil', - data: dummySapronakCalculation, - }; -}; - -/** - * Dummy implementation for getOverhead - * Returns overhead data - */ -export const dummyGetOverhead = async ( - id: number -): Promise | undefined> => { - await new Promise((resolve) => setTimeout(resolve, 400)); - return { - code: 200, - status: 'success', - message: 'Data overhead berhasil diambil', - data: dummyOverhead, - }; -}; - -export const dummyClosingProductionData: ClosingProductionData = { - purchase: { - initial_population: 12000, - claim_culling: 150, - final_population: 11850, - feed_in: 24000, - feed_used: 22500, - feed_used_per_head: 1.9, - }, - - sales: { - chicken: { - sales_population: 10500, - sales_weight: 21000, - average_weight: 2.0, - chicken_average_selling_price: 28500, - }, - egg: { - egg_pieces: 185000, - egg_mass_kg: 9250, - average_egg_weight_kg: 0.05, - egg_average_selling_price: 1800, - }, - }, - - performance: { - depletion: 150, - age_day: 35, - mortality_std: 3.5, - mortality_act: 4.2, - deff_mortality: 0.7, - fcr_std: 1.6, - fcr_act: 1.72, - deff_fcr: 0.12, - awg: 60, - }, -}; diff --git a/src/dummy/finance/finance.dummy.json b/src/dummy/finance/finance.dummy.json deleted file mode 100644 index c6237259..00000000 --- a/src/dummy/finance/finance.dummy.json +++ /dev/null @@ -1,470 +0,0 @@ -[ - { - "id": 9, - "payment_code": "PAY-OUT-SUPP-00-9", - "reference_number": "DO.MBU.496", - "transaction_type": "Penjualan", - "party": { - "id": 9268, - "name": "PT. PAKAN NUSANTARA JAYA", - "type": "SUPPLIER", - "account_number": "038901000983305" - }, - "payment_date": "07-Sep-2025", - "created_at": "25-Aug-2025", - "payment_method": "Giro", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 27352139, - "income_amount": 0, - "nominal": 27352139, - "note": "" - }, - { - "id": 8, - "payment_code": "PAY-OUT-SUPP-00-8", - "reference_number": "DO.MBU.534", - "transaction_type": "Penjualan", - "party": { - "id": 9805, - "name": "PT. PAKAN NUSANTARA JAYA", - "type": "SUPPLIER", - "account_number": "123000888999" - }, - "payment_date": "30-Aug-2025", - "created_at": "22-Aug-2025", - "payment_method": "Giro", - "bank": { - "id": 3, - "name": "Bank Mandiri", - "alias": "MANDIRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "123000888999" - }, - "expense_amount": 70365908, - "income_amount": 0, - "nominal": 70365908, - "note": "" - }, - { - "id": 7, - "payment_code": "PAY-OUT-CUST-00-7", - "reference_number": "DO.MBU.822", - "transaction_type": "Penjualan", - "party": { - "id": 1676, - "name": "ADIN ARDIAN", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "05-Aug-2025", - "created_at": "04-Aug-2025", - "payment_method": "Giro", - "bank": { - "id": 3, - "name": "Bank Mandiri", - "alias": "MANDIRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "123000888999" - }, - "expense_amount": 57255311, - "income_amount": 0, - "nominal": 57255311, - "note": "" - }, - { - "id": 6, - "payment_code": "PAY-OUT-SUPP-00-6", - "reference_number": "DO.MBU.900", - "transaction_type": "Penjualan", - "party": { - "id": 2615, - "name": "PT. PAKAN NUSANTARA JAYA", - "type": "SUPPLIER", - "account_number": "0541348513" - }, - "payment_date": "09-Aug-2025", - "created_at": "01-Aug-2025", - "payment_method": "Giro", - "bank": { - "id": 1, - "name": "Bank Central Asia", - "alias": "BCA", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "0541348513" - }, - "expense_amount": 46143594, - "income_amount": 0, - "nominal": 46143594, - "note": "" - }, - { - "id": 5, - "payment_code": "PAY-IN-CUST-00-5", - "reference_number": "DO.MBU.008", - "transaction_type": "Penjualan", - "party": { - "id": 5926, - "name": "AJRIL HAYAT, SE", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "07-Sep-2025", - "created_at": "15-Sep-2025", - "payment_method": "Transfer", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 0, - "income_amount": 57934816, - "nominal": 57934816, - "note": "" - }, - { - "id": 4, - "payment_code": "PAY-OUT-CUST-00-4", - "reference_number": "DO.MBU.889", - "transaction_type": "Penjualan", - "party": { - "id": 105, - "name": "AMAT RAHMAT", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "01-Sep-2025", - "created_at": "08-Aug-2025", - "payment_method": "Cash", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 40208329, - "income_amount": 0, - "nominal": 40208329, - "note": "" - }, - { - "id": 3, - "payment_code": "PAY-OUT-CUST-00-3", - "reference_number": "DO.MBU.574", - "transaction_type": "Penjualan", - "party": { - "id": 4789, - "name": "AJRIL HAYAT, SE", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "14-Sep-2025", - "created_at": "09-Aug-2025", - "payment_method": "Cash", - "bank": { - "id": 1, - "name": "Bank Central Asia", - "alias": "BCA", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "0541348513" - }, - "expense_amount": 53206601, - "income_amount": 0, - "nominal": 53206601, - "note": "" - }, - { - "id": 2, - "payment_code": "PAY-OUT-CUST-00-2", - "reference_number": "DO.MBU.581", - "transaction_type": "Penjualan", - "party": { - "id": 2834, - "name": "ADIN ARDIAN", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "28-Sep-2025", - "created_at": "24-Aug-2025", - "payment_method": "Cash", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 42584188, - "income_amount": 0, - "nominal": 42584188, - "note": "" - }, - { - "id": 1, - "payment_code": "PAY-IN-SUPP-00-1", - "reference_number": "DO.MBU.498", - "transaction_type": "Penjualan", - "party": { - "id": 6937, - "name": "PT. PAKAN NUSANTARA JAYA", - "type": "SUPPLIER", - "account_number": "038901000983305" - }, - "payment_date": "15-Aug-2025", - "created_at": "05-Sep-2025", - "payment_method": "Transfer", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 0, - "income_amount": 73312519, - "nominal": 73312519, - "note": "" - }, - { - "id": 9, - "payment_code": "PAY-OUT-SUPP-00-9", - "reference_number": "DO.MBU.496", - "transaction_type": "Penjualan", - "party": { - "id": 9268, - "name": "PT. PAKAN NUSANTARA JAYA", - "type": "SUPPLIER", - "account_number": "038901000983305" - }, - "payment_date": "07-Sep-2025", - "created_at": "25-Aug-2025", - "payment_method": "Giro", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 27352139, - "income_amount": 0, - "nominal": 27352139, - "note": "" - }, - { - "id": 8, - "payment_code": "PAY-OUT-SUPP-00-8", - "reference_number": "DO.MBU.534", - "transaction_type": "Penjualan", - "party": { - "id": 9805, - "name": "PT. PAKAN NUSANTARA JAYA", - "type": "SUPPLIER", - "account_number": "123000888999" - }, - "payment_date": "30-Aug-2025", - "created_at": "22-Aug-2025", - "payment_method": "Giro", - "bank": { - "id": 3, - "name": "Bank Mandiri", - "alias": "MANDIRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "123000888999" - }, - "expense_amount": 70365908, - "income_amount": 0, - "nominal": 70365908, - "note": "" - }, - { - "id": 7, - "payment_code": "PAY-OUT-CUST-00-7", - "reference_number": "DO.MBU.822", - "transaction_type": "Penjualan", - "party": { - "id": 1676, - "name": "ADIN ARDIAN", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "05-Aug-2025", - "created_at": "04-Aug-2025", - "payment_method": "Giro", - "bank": { - "id": 3, - "name": "Bank Mandiri", - "alias": "MANDIRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "123000888999" - }, - "expense_amount": 57255311, - "income_amount": 0, - "nominal": 57255311, - "note": "" - }, - { - "id": 6, - "payment_code": "PAY-OUT-SUPP-00-6", - "reference_number": "DO.MBU.900", - "transaction_type": "Penjualan", - "party": { - "id": 2615, - "name": "PT. PAKAN NUSANTARA JAYA", - "type": "SUPPLIER", - "account_number": "0541348513" - }, - "payment_date": "09-Aug-2025", - "created_at": "01-Aug-2025", - "payment_method": "Giro", - "bank": { - "id": 1, - "name": "Bank Central Asia", - "alias": "BCA", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "0541348513" - }, - "expense_amount": 46143594, - "income_amount": 0, - "nominal": 46143594, - "note": "" - }, - { - "id": 5, - "payment_code": "PAY-IN-CUST-00-5", - "reference_number": "DO.MBU.008", - "transaction_type": "Penjualan", - "party": { - "id": 5926, - "name": "AJRIL HAYAT, SE", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "07-Sep-2025", - "created_at": "15-Sep-2025", - "payment_method": "Transfer", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 0, - "income_amount": 57934816, - "nominal": 57934816, - "note": "" - }, - { - "id": 4, - "payment_code": "PAY-OUT-CUST-00-4", - "reference_number": "DO.MBU.889", - "transaction_type": "Penjualan", - "party": { - "id": 105, - "name": "AMAT RAHMAT", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "01-Sep-2025", - "created_at": "08-Aug-2025", - "payment_method": "Cash", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 40208329, - "income_amount": 0, - "nominal": 40208329, - "note": "" - }, - { - "id": 3, - "payment_code": "PAY-OUT-CUST-00-3", - "reference_number": "DO.MBU.574", - "transaction_type": "Penjualan", - "party": { - "id": 4789, - "name": "AJRIL HAYAT, SE", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "14-Sep-2025", - "created_at": "09-Aug-2025", - "payment_method": "Cash", - "bank": { - "id": 1, - "name": "Bank Central Asia", - "alias": "BCA", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "0541348513" - }, - "expense_amount": 53206601, - "income_amount": 0, - "nominal": 53206601, - "note": "" - }, - { - "id": 2, - "payment_code": "PAY-OUT-CUST-00-2", - "reference_number": "DO.MBU.581", - "transaction_type": "Penjualan", - "party": { - "id": 2834, - "name": "ADIN ARDIAN", - "type": "CUSTOMER", - "account_number": "038901000983305" - }, - "payment_date": "28-Sep-2025", - "created_at": "24-Aug-2025", - "payment_method": "Cash", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 42584188, - "income_amount": 0, - "nominal": 42584188, - "note": "" - }, - { - "id": 1, - "payment_code": "PAY-IN-SUPP-00-1", - "reference_number": "DO.MBU.498", - "transaction_type": "Penjualan", - "party": { - "id": 6937, - "name": "PT. PAKAN NUSANTARA JAYA", - "type": "SUPPLIER", - "account_number": "038901000983305" - }, - "payment_date": "15-Aug-2025", - "created_at": "05-Sep-2025", - "payment_method": "Transfer", - "bank": { - "id": 2, - "name": "Bank Rakyat Indonesia", - "alias": "BRI", - "owner": "MITRA BERLIAN UNGGAS PT", - "account_number": "038901000983305" - }, - "expense_amount": 0, - "income_amount": 73312519, - "nominal": 73312519, - "note": "" - } -] diff --git a/src/dummy/finance/finance.dummy.ts b/src/dummy/finance/finance.dummy.ts deleted file mode 100644 index c2cd51d6..00000000 --- a/src/dummy/finance/finance.dummy.ts +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Dummy data for Finance[] - * Generated from: finance_payments.json - * - * This file is auto-generated. Do not edit manually. - */ - -import { FinanceBank, Finance } from '../../types/api/finance/finance'; -import { BaseApiResponse } from '@/types/api/api-general'; -import dummyData from './finance.dummy.json'; - -/** - * Get dummy Finance[] data - * @returns Promise with BaseApiResponse containing Finance[] - */ -export async function getAllFetcher(): Promise> { - return new Promise((resolve) => { - setTimeout(() => { - resolve({ - code: 200, - status: 'success', - message: 'Data retrieved successfully', - data: dummyData as unknown as Finance[], - }); - }, 500); - }); -} - -export async function getFetcher( - id: number -): Promise> { - return new Promise((resolve) => { - setTimeout(() => { - const data = dummyData.find((item) => item.id === id); - resolve({ - code: 200, - status: 'success', - message: 'Data retrieved successfully', - data: data as unknown as Finance, - }); - }, 500); - }); -} diff --git a/src/dummy/master-data/production-standard.dummy.json b/src/dummy/master-data/production-standard.dummy.json deleted file mode 100644 index a89918f9..00000000 --- a/src/dummy/master-data/production-standard.dummy.json +++ /dev/null @@ -1,341 +0,0 @@ -[ - { - "id": 1, - "name": "Standar Uniformity A", - "project_category": "LAYING", - "created_user": { - "id": 1, - "id_user": 1, - "email": "admin@mbugroup.id", - "name": "Super Admin" - }, - "details": [ - { - "week": 1, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 55, - "max_depletion": 3, - "min_uniformity": 60, - "feed_intake": 25 - }, - "egg_production_standard_detail": { - "id": 1, - "target_hen_day_production": 1, - "target_hen_house_production": 1, - "target_egg_weight": 1, - "target_egg_mass": 1 - } - } - ] - }, - { - "id": 3, - "name": "Standard Growing 2024", - "project_category": "GROWING", - "created_at": "Fri May 10 2024 19:22:41 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 13, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1608, - "max_depletion": 2.217125905431294, - "min_uniformity": 82.53307938674605, - "max_cv": 10.755001233777175, - "week": 10, - "feed_intake": 106 - } - } - ] - }, - { - "id": 1, - "name": "Standard Laying 2024", - "project_category": "LAYING", - "created_at": "Thu Jan 18 2024 05:55:37 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 7, - "egg_production_standard_detail": { - "id": 1, - "target_hen_day_production": 88.75664879714013, - "target_hen_house_production": 88.14547241912292, - "target_egg_weight": 56.500738261325466, - "target_egg_mass": 51.3608296108157 - }, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1630, - "max_depletion": 1.4984809075731345, - "min_uniformity": 89.58032440497733, - "max_cv": 10.088686692512729, - "week": 2, - "feed_intake": 109 - } - } - ] - }, - { - "id": 18, - "name": "Standard Laying 2024", - "project_category": "LAYING", - "created_at": "Mon Mar 04 2024 08:29:01 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 5, - "egg_production_standard_detail": { - "id": 1, - "target_hen_day_production": 96.61629851755295, - "target_hen_house_production": 92.28797293699245, - "target_egg_weight": 56.58098085770421, - "target_egg_mass": 52.43691607207049 - }, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1879, - "max_depletion": 2.627489091697176, - "min_uniformity": 82.66289615405532, - "max_cv": 10.820852039399298, - "week": 20, - "feed_intake": 102 - } - } - ] - }, - { - "id": 13, - "name": "Standard Laying 2024", - "project_category": "LAYING", - "created_at": "Wed Aug 21 2024 16:53:00 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 19, - "egg_production_standard_detail": { - "id": 1, - "target_hen_day_production": 90.64987149673148, - "target_hen_house_production": 84.72381158749832, - "target_egg_weight": 52.66407930502588, - "target_egg_mass": 48.67508874158 - }, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1640, - "max_depletion": 1.0327075188137618, - "min_uniformity": 81.06885977450052, - "max_cv": 10.554487690853291, - "week": 17, - "feed_intake": 103 - } - } - ] - }, - { - "id": 15, - "name": "Standard Laying 2025", - "project_category": "LAYING", - "created_at": "Wed Jun 19 2024 22:53:30 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 18, - "egg_production_standard_detail": { - "id": 1, - "target_hen_day_production": 93.92688146007806, - "target_hen_house_production": 88.99021279347687, - "target_egg_weight": 52.34548967695446, - "target_egg_mass": 47.022424468842786 - }, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1613, - "max_depletion": 1.4131114163932998, - "min_uniformity": 87.70472314168066, - "max_cv": 10.854404697694157, - "week": 19, - "feed_intake": 113 - } - } - ] - }, - { - "id": 4, - "name": "Standard Growing 2025", - "project_category": "GROWING", - "created_at": "Fri Aug 02 2024 20:01:03 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 10, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1679, - "max_depletion": 1.6915361117048733, - "min_uniformity": 86.90679412785661, - "max_cv": 9.332617207000094, - "week": 17, - "feed_intake": 103 - } - } - ] - }, - { - "id": 4, - "name": "Standard Laying 2024", - "project_category": "LAYING", - "created_at": "Wed Jun 12 2024 11:17:31 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 17, - "egg_production_standard_detail": { - "id": 1, - "target_hen_day_production": 80.64302567936814, - "target_hen_house_production": 89.82086172466285, - "target_egg_weight": 55.226688911717915, - "target_egg_mass": 53.11072600271201 - }, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1874, - "max_depletion": 2.438323895989795, - "min_uniformity": 84.30289784580617, - "max_cv": 8.222592209557122, - "week": 12, - "feed_intake": 105 - } - } - ] - }, - { - "id": 6, - "name": "Standard Laying 2025", - "project_category": "LAYING", - "created_at": "Mon Mar 18 2024 10:48:49 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 13, - "egg_production_standard_detail": { - "id": 1, - "target_hen_day_production": 82.2346989800578, - "target_hen_house_production": 90.75391628121226, - "target_egg_weight": 57.499497168597166, - "target_egg_mass": 47.20514521984387 - }, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1831, - "max_depletion": 1.074492532699157, - "min_uniformity": 85.74444671505677, - "max_cv": 10.858199896316137, - "week": 7, - "feed_intake": 112 - } - } - ] - }, - { - "id": 7, - "name": "Standard Laying 2024", - "project_category": "LAYING", - "created_at": "Sat Mar 30 2024 14:29:22 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 2, - "egg_production_standard_detail": { - "id": 1, - "target_hen_day_production": 90.49925722287992, - "target_hen_house_production": 89.55923007437376, - "target_egg_weight": 58.22187327861563, - "target_egg_mass": 54.45919757347778 - }, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1809, - "max_depletion": 2.2870196905499673, - "min_uniformity": 83.61968975899043, - "max_cv": 10.012889742382296, - "week": 6, - "feed_intake": 115 - } - } - ] - }, - { - "id": 11, - "name": "Standard Growing 2024", - "project_category": "GROWING", - "created_at": "Fri Jan 19 2024 06:05:53 GMT+0700 (Western Indonesia Time)", - "updated_at": "2025-12-26T23:13:21Z", - "created_user": { - "id": 1, - "name": "Super Admin", - "email": "superadmin@mbugroup.id" - }, - "details": [ - { - "week": 17, - "growth_standard_detail": { - "id": 1, - "target_mean_bw": 1803, - "max_depletion": 2.3862272943774725, - "min_uniformity": 88.37012562585544, - "max_cv": 9.948053043223062, - "week": 16, - "feed_intake": 114 - } - } - ] - } -] diff --git a/src/dummy/master-data/production-standard.dummy.ts b/src/dummy/master-data/production-standard.dummy.ts deleted file mode 100644 index 451f2b46..00000000 --- a/src/dummy/master-data/production-standard.dummy.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Dummy data for ProductionStandard[] - * Generated from: master-data-standar-produksi.json - * - * This file is auto-generated. Do not edit manually. - */ - -import { ProductionStandard } from '../../types/api/master-data/production-standard'; -import { BaseApiResponse } from '@/types/api/api-general'; -import dummyData from './production-standard.dummy.json'; - -/** - * Get dummy ProductionStandard[] data - * @returns Promise with BaseApiResponse containing ProductionStandard[] - */ -export async function getDummyAllFetcher(): Promise< - BaseApiResponse -> { - return new Promise((resolve) => { - setTimeout(() => { - resolve({ - code: 200, - status: 'success', - message: 'Data retrieved successfully', - data: dummyData as unknown as ProductionStandard[], - }); - }, 500); - }); -} - -export async function getDummySingleFetcher( - id: number -): Promise> { - return new Promise((resolve) => { - setTimeout(() => { - resolve({ - code: 200, - status: 'success', - message: 'Data retrieved successfully', - data: dummyData.find( - (item) => item.id === id - ) as unknown as ProductionStandard, - }); - }, 500); - }); -} diff --git a/src/dummy/report/marketing-report.dummy.ts b/src/dummy/report/marketing-report.dummy.ts deleted file mode 100644 index ea5af398..00000000 --- a/src/dummy/report/marketing-report.dummy.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { BaseApiResponse } from '@/types/api/api-general'; -import { DailyMarketingReport } from '@/types/api/report/marketing'; - -// TODO: delete this later -export const DAILY_MARKETING_DUMMY_DATA: BaseApiResponse = - { - code: 200, - status: 'success', - message: 'Get daily marketing report successfully', - meta: { - page: 1, - limit: 10, - total_pages: 1, - total_results: 2, - }, - data: { - rows: [ - { - // metadata - created_user: { - id: 1, - id_user: 101, - email: 'admin@example.com', - name: 'Admin User', - }, - created_at: '2025-12-01T08:00:00Z', - updated_at: '2025-12-01T08:00:00Z', - - // row data - no: 1, - so_date: '2025-12-01', - do_date: '2025-12-08', - aging_days: 7, - - warehouse: { - id: 1, - name: 'Warehouse Kandang A', - type: 'KANDANG', - area: { - id: 1, - name: 'Area Barat', - }, - location: { - id: 1, - name: 'Farm Bandung', - address: 'Jl. Raya Farm No. 1', - area: null, - }, - kandang: { - id: 1, - name: 'Kandang A1', - status: 'ACTIVE', - capacity: 5000, - location: null, - pic: null, - }, - }, - - customer: { - id: 1, - name: 'PT Maju Jaya', - pic_id: 10, - pic: { - id: 10, - id_user: 210, - email: 'pic@majujaya.com', - name: 'Budi Santoso', - }, - type: 'BROILER', - address: 'Jl. Industri No. 10', - phone: '08123456789', - email: 'contact@majujaya.com', - account_number: '1234567890', - }, - - sales: 'Andi Wijaya', - - product: { - id: 1, - name: 'Live Chicken', - brand: 'LTI Farm', - sku: 'LC-001', - product_price: 18_000, - selling_price: 20_000, - tax: 0, - expiry_period: 0, - uom: { - id: 1, - name: 'Kg', - created_user: { - id: 1, - id_user: 101, - email: 'admin@example.com', - name: 'Admin User', - }, - created_at: '2025-01-01T00:00:00Z', - updated_at: '2025-01-01T00:00:00Z', - }, - product_category: { - id: 1, - code: 'BROILER', - name: 'Broiler Chicken', - created_user: { - id: 1, - id_user: 101, - email: 'admin@example.com', - name: 'Admin User', - }, - created_at: '2025-01-01T00:00:00Z', - updated_at: '2025-01-01T00:00:00Z', - }, - suppliers: [], - flags: ['LIVE'], - }, - - do_number: 'DO-2025-0001', - vehicle_number: 'B 1234 CD', - marketing_type: 'REGULAR', - - qty: 1000, - average_weight_kg: 1.8, - total_weight_kg: 1800, - - sales_price_per_kg: 20_000, - hpp_price_per_kg: 18_000, - - sales_amount: 36_000_000, - hpp_amount: 32_400_000, - }, - ], - - summary: { - total_qty: 1000, - total_weight_kg: 1800, - total_sales_amount: 36_000_000, - total_hpp_amount: 32_400_000, - }, - }, - }; diff --git a/src/services/api/closing.ts b/src/services/api/closing.ts index 9513760c..c1f0db62 100644 --- a/src/services/api/closing.ts +++ b/src/services/api/closing.ts @@ -15,20 +15,6 @@ import { import { BaseApiResponse } from '@/types/api/api-general'; import { httpClient, httpClientFetcher } from '@/services/http/client'; import { ClosingSales } from '@/types/api/closing'; - -// TODO: delete these dummy data later -import { - dummyGetAllFetcher, - dummyGetSingle, - dummyGetAllIncomingSapronakFetcher, - dummyGetAllOutgoingSapronakFetcher, - dummyGetGeneralInfo, - dummyGetPerhitunganSapronak, - dummyGetOverhead, - dummyClosingProductionData, -} from '@/dummy/closing.dummy'; -import { sleep } from '@/lib/helper'; - export class ClosingApiService extends BaseApiService { constructor(basePath: string) { super(basePath); diff --git a/src/services/api/master-data.ts b/src/services/api/master-data.ts index 929bf935..f15de21d 100644 --- a/src/services/api/master-data.ts +++ b/src/services/api/master-data.ts @@ -65,10 +65,6 @@ import { UpdateFlockPayload, } from '@/types/api/master-data/flock'; import { ProductionStandard } from '@/types/api/master-data/production-standard'; -import { - getDummyAllFetcher, - getDummySingleFetcher, -} from '@/dummy/master-data/production-standard.dummy'; export const UomApi = new BaseApiService< Uom,