mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
chore: rename ExpenseForm.schema.ts to ExpenseRequestForm.schema.ts
This commit is contained in:
@@ -1,9 +0,0 @@
|
|||||||
import * as Yup from 'yup';
|
|
||||||
|
|
||||||
export const ExpenseFormSchema = Yup.object({
|
|
||||||
name: Yup.string().required('Nama wajib diisi!'),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const UpdateExpenseFormSchema = ExpenseFormSchema;
|
|
||||||
|
|
||||||
export type ExpenseFormValues = Yup.InferType<typeof ExpenseFormSchema>;
|
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import * as Yup from 'yup';
|
||||||
|
|
||||||
|
type ExpenseFormSchemaType = {
|
||||||
|
name: string;
|
||||||
|
location?: {
|
||||||
|
value: number;
|
||||||
|
label: string;
|
||||||
|
};
|
||||||
|
transaction_date?: string;
|
||||||
|
kandangs?: number[];
|
||||||
|
vendor?: {
|
||||||
|
value: number;
|
||||||
|
label: string;
|
||||||
|
};
|
||||||
|
requestDocuments?: File[];
|
||||||
|
// kandangExpenses: {
|
||||||
|
// nonstock?: {
|
||||||
|
// value: number;
|
||||||
|
// label: string;
|
||||||
|
// };
|
||||||
|
// }[];
|
||||||
|
};
|
||||||
|
|
||||||
|
export const ExpenseRequestFormSchema: Yup.ObjectSchema<ExpenseFormSchemaType> =
|
||||||
|
Yup.object({
|
||||||
|
name: Yup.string().required('Nama wajib diisi!'),
|
||||||
|
|
||||||
|
location: Yup.object({
|
||||||
|
value: Yup.number().min(1).required(),
|
||||||
|
label: Yup.string().required(),
|
||||||
|
}).required('Lokasi wajib diisi!'),
|
||||||
|
|
||||||
|
transaction_date: Yup.string().required('Tanggal transaksi wajib diisi!'),
|
||||||
|
kandangs: Yup.array().of(Yup.number().required('Kandang wajib dipilih!')),
|
||||||
|
|
||||||
|
vendor: Yup.object({
|
||||||
|
value: Yup.number().min(1).required(),
|
||||||
|
label: Yup.string().required(),
|
||||||
|
}).required('Vendor wajib diisi!'),
|
||||||
|
|
||||||
|
requestDocuments: Yup.array().of(Yup.mixed<File>().required()).optional(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const UpdateExpenseRequestFormSchema = ExpenseRequestFormSchema;
|
||||||
|
|
||||||
|
export type ExpenseRequestFormValues = Yup.InferType<
|
||||||
|
typeof ExpenseRequestFormSchema
|
||||||
|
>;
|
||||||
Reference in New Issue
Block a user