@atlashub/smartstack-cli 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/.documentation/css/styles.css +2168 -2168
  2. package/.documentation/js/app.js +794 -794
  3. package/config/default-config.json +86 -86
  4. package/config/settings.json +53 -53
  5. package/config/settings.local.example.json +16 -16
  6. package/dist/index.js +0 -0
  7. package/dist/index.js.map +1 -1
  8. package/package.json +88 -88
  9. package/templates/agents/action.md +36 -36
  10. package/templates/agents/efcore/conflicts.md +84 -84
  11. package/templates/agents/efcore/db-deploy.md +51 -51
  12. package/templates/agents/efcore/db-reset.md +59 -59
  13. package/templates/agents/efcore/db-seed.md +56 -56
  14. package/templates/agents/efcore/db-status.md +64 -64
  15. package/templates/agents/efcore/migration.md +85 -85
  16. package/templates/agents/efcore/rebase-snapshot.md +62 -62
  17. package/templates/agents/efcore/scan.md +90 -90
  18. package/templates/agents/efcore/squash.md +67 -67
  19. package/templates/agents/explore-codebase.md +65 -65
  20. package/templates/agents/explore-docs.md +97 -97
  21. package/templates/agents/fix-grammar.md +49 -49
  22. package/templates/agents/gitflow/abort.md +45 -45
  23. package/templates/agents/gitflow/cleanup.md +85 -85
  24. package/templates/agents/gitflow/commit.md +40 -40
  25. package/templates/agents/gitflow/exec.md +48 -48
  26. package/templates/agents/gitflow/finish.md +92 -92
  27. package/templates/agents/gitflow/init.md +139 -139
  28. package/templates/agents/gitflow/merge.md +62 -62
  29. package/templates/agents/gitflow/plan.md +42 -42
  30. package/templates/agents/gitflow/pr.md +78 -78
  31. package/templates/agents/gitflow/review.md +49 -49
  32. package/templates/agents/gitflow/start.md +61 -61
  33. package/templates/agents/gitflow/status.md +32 -32
  34. package/templates/agents/snipper.md +36 -36
  35. package/templates/agents/websearch.md +46 -46
  36. package/templates/commands/_resources/formatting-guide.md +124 -124
  37. package/templates/commands/ai-prompt.md +315 -315
  38. package/templates/commands/apex/1-analyze.md +100 -100
  39. package/templates/commands/apex/2-plan.md +145 -145
  40. package/templates/commands/apex/3-execute.md +171 -171
  41. package/templates/commands/apex/4-examine.md +116 -116
  42. package/templates/commands/apex/5-tasks.md +209 -209
  43. package/templates/commands/apex.md +76 -76
  44. package/templates/commands/application/create.md +362 -362
  45. package/templates/commands/application/templates-backend.md +463 -463
  46. package/templates/commands/application/templates-frontend.md +517 -517
  47. package/templates/commands/application/templates-i18n.md +478 -478
  48. package/templates/commands/application/templates-seed.md +362 -362
  49. package/templates/commands/application.md +303 -303
  50. package/templates/commands/business-analyse/0-orchestrate.md +640 -640
  51. package/templates/commands/business-analyse/1-init.md +269 -269
  52. package/templates/commands/business-analyse/2-discover.md +520 -520
  53. package/templates/commands/business-analyse/3-analyse.md +408 -408
  54. package/templates/commands/business-analyse/4-specify.md +598 -598
  55. package/templates/commands/business-analyse/5-validate.md +326 -326
  56. package/templates/commands/business-analyse/6-handoff.md +746 -746
  57. package/templates/commands/business-analyse/7-doc-html.md +602 -602
  58. package/templates/commands/business-analyse/bug.md +325 -325
  59. package/templates/commands/business-analyse/change-request.md +368 -368
  60. package/templates/commands/business-analyse/hotfix.md +200 -200
  61. package/templates/commands/business-analyse.md +640 -640
  62. package/templates/commands/controller/create.md +216 -216
  63. package/templates/commands/controller/postman-templates.md +528 -528
  64. package/templates/commands/controller/templates.md +600 -600
  65. package/templates/commands/controller.md +337 -337
  66. package/templates/commands/create/agent.md +138 -138
  67. package/templates/commands/create/command.md +166 -166
  68. package/templates/commands/create/hook.md +234 -234
  69. package/templates/commands/create/plugin.md +329 -329
  70. package/templates/commands/create/project.md +507 -507
  71. package/templates/commands/create/skill.md +199 -199
  72. package/templates/commands/create.md +220 -220
  73. package/templates/commands/debug.md +95 -95
  74. package/templates/commands/documentation/module.md +202 -202
  75. package/templates/commands/documentation/templates.md +432 -432
  76. package/templates/commands/documentation.md +190 -190
  77. package/templates/commands/efcore/_env-check.md +153 -153
  78. package/templates/commands/efcore/conflicts.md +186 -186
  79. package/templates/commands/efcore/db-deploy.md +193 -193
  80. package/templates/commands/efcore/db-reset.md +426 -426
  81. package/templates/commands/efcore/db-seed.md +326 -326
  82. package/templates/commands/efcore/db-status.md +226 -226
  83. package/templates/commands/efcore/migration.md +400 -400
  84. package/templates/commands/efcore/rebase-snapshot.md +264 -264
  85. package/templates/commands/efcore/scan.md +198 -198
  86. package/templates/commands/efcore/squash.md +298 -298
  87. package/templates/commands/efcore.md +224 -224
  88. package/templates/commands/epct.md +69 -69
  89. package/templates/commands/explain.md +186 -186
  90. package/templates/commands/explore.md +45 -45
  91. package/templates/commands/feature-full.md +267 -267
  92. package/templates/commands/gitflow/1-init.md +1038 -1038
  93. package/templates/commands/gitflow/10-start.md +768 -768
  94. package/templates/commands/gitflow/11-finish.md +457 -457
  95. package/templates/commands/gitflow/12-cleanup.md +276 -276
  96. package/templates/commands/gitflow/13-sync.md +216 -216
  97. package/templates/commands/gitflow/14-rebase.md +251 -251
  98. package/templates/commands/gitflow/2-status.md +277 -277
  99. package/templates/commands/gitflow/3-commit.md +344 -344
  100. package/templates/commands/gitflow/4-plan.md +145 -145
  101. package/templates/commands/gitflow/5-exec.md +147 -147
  102. package/templates/commands/gitflow/6-abort.md +344 -344
  103. package/templates/commands/gitflow/7-pull-request.md +453 -355
  104. package/templates/commands/gitflow/8-review.md +240 -176
  105. package/templates/commands/gitflow/9-merge.md +451 -365
  106. package/templates/commands/gitflow.md +128 -128
  107. package/templates/commands/implement.md +663 -663
  108. package/templates/commands/init.md +567 -567
  109. package/templates/commands/mcp-integration.md +330 -330
  110. package/templates/commands/notification.md +129 -129
  111. package/templates/commands/oneshot.md +57 -57
  112. package/templates/commands/quick-search.md +72 -72
  113. package/templates/commands/ralph-loop/cancel-ralph.md +18 -18
  114. package/templates/commands/ralph-loop/help.md +126 -126
  115. package/templates/commands/ralph-loop/ralph-loop.md +18 -18
  116. package/templates/commands/review.md +106 -106
  117. package/templates/commands/utils/test-web-config.md +160 -160
  118. package/templates/commands/utils/test-web.md +151 -151
  119. package/templates/commands/validate.md +233 -233
  120. package/templates/commands/workflow.md +193 -193
  121. package/templates/gitflow/config.json +138 -138
  122. package/templates/hooks/ef-migration-check.md +139 -139
  123. package/templates/hooks/hooks.json +25 -25
  124. package/templates/hooks/stop-hook.sh +177 -177
  125. package/templates/skills/ai-prompt/SKILL.md +778 -778
  126. package/templates/skills/application/SKILL.md +563 -563
  127. package/templates/skills/application/templates-backend.md +450 -450
  128. package/templates/skills/application/templates-frontend.md +531 -531
  129. package/templates/skills/application/templates-i18n.md +520 -520
  130. package/templates/skills/application/templates-seed.md +647 -647
  131. package/templates/skills/business-analyse/SKILL.md +191 -191
  132. package/templates/skills/business-analyse/questionnaire.md +283 -283
  133. package/templates/skills/business-analyse/templates-frd.md +477 -477
  134. package/templates/skills/business-analyse/templates-react.md +580 -580
  135. package/templates/skills/controller/SKILL.md +240 -240
  136. package/templates/skills/controller/postman-templates.md +614 -614
  137. package/templates/skills/controller/templates.md +1468 -1468
  138. package/templates/skills/documentation/SKILL.md +133 -133
  139. package/templates/skills/documentation/templates.md +476 -476
  140. package/templates/skills/feature-full/SKILL.md +838 -838
  141. package/templates/skills/notification/SKILL.md +555 -555
  142. package/templates/skills/ui-components/SKILL.md +870 -870
  143. package/templates/skills/workflow/SKILL.md +582 -582
  144. package/templates/test-web/api-health.json +38 -38
  145. package/templates/test-web/minimal.json +19 -19
  146. package/templates/test-web/npm-package.json +46 -46
  147. package/templates/test-web/seo-check.json +54 -54
@@ -1,517 +1,517 @@
1
- # Templates Frontend - Application Skill
2
-
3
- > Ces templates génèrent le code React/TypeScript pour les nouvelles applications/modules.
4
- > **RAPPEL:** Toutes les pages client sont sous `/business/...`
5
-
6
- ---
7
-
8
- ## ARCHITECTURE FRONTEND
9
-
10
- ```
11
- web/smartstack-web/src/
12
- ├── pages/business/$APP/$MODULE/
13
- │ ├── $MODULE_PASCALPage.tsx # Page principale (liste)
14
- │ ├── $MODULE_PASCALDetailPage.tsx # Page détail
15
- │ └── Create$MODULE_PASCALPage.tsx # Page création
16
- ├── components/$MODULE/
17
- │ ├── $MODULE_PASCALListView.tsx # Composant liste réutilisable
18
- │ ├── $MODULE_PASCALForm.tsx # Formulaire CRUD
19
- │ └── $MODULE_PASCALFilters.tsx # Filtres
20
- ├── components/common/
21
- │ └── (composants partagés)
22
- ├── hooks/
23
- │ ├── use$MODULE_PASCALPreferences.ts # Hook préférences
24
- │ └── use$MODULE_PASCAL.ts # Hook API
25
- ├── services/api/
26
- │ └── $moduleApi.ts # Service API
27
- └── i18n/locales/
28
- ├── fr/$module.json
29
- ├── en/$module.json
30
- ├── it/$module.json
31
- └── de/$module.json
32
- ```
33
-
34
- ---
35
-
36
- ## TEMPLATE: PAGE PRINCIPALE
37
-
38
- ```tsx
39
- // pages/business/$APP/$MODULE/$MODULE_PASCALPage.tsx
40
-
41
- import { useTranslation } from 'react-i18next';
42
- import { $MODULE_PASCALListView } from '@/components/$MODULE/$MODULE_PASCALListView';
43
-
44
- export function $MODULE_PASCALPage() {
45
- const { t } = useTranslation(['$module', 'common']);
46
-
47
- return (
48
- <$MODULE_PASCALListView
49
- title={t('$module:title')}
50
- subtitle={t('$module:subtitle')}
51
- basePath="/business/$APP/$MODULE"
52
- createPath="/business/$APP/$MODULE/new"
53
- />
54
- );
55
- }
56
- ```
57
-
58
- ---
59
-
60
- ## TEMPLATE: LISTE VIEW (Composant réutilisable)
61
-
62
- ```tsx
63
- // components/$MODULE/$MODULE_PASCALListView.tsx
64
-
65
- import { useState, useEffect } from 'react';
66
- import { useNavigate } from 'react-router-dom';
67
- import { useTranslation } from 'react-i18next';
68
- import { Plus, Search, MoreVertical, Pencil, Trash2 } from 'lucide-react';
69
- import { api } from '@/services/api/apiClient';
70
- import { use$MODULE_PASCALPreferences } from '@/hooks/use$MODULE_PASCALPreferences';
71
- import { Pagination } from '@/components/common/Pagination';
72
- import { ColumnSelector } from '@/components/common/ColumnSelector';
73
- import { ViewModeToggle } from '@/components/common/ViewModeToggle';
74
-
75
- interface $ENTITY_PASCALDto {
76
- id: string;
77
- name: string;
78
- description: string | null;
79
- isActive: boolean;
80
- createdAt: string;
81
- updatedAt: string | null;
82
- }
83
-
84
- interface PagedResult {
85
- items: $ENTITY_PASCALDto[];
86
- totalCount: number;
87
- page: number;
88
- pageSize: number;
89
- }
90
-
91
- interface $MODULE_PASCALListViewProps {
92
- title: string;
93
- subtitle?: string;
94
- basePath: string;
95
- createPath?: string;
96
- }
97
-
98
- const DEFAULT_COLUMNS = ['name', 'description', 'isActive', 'createdAt'];
99
-
100
- export function $MODULE_PASCALListView({
101
- title,
102
- subtitle,
103
- basePath,
104
- createPath,
105
- }: $MODULE_PASCALListViewProps) {
106
- const { t } = useTranslation(['$module', 'common']);
107
- const navigate = useNavigate();
108
- const {
109
- pageSize,
110
- sortColumn,
111
- sortDirection,
112
- visibleColumns,
113
- viewMode,
114
- setPageSize,
115
- setSortColumn,
116
- setSortDirection,
117
- setVisibleColumns,
118
- setViewMode,
119
- } = use$MODULE_PASCALPreferences();
120
-
121
- const [data, setData] = useState<PagedResult | null>(null);
122
- const [loading, setLoading] = useState(true);
123
- const [error, setError] = useState<string | null>(null);
124
- const [page, setPage] = useState(1);
125
- const [searchTerm, setSearchTerm] = useState('');
126
-
127
- useEffect(() => {
128
- loadData();
129
- }, [page, pageSize, sortColumn, sortDirection, searchTerm]);
130
-
131
- const loadData = async () => {
132
- try {
133
- setLoading(true);
134
- setError(null);
135
- const params = new URLSearchParams({
136
- page: page.toString(),
137
- pageSize: pageSize.toString(),
138
- sortColumn,
139
- sortDirection,
140
- ...(searchTerm && { searchTerm }),
141
- });
142
- const result = await api.get<PagedResult>(`/api/business/$MODULE?${params}`);
143
- setData(result);
144
- } catch (err) {
145
- setError(t('common:errors.loadFailed'));
146
- console.error('Failed to load $module:', err);
147
- } finally {
148
- setLoading(false);
149
- }
150
- };
151
-
152
- const handleSort = (column: string) => {
153
- if (sortColumn === column) {
154
- setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
155
- } else {
156
- setSortColumn(column);
157
- setSortDirection('asc');
158
- }
159
- };
160
-
161
- const handleDelete = async (id: string) => {
162
- if (!confirm(t('common:confirmDelete'))) return;
163
-
164
- try {
165
- await api.delete(`/api/business/$MODULE/${id}`);
166
- loadData();
167
- } catch (err) {
168
- console.error('Failed to delete:', err);
169
- }
170
- };
171
-
172
- const columns = [
173
- { key: 'name', label: t('$module:columns.name'), sortable: true },
174
- { key: 'description', label: t('$module:columns.description'), sortable: false },
175
- { key: 'isActive', label: t('$module:columns.status'), sortable: true },
176
- { key: 'createdAt', label: t('$module:columns.createdAt'), sortable: true },
177
- ];
178
-
179
- return (
180
- <div className="space-y-6">
181
- {/* Header */}
182
- <div className="flex items-center justify-between">
183
- <div>
184
- <h1 className="text-2xl font-bold text-[var(--text-primary)]">{title}</h1>
185
- {subtitle && (
186
- <p className="text-[var(--text-secondary)] mt-1">{subtitle}</p>
187
- )}
188
- </div>
189
- {createPath && (
190
- <button
191
- onClick={() => navigate(createPath)}
192
- className="flex items-center gap-2 px-4 py-2 bg-[var(--color-accent-500)] hover:bg-[var(--color-accent-600)] text-white font-medium transition-colors"
193
- style={{ borderRadius: 'var(--radius-button)' }}
194
- >
195
- <Plus className="w-4 h-4" />
196
- {t('common:actions.create')}
197
- </button>
198
- )}
199
- </div>
200
-
201
- {/* Toolbar */}
202
- <div className="flex items-center justify-between gap-4">
203
- <div className="relative flex-1 max-w-md">
204
- <Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--text-muted)]" />
205
- <input
206
- type="text"
207
- placeholder={t('common:search.placeholder')}
208
- value={searchTerm}
209
- onChange={(e) => setSearchTerm(e.target.value)}
210
- className="w-full pl-10 pr-4 py-2 bg-[var(--bg-primary)] border border-[var(--border-color)] text-sm focus:outline-none focus:border-[var(--color-accent-500)]"
211
- style={{ borderRadius: 'var(--radius-input)' }}
212
- />
213
- </div>
214
- <div className="flex items-center gap-2">
215
- <ColumnSelector
216
- columns={columns}
217
- visibleColumns={visibleColumns}
218
- onChange={setVisibleColumns}
219
- />
220
- <ViewModeToggle value={viewMode} onChange={setViewMode} />
221
- </div>
222
- </div>
223
-
224
- {/* Content */}
225
- {loading ? (
226
- <div className="flex items-center justify-center py-12">
227
- <div className="animate-spin h-8 w-8 border-4 border-[var(--color-accent-500)] border-t-transparent rounded-full" />
228
- </div>
229
- ) : error ? (
230
- <div className="p-4 bg-[var(--error-bg)] border border-[var(--error-border)] text-[var(--error-text)]" style={{ borderRadius: 'var(--radius-card)' }}>
231
- {error}
232
- </div>
233
- ) : viewMode === 'list' ? (
234
- <div className="bg-[var(--bg-card)] border border-[var(--item-color-border)] overflow-hidden" style={{ borderRadius: 'var(--radius-card)' }}>
235
- <table className="w-full">
236
- <thead>
237
- <tr className="border-b border-[var(--item-color-border)]">
238
- {columns.filter(col => visibleColumns.includes(col.key)).map((col) => (
239
- <th
240
- key={col.key}
241
- className={`px-4 py-3 text-left text-sm font-medium text-[var(--text-secondary)] ${
242
- col.sortable ? 'cursor-pointer hover:text-[var(--text-primary)]' : ''
243
- }`}
244
- onClick={() => col.sortable && handleSort(col.key)}
245
- >
246
- {col.label}
247
- {sortColumn === col.key && (
248
- <span className="ml-1">{sortDirection === 'asc' ? '↑' : '↓'}</span>
249
- )}
250
- </th>
251
- ))}
252
- <th className="px-4 py-3 text-right text-sm font-medium text-[var(--text-secondary)]">
253
- {t('common:actions.title')}
254
- </th>
255
- </tr>
256
- </thead>
257
- <tbody>
258
- {data?.items.map((item) => (
259
- <tr
260
- key={item.id}
261
- className="border-b border-[var(--item-color-border)] hover:bg-[var(--bg-hover)] cursor-pointer"
262
- onClick={() => navigate(`${basePath}/${item.id}`)}
263
- >
264
- {visibleColumns.includes('name') && (
265
- <td className="px-4 py-3 text-sm text-[var(--text-primary)] font-medium">
266
- {item.name}
267
- </td>
268
- )}
269
- {visibleColumns.includes('description') && (
270
- <td className="px-4 py-3 text-sm text-[var(--text-secondary)]">
271
- {item.description || '-'}
272
- </td>
273
- )}
274
- {visibleColumns.includes('isActive') && (
275
- <td className="px-4 py-3">
276
- <span
277
- className={`inline-flex items-center px-2 py-1 text-xs font-medium ${
278
- item.isActive
279
- ? 'bg-green-100 text-green-800'
280
- : 'bg-gray-100 text-gray-800'
281
- }`}
282
- style={{ borderRadius: 'var(--radius-badge)' }}
283
- >
284
- {item.isActive ? t('common:status.active') : t('common:status.inactive')}
285
- </span>
286
- </td>
287
- )}
288
- {visibleColumns.includes('createdAt') && (
289
- <td className="px-4 py-3 text-sm text-[var(--text-secondary)]">
290
- {new Date(item.createdAt).toLocaleDateString()}
291
- </td>
292
- )}
293
- <td className="px-4 py-3 text-right">
294
- <div className="flex items-center justify-end gap-2">
295
- <button
296
- onClick={(e) => {
297
- e.stopPropagation();
298
- navigate(`${basePath}/${item.id}/edit`);
299
- }}
300
- className="p-1 hover:bg-[var(--bg-tertiary)]"
301
- style={{ borderRadius: 'var(--radius-button)' }}
302
- >
303
- <Pencil className="w-4 h-4 text-[var(--text-secondary)]" />
304
- </button>
305
- <button
306
- onClick={(e) => {
307
- e.stopPropagation();
308
- handleDelete(item.id);
309
- }}
310
- className="p-1 hover:bg-[var(--error-bg)]"
311
- style={{ borderRadius: 'var(--radius-button)' }}
312
- >
313
- <Trash2 className="w-4 h-4 text-[var(--error-text)]" />
314
- </button>
315
- </div>
316
- </td>
317
- </tr>
318
- ))}
319
- </tbody>
320
- </table>
321
- </div>
322
- ) : (
323
- /* Grid view */
324
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
325
- {data?.items.map((item) => (
326
- <div
327
- key={item.id}
328
- className="bg-[var(--bg-card)] border border-[var(--item-color-border)] p-4 hover:border-[var(--color-accent-500)] cursor-pointer transition-colors"
329
- style={{ borderRadius: 'var(--radius-card)' }}
330
- onClick={() => navigate(`${basePath}/${item.id}`)}
331
- >
332
- <h3 className="font-medium text-[var(--text-primary)]">{item.name}</h3>
333
- <p className="text-sm text-[var(--text-secondary)] mt-1 line-clamp-2">
334
- {item.description || '-'}
335
- </p>
336
- <div className="flex items-center justify-between mt-3">
337
- <span
338
- className={`inline-flex items-center px-2 py-1 text-xs font-medium ${
339
- item.isActive
340
- ? 'bg-green-100 text-green-800'
341
- : 'bg-gray-100 text-gray-800'
342
- }`}
343
- style={{ borderRadius: 'var(--radius-badge)' }}
344
- >
345
- {item.isActive ? t('common:status.active') : t('common:status.inactive')}
346
- </span>
347
- <span className="text-xs text-[var(--text-muted)]">
348
- {new Date(item.createdAt).toLocaleDateString()}
349
- </span>
350
- </div>
351
- </div>
352
- ))}
353
- </div>
354
- )}
355
-
356
- {/* Pagination */}
357
- {data && (
358
- <Pagination
359
- page={data.page}
360
- pageSize={data.pageSize}
361
- totalCount={data.totalCount}
362
- onPageChange={setPage}
363
- onPageSizeChange={setPageSize}
364
- />
365
- )}
366
- </div>
367
- );
368
- }
369
- ```
370
-
371
- ---
372
-
373
- ## TEMPLATE: HOOK PRÉFÉRENCES
374
-
375
- ```tsx
376
- // hooks/use$MODULE_PASCALPreferences.ts
377
-
378
- import { useUserPreferences } from '@/contexts/UserPreferencesContext';
379
-
380
- const DEFAULT_COLUMNS = ['name', 'description', 'isActive', 'createdAt'];
381
-
382
- export function use$MODULE_PASCALPreferences() {
383
- const { preferences, updatePreference } = useUserPreferences();
384
- const modulePrefs = preferences.$module || {};
385
-
386
- return {
387
- // Getters with defaults
388
- pageSize: modulePrefs.pageSize ?? 10,
389
- sortColumn: modulePrefs.sortColumn ?? 'createdAt',
390
- sortDirection: modulePrefs.sortDirection ?? 'desc',
391
- filters: modulePrefs.filters ?? {},
392
- visibleColumns: modulePrefs.visibleColumns ?? DEFAULT_COLUMNS,
393
- viewMode: modulePrefs.viewMode ?? 'list',
394
-
395
- // Setters
396
- setPageSize: (size: number) =>
397
- updatePreference('$module.pageSize', size),
398
- setSortColumn: (col: string) =>
399
- updatePreference('$module.sortColumn', col),
400
- setSortDirection: (dir: 'asc' | 'desc') =>
401
- updatePreference('$module.sortDirection', dir),
402
- setFilters: (filters: Record<string, unknown>) =>
403
- updatePreference('$module.filters', filters),
404
- setVisibleColumns: (cols: string[]) =>
405
- updatePreference('$module.visibleColumns', cols),
406
- setViewMode: (mode: 'list' | 'grid') =>
407
- updatePreference('$module.viewMode', mode),
408
- };
409
- }
410
- ```
411
-
412
- ---
413
-
414
- ## TEMPLATE: SERVICE API
415
-
416
- ```tsx
417
- // services/api/$moduleApi.ts
418
-
419
- import { api } from './apiClient';
420
-
421
- export interface $ENTITY_PASCALDto {
422
- id: string;
423
- name: string;
424
- description: string | null;
425
- isActive: boolean;
426
- createdAt: string;
427
- updatedAt: string | null;
428
- }
429
-
430
- export interface Create$ENTITY_PASCALRequest {
431
- name: string;
432
- description?: string;
433
- }
434
-
435
- export interface Update$ENTITY_PASCALRequest {
436
- name: string;
437
- description?: string;
438
- }
439
-
440
- export interface PagedResult<T> {
441
- items: T[];
442
- totalCount: number;
443
- page: number;
444
- pageSize: number;
445
- }
446
-
447
- export interface QueryParameters {
448
- page?: number;
449
- pageSize?: number;
450
- searchTerm?: string;
451
- sortColumn?: string;
452
- sortDirection?: 'asc' | 'desc';
453
- }
454
-
455
- export const $moduleApi = {
456
- getAll: async (params: QueryParameters = {}): Promise<PagedResult<$ENTITY_PASCALDto>> => {
457
- const queryParams = new URLSearchParams();
458
- if (params.page) queryParams.set('page', params.page.toString());
459
- if (params.pageSize) queryParams.set('pageSize', params.pageSize.toString());
460
- if (params.searchTerm) queryParams.set('searchTerm', params.searchTerm);
461
- if (params.sortColumn) queryParams.set('sortColumn', params.sortColumn);
462
- if (params.sortDirection) queryParams.set('sortDirection', params.sortDirection);
463
-
464
- return api.get(`/api/business/$MODULE?${queryParams}`);
465
- },
466
-
467
- getById: async (id: string): Promise<$ENTITY_PASCALDto> => {
468
- return api.get(`/api/business/$MODULE/${id}`);
469
- },
470
-
471
- create: async (data: Create$ENTITY_PASCALRequest): Promise<$ENTITY_PASCALDto> => {
472
- return api.post('/api/business/$MODULE', data);
473
- },
474
-
475
- update: async (id: string, data: Update$ENTITY_PASCALRequest): Promise<$ENTITY_PASCALDto> => {
476
- return api.put(`/api/business/$MODULE/${id}`, data);
477
- },
478
-
479
- delete: async (id: string): Promise<void> => {
480
- return api.delete(`/api/business/$MODULE/${id}`);
481
- },
482
- };
483
- ```
484
-
485
- ---
486
-
487
- ## TEMPLATE: ROUTES (App.tsx)
488
-
489
- ```tsx
490
- // Ajouter dans App.tsx
491
-
492
- import { $MODULE_PASCALPage } from '@/pages/business/$APP/$MODULE/$MODULE_PASCALPage';
493
- import { $MODULE_PASCALDetailPage } from '@/pages/business/$APP/$MODULE/$MODULE_PASCALDetailPage';
494
- import { Create$MODULE_PASCALPage } from '@/pages/business/$APP/$MODULE/Create$MODULE_PASCALPage';
495
-
496
- // Dans les routes - TOUJOURS sous /business/
497
- <Route path="/business/$APP/$MODULE" element={<$MODULE_PASCALPage />} />
498
- <Route path="/business/$APP/$MODULE/new" element={<Create$MODULE_PASCALPage />} />
499
- <Route path="/business/$APP/$MODULE/:id" element={<$MODULE_PASCALDetailPage />} />
500
- <Route path="/business/$APP/$MODULE/:id/edit" element={<Create$MODULE_PASCALPage />} />
501
- ```
502
-
503
- ---
504
-
505
- ## CHECKLIST FRONTEND
506
-
507
- | Vérification | Status |
508
- |--------------|--------|
509
- | ☐ Page principale créée (sous /business/) | |
510
- | ☐ Composant ListView créé | |
511
- | ☐ Hook préférences créé | |
512
- | ☐ Service API créé (endpoint /api/business/) | |
513
- | ☐ Routes ajoutées dans App.tsx (sous /business/) | |
514
- | ☐ Utilise apiClient (pas d'appel direct) | |
515
- | ☐ Pas d'import Infrastructure | |
516
- | ☐ npm run build réussi | |
517
- | ☐ npm run lint réussi | |
1
+ # Templates Frontend - Application Skill
2
+
3
+ > Ces templates génèrent le code React/TypeScript pour les nouvelles applications/modules.
4
+ > **RAPPEL:** Toutes les pages client sont sous `/business/...`
5
+
6
+ ---
7
+
8
+ ## ARCHITECTURE FRONTEND
9
+
10
+ ```
11
+ web/smartstack-web/src/
12
+ ├── pages/business/$APP/$MODULE/
13
+ │ ├── $MODULE_PASCALPage.tsx # Page principale (liste)
14
+ │ ├── $MODULE_PASCALDetailPage.tsx # Page détail
15
+ │ └── Create$MODULE_PASCALPage.tsx # Page création
16
+ ├── components/$MODULE/
17
+ │ ├── $MODULE_PASCALListView.tsx # Composant liste réutilisable
18
+ │ ├── $MODULE_PASCALForm.tsx # Formulaire CRUD
19
+ │ └── $MODULE_PASCALFilters.tsx # Filtres
20
+ ├── components/common/
21
+ │ └── (composants partagés)
22
+ ├── hooks/
23
+ │ ├── use$MODULE_PASCALPreferences.ts # Hook préférences
24
+ │ └── use$MODULE_PASCAL.ts # Hook API
25
+ ├── services/api/
26
+ │ └── $moduleApi.ts # Service API
27
+ └── i18n/locales/
28
+ ├── fr/$module.json
29
+ ├── en/$module.json
30
+ ├── it/$module.json
31
+ └── de/$module.json
32
+ ```
33
+
34
+ ---
35
+
36
+ ## TEMPLATE: PAGE PRINCIPALE
37
+
38
+ ```tsx
39
+ // pages/business/$APP/$MODULE/$MODULE_PASCALPage.tsx
40
+
41
+ import { useTranslation } from 'react-i18next';
42
+ import { $MODULE_PASCALListView } from '@/components/$MODULE/$MODULE_PASCALListView';
43
+
44
+ export function $MODULE_PASCALPage() {
45
+ const { t } = useTranslation(['$module', 'common']);
46
+
47
+ return (
48
+ <$MODULE_PASCALListView
49
+ title={t('$module:title')}
50
+ subtitle={t('$module:subtitle')}
51
+ basePath="/business/$APP/$MODULE"
52
+ createPath="/business/$APP/$MODULE/new"
53
+ />
54
+ );
55
+ }
56
+ ```
57
+
58
+ ---
59
+
60
+ ## TEMPLATE: LISTE VIEW (Composant réutilisable)
61
+
62
+ ```tsx
63
+ // components/$MODULE/$MODULE_PASCALListView.tsx
64
+
65
+ import { useState, useEffect } from 'react';
66
+ import { useNavigate } from 'react-router-dom';
67
+ import { useTranslation } from 'react-i18next';
68
+ import { Plus, Search, MoreVertical, Pencil, Trash2 } from 'lucide-react';
69
+ import { api } from '@/services/api/apiClient';
70
+ import { use$MODULE_PASCALPreferences } from '@/hooks/use$MODULE_PASCALPreferences';
71
+ import { Pagination } from '@/components/common/Pagination';
72
+ import { ColumnSelector } from '@/components/common/ColumnSelector';
73
+ import { ViewModeToggle } from '@/components/common/ViewModeToggle';
74
+
75
+ interface $ENTITY_PASCALDto {
76
+ id: string;
77
+ name: string;
78
+ description: string | null;
79
+ isActive: boolean;
80
+ createdAt: string;
81
+ updatedAt: string | null;
82
+ }
83
+
84
+ interface PagedResult {
85
+ items: $ENTITY_PASCALDto[];
86
+ totalCount: number;
87
+ page: number;
88
+ pageSize: number;
89
+ }
90
+
91
+ interface $MODULE_PASCALListViewProps {
92
+ title: string;
93
+ subtitle?: string;
94
+ basePath: string;
95
+ createPath?: string;
96
+ }
97
+
98
+ const DEFAULT_COLUMNS = ['name', 'description', 'isActive', 'createdAt'];
99
+
100
+ export function $MODULE_PASCALListView({
101
+ title,
102
+ subtitle,
103
+ basePath,
104
+ createPath,
105
+ }: $MODULE_PASCALListViewProps) {
106
+ const { t } = useTranslation(['$module', 'common']);
107
+ const navigate = useNavigate();
108
+ const {
109
+ pageSize,
110
+ sortColumn,
111
+ sortDirection,
112
+ visibleColumns,
113
+ viewMode,
114
+ setPageSize,
115
+ setSortColumn,
116
+ setSortDirection,
117
+ setVisibleColumns,
118
+ setViewMode,
119
+ } = use$MODULE_PASCALPreferences();
120
+
121
+ const [data, setData] = useState<PagedResult | null>(null);
122
+ const [loading, setLoading] = useState(true);
123
+ const [error, setError] = useState<string | null>(null);
124
+ const [page, setPage] = useState(1);
125
+ const [searchTerm, setSearchTerm] = useState('');
126
+
127
+ useEffect(() => {
128
+ loadData();
129
+ }, [page, pageSize, sortColumn, sortDirection, searchTerm]);
130
+
131
+ const loadData = async () => {
132
+ try {
133
+ setLoading(true);
134
+ setError(null);
135
+ const params = new URLSearchParams({
136
+ page: page.toString(),
137
+ pageSize: pageSize.toString(),
138
+ sortColumn,
139
+ sortDirection,
140
+ ...(searchTerm && { searchTerm }),
141
+ });
142
+ const result = await api.get<PagedResult>(`/api/business/$MODULE?${params}`);
143
+ setData(result);
144
+ } catch (err) {
145
+ setError(t('common:errors.loadFailed'));
146
+ console.error('Failed to load $module:', err);
147
+ } finally {
148
+ setLoading(false);
149
+ }
150
+ };
151
+
152
+ const handleSort = (column: string) => {
153
+ if (sortColumn === column) {
154
+ setSortDirection(sortDirection === 'asc' ? 'desc' : 'asc');
155
+ } else {
156
+ setSortColumn(column);
157
+ setSortDirection('asc');
158
+ }
159
+ };
160
+
161
+ const handleDelete = async (id: string) => {
162
+ if (!confirm(t('common:confirmDelete'))) return;
163
+
164
+ try {
165
+ await api.delete(`/api/business/$MODULE/${id}`);
166
+ loadData();
167
+ } catch (err) {
168
+ console.error('Failed to delete:', err);
169
+ }
170
+ };
171
+
172
+ const columns = [
173
+ { key: 'name', label: t('$module:columns.name'), sortable: true },
174
+ { key: 'description', label: t('$module:columns.description'), sortable: false },
175
+ { key: 'isActive', label: t('$module:columns.status'), sortable: true },
176
+ { key: 'createdAt', label: t('$module:columns.createdAt'), sortable: true },
177
+ ];
178
+
179
+ return (
180
+ <div className="space-y-6">
181
+ {/* Header */}
182
+ <div className="flex items-center justify-between">
183
+ <div>
184
+ <h1 className="text-2xl font-bold text-[var(--text-primary)]">{title}</h1>
185
+ {subtitle && (
186
+ <p className="text-[var(--text-secondary)] mt-1">{subtitle}</p>
187
+ )}
188
+ </div>
189
+ {createPath && (
190
+ <button
191
+ onClick={() => navigate(createPath)}
192
+ className="flex items-center gap-2 px-4 py-2 bg-[var(--color-accent-500)] hover:bg-[var(--color-accent-600)] text-white font-medium transition-colors"
193
+ style={{ borderRadius: 'var(--radius-button)' }}
194
+ >
195
+ <Plus className="w-4 h-4" />
196
+ {t('common:actions.create')}
197
+ </button>
198
+ )}
199
+ </div>
200
+
201
+ {/* Toolbar */}
202
+ <div className="flex items-center justify-between gap-4">
203
+ <div className="relative flex-1 max-w-md">
204
+ <Search className="absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--text-muted)]" />
205
+ <input
206
+ type="text"
207
+ placeholder={t('common:search.placeholder')}
208
+ value={searchTerm}
209
+ onChange={(e) => setSearchTerm(e.target.value)}
210
+ className="w-full pl-10 pr-4 py-2 bg-[var(--bg-primary)] border border-[var(--border-color)] text-sm focus:outline-none focus:border-[var(--color-accent-500)]"
211
+ style={{ borderRadius: 'var(--radius-input)' }}
212
+ />
213
+ </div>
214
+ <div className="flex items-center gap-2">
215
+ <ColumnSelector
216
+ columns={columns}
217
+ visibleColumns={visibleColumns}
218
+ onChange={setVisibleColumns}
219
+ />
220
+ <ViewModeToggle value={viewMode} onChange={setViewMode} />
221
+ </div>
222
+ </div>
223
+
224
+ {/* Content */}
225
+ {loading ? (
226
+ <div className="flex items-center justify-center py-12">
227
+ <div className="animate-spin h-8 w-8 border-4 border-[var(--color-accent-500)] border-t-transparent rounded-full" />
228
+ </div>
229
+ ) : error ? (
230
+ <div className="p-4 bg-[var(--error-bg)] border border-[var(--error-border)] text-[var(--error-text)]" style={{ borderRadius: 'var(--radius-card)' }}>
231
+ {error}
232
+ </div>
233
+ ) : viewMode === 'list' ? (
234
+ <div className="bg-[var(--bg-card)] border border-[var(--item-color-border)] overflow-hidden" style={{ borderRadius: 'var(--radius-card)' }}>
235
+ <table className="w-full">
236
+ <thead>
237
+ <tr className="border-b border-[var(--item-color-border)]">
238
+ {columns.filter(col => visibleColumns.includes(col.key)).map((col) => (
239
+ <th
240
+ key={col.key}
241
+ className={`px-4 py-3 text-left text-sm font-medium text-[var(--text-secondary)] ${
242
+ col.sortable ? 'cursor-pointer hover:text-[var(--text-primary)]' : ''
243
+ }`}
244
+ onClick={() => col.sortable && handleSort(col.key)}
245
+ >
246
+ {col.label}
247
+ {sortColumn === col.key && (
248
+ <span className="ml-1">{sortDirection === 'asc' ? '↑' : '↓'}</span>
249
+ )}
250
+ </th>
251
+ ))}
252
+ <th className="px-4 py-3 text-right text-sm font-medium text-[var(--text-secondary)]">
253
+ {t('common:actions.title')}
254
+ </th>
255
+ </tr>
256
+ </thead>
257
+ <tbody>
258
+ {data?.items.map((item) => (
259
+ <tr
260
+ key={item.id}
261
+ className="border-b border-[var(--item-color-border)] hover:bg-[var(--bg-hover)] cursor-pointer"
262
+ onClick={() => navigate(`${basePath}/${item.id}`)}
263
+ >
264
+ {visibleColumns.includes('name') && (
265
+ <td className="px-4 py-3 text-sm text-[var(--text-primary)] font-medium">
266
+ {item.name}
267
+ </td>
268
+ )}
269
+ {visibleColumns.includes('description') && (
270
+ <td className="px-4 py-3 text-sm text-[var(--text-secondary)]">
271
+ {item.description || '-'}
272
+ </td>
273
+ )}
274
+ {visibleColumns.includes('isActive') && (
275
+ <td className="px-4 py-3">
276
+ <span
277
+ className={`inline-flex items-center px-2 py-1 text-xs font-medium ${
278
+ item.isActive
279
+ ? 'bg-green-100 text-green-800'
280
+ : 'bg-gray-100 text-gray-800'
281
+ }`}
282
+ style={{ borderRadius: 'var(--radius-badge)' }}
283
+ >
284
+ {item.isActive ? t('common:status.active') : t('common:status.inactive')}
285
+ </span>
286
+ </td>
287
+ )}
288
+ {visibleColumns.includes('createdAt') && (
289
+ <td className="px-4 py-3 text-sm text-[var(--text-secondary)]">
290
+ {new Date(item.createdAt).toLocaleDateString()}
291
+ </td>
292
+ )}
293
+ <td className="px-4 py-3 text-right">
294
+ <div className="flex items-center justify-end gap-2">
295
+ <button
296
+ onClick={(e) => {
297
+ e.stopPropagation();
298
+ navigate(`${basePath}/${item.id}/edit`);
299
+ }}
300
+ className="p-1 hover:bg-[var(--bg-tertiary)]"
301
+ style={{ borderRadius: 'var(--radius-button)' }}
302
+ >
303
+ <Pencil className="w-4 h-4 text-[var(--text-secondary)]" />
304
+ </button>
305
+ <button
306
+ onClick={(e) => {
307
+ e.stopPropagation();
308
+ handleDelete(item.id);
309
+ }}
310
+ className="p-1 hover:bg-[var(--error-bg)]"
311
+ style={{ borderRadius: 'var(--radius-button)' }}
312
+ >
313
+ <Trash2 className="w-4 h-4 text-[var(--error-text)]" />
314
+ </button>
315
+ </div>
316
+ </td>
317
+ </tr>
318
+ ))}
319
+ </tbody>
320
+ </table>
321
+ </div>
322
+ ) : (
323
+ /* Grid view */
324
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
325
+ {data?.items.map((item) => (
326
+ <div
327
+ key={item.id}
328
+ className="bg-[var(--bg-card)] border border-[var(--item-color-border)] p-4 hover:border-[var(--color-accent-500)] cursor-pointer transition-colors"
329
+ style={{ borderRadius: 'var(--radius-card)' }}
330
+ onClick={() => navigate(`${basePath}/${item.id}`)}
331
+ >
332
+ <h3 className="font-medium text-[var(--text-primary)]">{item.name}</h3>
333
+ <p className="text-sm text-[var(--text-secondary)] mt-1 line-clamp-2">
334
+ {item.description || '-'}
335
+ </p>
336
+ <div className="flex items-center justify-between mt-3">
337
+ <span
338
+ className={`inline-flex items-center px-2 py-1 text-xs font-medium ${
339
+ item.isActive
340
+ ? 'bg-green-100 text-green-800'
341
+ : 'bg-gray-100 text-gray-800'
342
+ }`}
343
+ style={{ borderRadius: 'var(--radius-badge)' }}
344
+ >
345
+ {item.isActive ? t('common:status.active') : t('common:status.inactive')}
346
+ </span>
347
+ <span className="text-xs text-[var(--text-muted)]">
348
+ {new Date(item.createdAt).toLocaleDateString()}
349
+ </span>
350
+ </div>
351
+ </div>
352
+ ))}
353
+ </div>
354
+ )}
355
+
356
+ {/* Pagination */}
357
+ {data && (
358
+ <Pagination
359
+ page={data.page}
360
+ pageSize={data.pageSize}
361
+ totalCount={data.totalCount}
362
+ onPageChange={setPage}
363
+ onPageSizeChange={setPageSize}
364
+ />
365
+ )}
366
+ </div>
367
+ );
368
+ }
369
+ ```
370
+
371
+ ---
372
+
373
+ ## TEMPLATE: HOOK PRÉFÉRENCES
374
+
375
+ ```tsx
376
+ // hooks/use$MODULE_PASCALPreferences.ts
377
+
378
+ import { useUserPreferences } from '@/contexts/UserPreferencesContext';
379
+
380
+ const DEFAULT_COLUMNS = ['name', 'description', 'isActive', 'createdAt'];
381
+
382
+ export function use$MODULE_PASCALPreferences() {
383
+ const { preferences, updatePreference } = useUserPreferences();
384
+ const modulePrefs = preferences.$module || {};
385
+
386
+ return {
387
+ // Getters with defaults
388
+ pageSize: modulePrefs.pageSize ?? 10,
389
+ sortColumn: modulePrefs.sortColumn ?? 'createdAt',
390
+ sortDirection: modulePrefs.sortDirection ?? 'desc',
391
+ filters: modulePrefs.filters ?? {},
392
+ visibleColumns: modulePrefs.visibleColumns ?? DEFAULT_COLUMNS,
393
+ viewMode: modulePrefs.viewMode ?? 'list',
394
+
395
+ // Setters
396
+ setPageSize: (size: number) =>
397
+ updatePreference('$module.pageSize', size),
398
+ setSortColumn: (col: string) =>
399
+ updatePreference('$module.sortColumn', col),
400
+ setSortDirection: (dir: 'asc' | 'desc') =>
401
+ updatePreference('$module.sortDirection', dir),
402
+ setFilters: (filters: Record<string, unknown>) =>
403
+ updatePreference('$module.filters', filters),
404
+ setVisibleColumns: (cols: string[]) =>
405
+ updatePreference('$module.visibleColumns', cols),
406
+ setViewMode: (mode: 'list' | 'grid') =>
407
+ updatePreference('$module.viewMode', mode),
408
+ };
409
+ }
410
+ ```
411
+
412
+ ---
413
+
414
+ ## TEMPLATE: SERVICE API
415
+
416
+ ```tsx
417
+ // services/api/$moduleApi.ts
418
+
419
+ import { api } from './apiClient';
420
+
421
+ export interface $ENTITY_PASCALDto {
422
+ id: string;
423
+ name: string;
424
+ description: string | null;
425
+ isActive: boolean;
426
+ createdAt: string;
427
+ updatedAt: string | null;
428
+ }
429
+
430
+ export interface Create$ENTITY_PASCALRequest {
431
+ name: string;
432
+ description?: string;
433
+ }
434
+
435
+ export interface Update$ENTITY_PASCALRequest {
436
+ name: string;
437
+ description?: string;
438
+ }
439
+
440
+ export interface PagedResult<T> {
441
+ items: T[];
442
+ totalCount: number;
443
+ page: number;
444
+ pageSize: number;
445
+ }
446
+
447
+ export interface QueryParameters {
448
+ page?: number;
449
+ pageSize?: number;
450
+ searchTerm?: string;
451
+ sortColumn?: string;
452
+ sortDirection?: 'asc' | 'desc';
453
+ }
454
+
455
+ export const $moduleApi = {
456
+ getAll: async (params: QueryParameters = {}): Promise<PagedResult<$ENTITY_PASCALDto>> => {
457
+ const queryParams = new URLSearchParams();
458
+ if (params.page) queryParams.set('page', params.page.toString());
459
+ if (params.pageSize) queryParams.set('pageSize', params.pageSize.toString());
460
+ if (params.searchTerm) queryParams.set('searchTerm', params.searchTerm);
461
+ if (params.sortColumn) queryParams.set('sortColumn', params.sortColumn);
462
+ if (params.sortDirection) queryParams.set('sortDirection', params.sortDirection);
463
+
464
+ return api.get(`/api/business/$MODULE?${queryParams}`);
465
+ },
466
+
467
+ getById: async (id: string): Promise<$ENTITY_PASCALDto> => {
468
+ return api.get(`/api/business/$MODULE/${id}`);
469
+ },
470
+
471
+ create: async (data: Create$ENTITY_PASCALRequest): Promise<$ENTITY_PASCALDto> => {
472
+ return api.post('/api/business/$MODULE', data);
473
+ },
474
+
475
+ update: async (id: string, data: Update$ENTITY_PASCALRequest): Promise<$ENTITY_PASCALDto> => {
476
+ return api.put(`/api/business/$MODULE/${id}`, data);
477
+ },
478
+
479
+ delete: async (id: string): Promise<void> => {
480
+ return api.delete(`/api/business/$MODULE/${id}`);
481
+ },
482
+ };
483
+ ```
484
+
485
+ ---
486
+
487
+ ## TEMPLATE: ROUTES (App.tsx)
488
+
489
+ ```tsx
490
+ // Ajouter dans App.tsx
491
+
492
+ import { $MODULE_PASCALPage } from '@/pages/business/$APP/$MODULE/$MODULE_PASCALPage';
493
+ import { $MODULE_PASCALDetailPage } from '@/pages/business/$APP/$MODULE/$MODULE_PASCALDetailPage';
494
+ import { Create$MODULE_PASCALPage } from '@/pages/business/$APP/$MODULE/Create$MODULE_PASCALPage';
495
+
496
+ // Dans les routes - TOUJOURS sous /business/
497
+ <Route path="/business/$APP/$MODULE" element={<$MODULE_PASCALPage />} />
498
+ <Route path="/business/$APP/$MODULE/new" element={<Create$MODULE_PASCALPage />} />
499
+ <Route path="/business/$APP/$MODULE/:id" element={<$MODULE_PASCALDetailPage />} />
500
+ <Route path="/business/$APP/$MODULE/:id/edit" element={<Create$MODULE_PASCALPage />} />
501
+ ```
502
+
503
+ ---
504
+
505
+ ## CHECKLIST FRONTEND
506
+
507
+ | Vérification | Status |
508
+ |--------------|--------|
509
+ | ☐ Page principale créée (sous /business/) | |
510
+ | ☐ Composant ListView créé | |
511
+ | ☐ Hook préférences créé | |
512
+ | ☐ Service API créé (endpoint /api/business/) | |
513
+ | ☐ Routes ajoutées dans App.tsx (sous /business/) | |
514
+ | ☐ Utilise apiClient (pas d'appel direct) | |
515
+ | ☐ Pas d'import Infrastructure | |
516
+ | ☐ npm run build réussi | |
517
+ | ☐ npm run lint réussi | |