40 lines
1.3 KiB
TypeScript
40 lines
1.3 KiB
TypeScript
|
|
//=========================================
|
||
|
|
// File: constraints.ts
|
||
|
|
// Vincoli derivati da initdb/01_schema.sql.
|
||
|
|
// author: "villari.andrea@libero.it"
|
||
|
|
// version: "1.0.0 2026-06-18"
|
||
|
|
//=========================================
|
||
|
|
|
||
|
|
export const UTENTE_CONSTRAINTS = {
|
||
|
|
nome: { maxLength: 100, required: true },
|
||
|
|
cognome: { maxLength: 100, required: true },
|
||
|
|
email: { maxLength: 255, required: true },
|
||
|
|
password: { minLength: 8, maxLength: 72, required: true },
|
||
|
|
ruolo: {allowedValues: ["Operatore", "Amministratore"],
|
||
|
|
required: true,
|
||
|
|
}
|
||
|
|
} as const;
|
||
|
|
|
||
|
|
export const CLIENTE_CONSTRAINTS = {
|
||
|
|
nome: { maxLength: 100, required: true },
|
||
|
|
cognome: { maxLength: 100, required: true },
|
||
|
|
via: {maxLength: 100, required: true},
|
||
|
|
comune: {maxLength: 100, required: true},
|
||
|
|
provincia: {maxLength: 2, required: true},
|
||
|
|
telefono: { maxLength: 30, required: true },
|
||
|
|
email: { maxLength: 255, required: true },
|
||
|
|
note: { required: false },
|
||
|
|
} as const;
|
||
|
|
|
||
|
|
|
||
|
|
export const CONSEGNA_CONSTRAINTS = {
|
||
|
|
dataRitiro: { required: false },
|
||
|
|
dataConsegna: { required: false },
|
||
|
|
stato: {
|
||
|
|
allowedValues: ["da ritirare", "in consegna", "in giacenza", "in deposito"],
|
||
|
|
required: true,
|
||
|
|
},
|
||
|
|
chiaveConsegna: { maxLength: 8, required: true },
|
||
|
|
clienteId: { required: true },
|
||
|
|
} as const;
|
||
|
|
|