SONUM v7 - Évolution v6 (éditeurs/blocs CRUD, tableau de bord stats) + vue liste alternance couleurs
This commit is contained in:
19
shared/_core/errors.ts
Normal file
19
shared/_core/errors.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Base HTTP error class with status code.
|
||||
* Throw this from route handlers to send specific HTTP errors.
|
||||
*/
|
||||
export class HttpError extends Error {
|
||||
constructor(
|
||||
public statusCode: number,
|
||||
message: string
|
||||
) {
|
||||
super(message);
|
||||
this.name = "HttpError";
|
||||
}
|
||||
}
|
||||
|
||||
// Convenience constructors
|
||||
export const BadRequestError = (msg: string) => new HttpError(400, msg);
|
||||
export const UnauthorizedError = (msg: string) => new HttpError(401, msg);
|
||||
export const ForbiddenError = (msg: string) => new HttpError(403, msg);
|
||||
export const NotFoundError = (msg: string) => new HttpError(404, msg);
|
||||
5
shared/const.ts
Normal file
5
shared/const.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const COOKIE_NAME = "app_session_id";
|
||||
export const ONE_YEAR_MS = 1000 * 60 * 60 * 24 * 365;
|
||||
export const AXIOS_TIMEOUT_MS = 30_000;
|
||||
export const UNAUTHED_ERR_MSG = 'Please login (10001)';
|
||||
export const NOT_ADMIN_ERR_MSG = 'You do not have required permission (10002)';
|
||||
94
shared/referentiel.ts
Normal file
94
shared/referentiel.ts
Normal file
@@ -0,0 +1,94 @@
|
||||
export const REGIONS = [
|
||||
"Auvergne-Rhône-Alpes",
|
||||
"Bourgogne-Franche-Comté",
|
||||
"Bretagne",
|
||||
"Centre-Val de Loire",
|
||||
"Corse",
|
||||
"Grand Est",
|
||||
"Guadeloupe",
|
||||
"Guyane",
|
||||
"Hauts-de-France",
|
||||
"Île-de-France",
|
||||
"La Réunion",
|
||||
"Martinique",
|
||||
"Mayotte",
|
||||
"Normandie",
|
||||
"Nouvelle-Aquitaine",
|
||||
"Occitanie",
|
||||
"Pays de la Loire",
|
||||
"Provence-Alpes-Côte d'Azur",
|
||||
];
|
||||
|
||||
export const TYPES_ACTIVITE = [
|
||||
"HAD",
|
||||
"MCO",
|
||||
"SMR",
|
||||
"EHPAD",
|
||||
"USLD",
|
||||
"Psychiatrie",
|
||||
"SSR",
|
||||
"SSIAD",
|
||||
"IME",
|
||||
"FAM",
|
||||
"MAS",
|
||||
"CAMSP",
|
||||
"CMPP",
|
||||
"ESAT",
|
||||
"Foyer de vie",
|
||||
"Résidence autonomie",
|
||||
"Autre",
|
||||
];
|
||||
|
||||
export const TAILLES_EFFECTIFS = [
|
||||
"< 50 salariés",
|
||||
"50 - 200 salariés",
|
||||
"200 - 500 salariés",
|
||||
"500 - 1000 salariés",
|
||||
"> 1000 salariés",
|
||||
];
|
||||
|
||||
export const BLOCS_FONCTIONNELS_DEFAUT = [
|
||||
"SI RH",
|
||||
"SI Finance",
|
||||
"SI Métier",
|
||||
"SI Collaboratif",
|
||||
"Site internet",
|
||||
"SI Achat",
|
||||
"SI Support",
|
||||
"SI Infrastructure",
|
||||
"SI Sécurité",
|
||||
"SI Qualité",
|
||||
"SI Immobilier",
|
||||
"SI Décisionnel",
|
||||
];
|
||||
|
||||
export const ETATS_DEPLOIEMENT: Record<string, string> = {
|
||||
demarrage: "Démarrage",
|
||||
en_cours: "En cours",
|
||||
operationnel: "Opérationnel",
|
||||
en_remplacement: "En remplacement",
|
||||
};
|
||||
|
||||
export const MODES_HEBERGEMENT: Record<string, string> = {
|
||||
hds: "Hébergement HDS",
|
||||
on_premise: "On Premise",
|
||||
hybride: "Hybride",
|
||||
};
|
||||
|
||||
export const MODES_FACTURATION: Record<string, string> = {
|
||||
saas: "SaaS",
|
||||
achat_maintenance: "Achat + Maintenance",
|
||||
location: "Location",
|
||||
};
|
||||
|
||||
export const INTEROPERABILITE: Record<string, string> = {
|
||||
non: "Non",
|
||||
oui_interface: "Oui (via interface)",
|
||||
oui_eai: "Oui (via EAI)",
|
||||
};
|
||||
|
||||
export const STATUTS_DEMANDE: Record<string, string> = {
|
||||
en_attente: "En attente",
|
||||
repondu: "Répondu",
|
||||
ferme: "Fermé",
|
||||
};
|
||||
7
shared/types.ts
Normal file
7
shared/types.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Unified type exports
|
||||
* Import shared types from this single entry point.
|
||||
*/
|
||||
|
||||
export type * from "../drizzle/schema";
|
||||
export * from "./_core/errors";
|
||||
Reference in New Issue
Block a user