2022-07-21 16:23:56 +02:00
|
|
|
import { FromSchema } from 'json-schema-to-ts';
|
|
|
|
import { groupUserModelSchema } from './group-user-model-schema';
|
|
|
|
import { userSchema } from './user-schema';
|
|
|
|
|
|
|
|
export const groupSchema = {
|
|
|
|
$id: '#/components/schemas/groupSchema',
|
|
|
|
type: 'object',
|
2022-07-26 13:39:55 +02:00
|
|
|
additionalProperties: true,
|
|
|
|
required: ['name'],
|
2022-07-21 16:23:56 +02:00
|
|
|
properties: {
|
|
|
|
id: {
|
|
|
|
type: 'number',
|
|
|
|
},
|
|
|
|
name: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
description: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
createdBy: {
|
|
|
|
type: 'string',
|
|
|
|
nullable: true,
|
|
|
|
},
|
|
|
|
createdAt: {
|
|
|
|
type: 'string',
|
|
|
|
format: 'date-time',
|
|
|
|
nullable: true,
|
|
|
|
},
|
|
|
|
users: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
$ref: '#/components/schemas/groupUserModelSchema',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
projects: {
|
|
|
|
type: 'array',
|
|
|
|
items: {
|
|
|
|
type: 'string',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
components: {
|
|
|
|
schemas: {
|
|
|
|
groupUserModelSchema,
|
|
|
|
userSchema,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
} as const;
|
|
|
|
|
|
|
|
export type GroupSchema = FromSchema<typeof groupSchema>;
|