This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
api/src/models/Guild.ts

29 lines
646 B
TypeScript

import type { Guild } from '@prisma/client'
import { Type } from '@sinclair/typebox'
import { date, id } from './utils.js'
export const guildSchema = {
id,
name: Type.String({ minLength: 1, maxLength: 30 }),
icon: Type.Union([
Type.String({ format: 'uri-reference', minLength: 1 }),
Type.Null()
]),
description: Type.Union([
Type.String({ minLength: 1, maxLength: 160 }),
Type.Null()
]),
createdAt: date.createdAt,
updatedAt: date.updatedAt
}
export const guildExample: Guild = {
id: 1,
name: 'GuildExample',
description: 'guild example.',
icon: null,
createdAt: new Date(),
updatedAt: new Date()
}