mirror of
https://github.com/sergeyyarkov/asu_tools_service.git
synced 2026-10-11 02:19:09 +03:00
29 lines
811 B
JavaScript
29 lines
811 B
JavaScript
import y from "yup";
|
|
|
|
export const reportItemSchema = y.object({
|
|
date: y.string(),
|
|
equipment: y
|
|
.object({
|
|
id: y.number(),
|
|
name: y.string(),
|
|
location: y
|
|
.object({
|
|
id: y.string(),
|
|
name: y.string(),
|
|
base_location_name: y.string(),
|
|
base_location: y.string()
|
|
})
|
|
.nullable()
|
|
})
|
|
.nullable(),
|
|
reason_call: y.string(),
|
|
job_description: y.string(),
|
|
root_cause: y.string(),
|
|
applicant: y.object({ id: y.number(), name: y.string() }).nullable(),
|
|
executors: y.array(y.object({ id: y.number().required(), fullname: y.string().required() })).required()
|
|
});
|
|
|
|
export const reportsSchema = y
|
|
.object({ reports: y.array(reportItemSchema).min(1).required(), deleteAllBeforeImport: y.boolean().required() })
|
|
.required();
|