Mise en ligne de la version 0.2.0
This commit is contained in:
36
web/src/app/services/template.model.ts
Normal file
36
web/src/app/services/template.model.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
// Interfaces TypeScript pour TemplateDTO (Backend Java).
|
||||
|
||||
/**
|
||||
* Type d'un champ de Template. Miroir de com.loremind.domain.lorecontext.FieldType.
|
||||
* - 'TEXT' : champ textuel libre (rendu en textarea)
|
||||
* - 'IMAGE' : galerie d'images (rendu en app-image-gallery)
|
||||
*/
|
||||
export type FieldType = 'TEXT' | 'IMAGE';
|
||||
|
||||
/**
|
||||
* Champ d'un Template : nom + type discriminant.
|
||||
* Miroir de TemplateFieldDTO (backend).
|
||||
*/
|
||||
export interface TemplateField {
|
||||
name: string;
|
||||
type: FieldType;
|
||||
}
|
||||
|
||||
export interface Template {
|
||||
id?: string;
|
||||
loreId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
defaultNodeId?: string | null;
|
||||
fields: TemplateField[];
|
||||
fieldCount?: number;
|
||||
}
|
||||
|
||||
/** Payload de création : id absent, fieldCount absent (calculé côté serveur). */
|
||||
export interface TemplateCreate {
|
||||
loreId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
defaultNodeId?: string | null;
|
||||
fields: TemplateField[];
|
||||
}
|
||||
Reference in New Issue
Block a user