infoalloggi-monorepo/apps/infoalloggi/src/schemas/public/ChatsEtichette.ts
Marco Pedone d17ac87917 feat: add Zod schemas for various entities and update API routes
- 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>
2026-04-28 17:46:34 +02:00

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(),
});