import { BaseApproval, CreatedUser } from '@/types/api/api-general';
import { Supplier } from '@/types/api/master-data/supplier';
import { Location } from '@/types/api/master-data/location';
import { Nonstock } from '@/types/api/master-data/nonstock';
import { Kandang } from '@/types/api/master-data/kandang';

export type Pengajuan = {
  id: number;
  expense_id: number;
  project_flock_kandang_id: number;
  kandang_id: number;
  nonstock_id: number;
  qty: number;
  price: number;
  notes: string;
  nonstock: Nonstock;
  created_at: string;
};

export type Realisasi = {
  id: number;
  expense_nonstock_id: number;
  qty: number;
  price: number;
  notes: string;
  nonstock: Nonstock;
  created_at: string;
};

export type ReportExpense = {
  id: number;
  reference_number: string;
  po_number: string;
  category: string;
  supplier: Supplier;
  realization_date: string;
  transaction_date: string;
  pengajuan: Pengajuan;
  realisasi: Realisasi;
  kandang: Kandang;
  created_at: string;
  updated_at: string;
  created_user: CreatedUser;
  latest_approval: BaseApproval;
};

export type ReportExpenseSearchParams = {
  locationId: string | null;
  supplierId: string | null;
  kandangId: string | null;
  nonstockId: string | null;
  realizationDate: string | null;
  category: string | null;
  search: string;
};
