feat: Setup projet Classeo avec infrastructure Docker et architecture DDD
Configure l'environnement de développement complet avec Docker Compose, structure DDD 4 Bounded Contexts, et pipeline CI/CD GitHub Actions. Corrections compatibilité CI: - Symfony 8 nécessite monolog-bundle ^4.0 (la v3.x ne supporte que jusqu'à Symfony 7) - ESLint v9 nécessite flat config (eslint.config.js) - le format .eslintrc.cjs est obsolète
This commit is contained in:
2
frontend/src/lib/index.ts
Normal file
2
frontend/src/lib/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// place files you want to import through the `$lib` alias in this folder.
|
||||
export * from './types';
|
||||
35
frontend/src/lib/types/api.ts
Normal file
35
frontend/src/lib/types/api.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
// API response types
|
||||
export interface ApiError {
|
||||
code: string;
|
||||
message: string;
|
||||
violations?: Array<{
|
||||
propertyPath: string;
|
||||
message: string;
|
||||
}>;
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
data: T[];
|
||||
meta: {
|
||||
total: number;
|
||||
page: number;
|
||||
itemsPerPage: number;
|
||||
lastPage: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface HydraCollection<T> {
|
||||
'@context': string;
|
||||
'@id': string;
|
||||
'@type': string;
|
||||
'hydra:totalItems': number;
|
||||
'hydra:member': T[];
|
||||
'hydra:view'?: {
|
||||
'@id': string;
|
||||
'@type': string;
|
||||
'hydra:first'?: string;
|
||||
'hydra:last'?: string;
|
||||
'hydra:next'?: string;
|
||||
'hydra:previous'?: string;
|
||||
};
|
||||
}
|
||||
2
frontend/src/lib/types/index.ts
Normal file
2
frontend/src/lib/types/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './shared';
|
||||
export * from './api';
|
||||
27
frontend/src/lib/types/shared.ts
Normal file
27
frontend/src/lib/types/shared.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// Branded types for type safety
|
||||
export type TenantId = string & { readonly brand: unique symbol };
|
||||
export type UserId = string & { readonly brand: unique symbol };
|
||||
export type NoteId = string & { readonly brand: unique symbol };
|
||||
export type ClasseId = string & { readonly brand: unique symbol };
|
||||
export type EleveId = string & { readonly brand: unique symbol };
|
||||
|
||||
// Helper functions for branded types
|
||||
export function createTenantId(id: string): TenantId {
|
||||
return id as TenantId;
|
||||
}
|
||||
|
||||
export function createUserId(id: string): UserId {
|
||||
return id as UserId;
|
||||
}
|
||||
|
||||
export function createNoteId(id: string): NoteId {
|
||||
return id as NoteId;
|
||||
}
|
||||
|
||||
export function createClasseId(id: string): ClasseId {
|
||||
return id as ClasseId;
|
||||
}
|
||||
|
||||
export function createEleveId(id: string): EleveId {
|
||||
return id as EleveId;
|
||||
}
|
||||
Reference in New Issue
Block a user