Skip to content

Commit

Permalink
Derive PolicySchema from AppliedControlSchema
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Nov 22, 2024
1 parent 62975ba commit 240595e
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions frontend/src/lib/utils/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,7 @@ export const AppliedControlSchema = baseNamedObject({
owner: z.string().uuid().optional().array().optional()
});

export const PolicySchema = baseNamedObject({
csf_function: z.string().optional().nullable(),
status: z.string().optional().default('--'),
evidences: z.string().optional().array().optional(),
eta: z.union([z.literal('').transform(() => null), z.string().date()]).nullish(),
expiry_date: z.union([z.literal('').transform(() => null), z.string().date()]).nullish(),
link: z.string().url().optional().or(z.literal('')),
effort: z.string().optional().nullable(),
folder: z.string(),
reference_control: z.string().optional().nullable()
});
export const PolicySchema = AppliedControlSchema.omit({ category: true });

export const RiskAcceptanceSchema = baseNamedObject({
folder: z.string(),
Expand Down

0 comments on commit 240595e

Please sign in to comment.