@tmlmobilidade/types
Version:
59 lines (58 loc) • 1.29 kB
JavaScript
/* * */
import { z } from 'zod';
/* * */
export const AnnotationsPermissionSchema = z.object({
action: z.enum([
'create',
'delete',
'read',
'lock',
'update',
]),
resources: z.object({
agency_ids: z.array(z.string()).default([]),
}).default({}),
scope: z.literal('annotations'),
});
/* * */
export const EventsPermissionSchema = z.object({
action: z.enum([
'create',
'delete',
'read',
'lock',
'update',
]),
resources: z.object({
agency_ids: z.array(z.string()).default([]),
}).default({}),
scope: z.literal('events'),
});
/* * */
export const HolidaysPermissionSchema = z.object({
action: z.enum([
'create',
'delete',
'read',
'lock',
'update',
]),
resources: z.object({
agency_ids: z.array(z.string()).default([]),
}).default({}),
scope: z.literal('holidays'),
});
/* * */
export const YearPeriodsPermissionSchema = z.object({
action: z.enum([
'create',
'delete',
'read',
'lock',
'update',
]),
resources: z.object({
agency_ids: z.array(z.string()).default([]),
}).default({}),
scope: z.literal('year_periods'),
});