chore(FE-199): adjust Expense type

This commit is contained in:
ValdiANS
2025-11-06 21:11:18 +07:00
parent 57ffd50558
commit 512e016b5e
+39 -2
View File
@@ -1,14 +1,51 @@
import { BaseMetadata } from '@/types/api/api-general';
import { Location } from '@/types/api/master-data/location';
import { Kandang } from '@/types/api/master-data/kandang';
import { Supplier } from '@/types/api/master-data/supplier';
import { Nonstock } from '@/types/api/master-data/nonstock';
export type BaseExpense = {
id: number;
name: string;
location: Location;
transaction_date: string;
realization_date?: string;
kandangs: Kandang[];
vendor: Supplier;
request_documents: {
name: string;
url: string;
}[];
kandang_expenses: {
kandang: Kandang;
expenses: {
nonstock: Nonstock;
total_quantity: number;
total_expense: number;
notes?: string;
}[];
}[];
nominal: number;
paid?: number;
remaining_cost?: number;
};
export type Expense = BaseMetadata & BaseExpense;
export type CreateExpensePayload = {
name: string;
locationId: number;
transaction_date: string;
kandangIds: number[];
vendorId: number;
request_documents: File[];
kandang_expenses: {
kandangId: number;
expenses: {
nonstockId: number;
total_quantity: number;
total_expense: number;
notes?: string;
}[];
}[];
};
export type UpdateExpensePayload = CreateExpensePayload;