- Introduced Zod schemas for validation in the following entities: - Provincie - Ratelimiter - Rinnovi - Servizio - ServizioAnnunci - ServizioInteressi - TestiEStringhe - Users - UserEtichette - UserInvites - UsersAnagrafica - UsersStorage - VideosRefs - StatusConfermaEnum - TipologiaPosizioneEnum - Updated API routes in `catasto.ts` to include CRUD operations for Comuni, Nazioni, and Provincie with appropriate input validation. - Enhanced controller methods in `catasto.controller.ts` to handle create, edit, and delete operations for Comuni and Nazioni. - Added new utility Zod types for ComuniId, NazioniId, and ProvincieId. Co-authored-by: Copilot <copilot@github.com>
32 lines
No EOL
1 KiB
TypeScript
32 lines
No EOL
1 KiB
TypeScript
import { chatsChatid, type ChatsChatid } from './Chats';
|
|
import { etichetteIdEtichetta, type EtichetteIdEtichetta } from './Etichette';
|
|
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
|
import { z } from 'zod';
|
|
|
|
/** Represents the table public.chats_etichette */
|
|
export default interface ChatsEtichetteTable {
|
|
chatid: ColumnType<ChatsChatid, ChatsChatid, ChatsChatid>;
|
|
|
|
etichettaid: ColumnType<EtichetteIdEtichetta, EtichetteIdEtichetta, EtichetteIdEtichetta>;
|
|
}
|
|
|
|
export type ChatsEtichette = Selectable<ChatsEtichetteTable>;
|
|
|
|
export type NewChatsEtichette = Insertable<ChatsEtichetteTable>;
|
|
|
|
export type ChatsEtichetteUpdate = Updateable<ChatsEtichetteTable>;
|
|
|
|
export const ChatsEtichetteSchema = z.object({
|
|
chatid: chatsChatid,
|
|
etichettaid: etichetteIdEtichetta,
|
|
});
|
|
|
|
export const NewChatsEtichetteSchema = z.object({
|
|
chatid: chatsChatid,
|
|
etichettaid: etichetteIdEtichetta,
|
|
});
|
|
|
|
export const ChatsEtichetteUpdateSchema = z.object({
|
|
chatid: chatsChatid.optional(),
|
|
etichettaid: etichetteIdEtichetta.optional(),
|
|
}); |