2025-11-13 11:38:41 +01:00
|
|
|
import type { ColumnType, Selectable, Insertable, Updateable } from 'kysely';
|
2026-04-28 17:46:34 +02:00
|
|
|
import { z } from 'zod';
|
2025-11-13 11:38:41 +01:00
|
|
|
|
|
|
|
|
/** Identifier type for public.provincie */
|
|
|
|
|
export type ProvincieId = number & { __brand: 'public.provincie' };
|
|
|
|
|
|
|
|
|
|
/** Represents the table public.provincie */
|
|
|
|
|
export default interface ProvincieTable {
|
|
|
|
|
id: ColumnType<ProvincieId, ProvincieId | undefined, ProvincieId>;
|
|
|
|
|
|
|
|
|
|
nome: ColumnType<string, string, string>;
|
|
|
|
|
|
|
|
|
|
sigla: ColumnType<string, string, string>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type Provincie = Selectable<ProvincieTable>;
|
|
|
|
|
|
|
|
|
|
export type NewProvincie = Insertable<ProvincieTable>;
|
|
|
|
|
|
2026-04-28 17:46:34 +02:00
|
|
|
export type ProvincieUpdate = Updateable<ProvincieTable>;
|
|
|
|
|
|
|
|
|
|
export const provincieId = z.number().transform(value => value as ProvincieId);
|
|
|
|
|
|
|
|
|
|
export const ProvincieSchema = z.object({
|
|
|
|
|
id: provincieId,
|
|
|
|
|
nome: z.string(),
|
|
|
|
|
sigla: z.string(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const NewProvincieSchema = z.object({
|
|
|
|
|
id: provincieId.optional(),
|
|
|
|
|
nome: z.string(),
|
|
|
|
|
sigla: z.string(),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
export const ProvincieUpdateSchema = z.object({
|
|
|
|
|
id: provincieId.optional(),
|
|
|
|
|
nome: z.string().optional(),
|
|
|
|
|
sigla: z.string().optional(),
|
|
|
|
|
});
|