feat(validation): add editing versioning revalidation and aligned reports
This commit is contained in:
parent
f73a24df13
commit
302e542fda
28 changed files with 2691 additions and 406 deletions
|
|
@ -78,6 +78,10 @@ export type ValidationItem = Entity & {
|
|||
scheduled_on?: string | null;
|
||||
performed_on?: string | null;
|
||||
next_validation_on?: string | null;
|
||||
revalidation_interval_months: number;
|
||||
next_validation_manually_overridden: boolean;
|
||||
version: number;
|
||||
previous_validation_id?: string | null;
|
||||
equipment_ids: string[];
|
||||
environment_conditions: Record<string, unknown>;
|
||||
documentation_checklist: Record<string, unknown>[];
|
||||
|
|
@ -90,6 +94,14 @@ export type ValidationItem = Entity & {
|
|||
attachments: Record<string, unknown>[];
|
||||
};
|
||||
|
||||
export function normalizeValidationPayload<T extends Record<string, unknown>>(values: T): T {
|
||||
const optionalForeignKeys = ["contact_id", "examiner_id"];
|
||||
return {
|
||||
...values,
|
||||
...Object.fromEntries(optionalForeignKeys.map((key) => [key, values[key] || null]))
|
||||
};
|
||||
}
|
||||
|
||||
export type Paginated<T> = {
|
||||
items: T[];
|
||||
total: number;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue