-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathalert.ts
39 lines (35 loc) · 900 Bytes
/
alert.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { z } from 'zod';
import { AlertSeverityType } from '../database-units/alert_severity';
/**
* Alert Model.
*
* @description Data model for `Alert`.
*/
export const AlertModel = z.object({
alert_id: z.number(),
alert_type_id: z.number(),
name: z.string(),
message: z.string(),
severity: AlertSeverityType,
data: z.object({}).nullable(),
record_end_date: z.string().nullable(),
create_date: z.string(),
create_user: z.number(),
update_date: z.string().nullable(),
update_user: z.number().nullable(),
revision_count: z.number()
});
export type AlertModel = z.infer<typeof AlertModel>;
/**
* Alert Record
*
* @description Data record for `Alert`.
*/
export const AlertRecord = AlertModel.omit({
create_date: true,
create_user: true,
update_date: true,
update_user: true,
revision_count: true
});
export type AlertRecord = z.infer<typeof AlertRecord>;