@atlashub/smartstack-cli 1.5.1 → 1.5.3

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,647 +1,647 @@
1
- # Templates DB Seed - Application Skill
2
-
3
- > Ces templates génèrent les seeds EF Core pour les entités de navigation et leurs traductions.
4
-
5
- ---
6
-
7
- ## RÈGLES DE GÉNÉRATION GUID
8
-
9
- ```csharp
10
- // JAMAIS de GUIDs séquentiels générés par NewGuid()
11
- // TOUJOURS utiliser la méthode déterministe
12
-
13
- private static Guid GenerateGuid(int index)
14
- {
15
- // Format: 11111111-1111-1111-1111-{index:D12}
16
- return Guid.Parse($"11111111-1111-1111-1111-{index:D12}");
17
- }
18
-
19
- // Pour les seeds existants, continuer la séquence
20
- // Vérifier le dernier index utilisé dans NavigationTranslationConfiguration.cs
21
- ```
22
-
23
- ---
24
-
25
- ## TEMPLATE: CONTEXT
26
-
27
- ### Navigation Entity
28
-
29
- ```csharp
30
- // Dans NavigationContextConfiguration.cs - HasData()
31
- new {
32
- Id = Guid.Parse("$CONTEXT_GUID"),
33
- Code = "$CODE", // ex: "erp"
34
- Label = "$LABEL_FR", // ex: "ERP"
35
- Description = "$DESC_FR", // ex: "Gestion d'entreprise"
36
- Icon = "$ICON", // ex: "Building2"
37
- IconType = IconType.Lucide,
38
- Route = "/$CODE", // ex: "/erp"
39
- DisplayOrder = $ORDER, // ex: 4
40
- IsActive = true,
41
- CreatedAt = seedDate
42
- }
43
- ```
44
-
45
- ### Translations (4 langues)
46
-
47
- ```csharp
48
- // Dans NavigationTranslationConfiguration.cs - GetSeedData()
49
- // Context translations
50
- translations.Add(new {
51
- Id = GenerateGuid(index++),
52
- EntityType = NavigationEntityType.Context,
53
- EntityId = $CONTEXT_GUID,
54
- LanguageCode = "fr",
55
- Label = "$LABEL_FR",
56
- Description = "$DESC_FR",
57
- CreatedAt = seedDate
58
- });
59
- translations.Add(new {
60
- Id = GenerateGuid(index++),
61
- EntityType = NavigationEntityType.Context,
62
- EntityId = $CONTEXT_GUID,
63
- LanguageCode = "en",
64
- Label = "$LABEL_EN",
65
- Description = "$DESC_EN",
66
- CreatedAt = seedDate
67
- });
68
- translations.Add(new {
69
- Id = GenerateGuid(index++),
70
- EntityType = NavigationEntityType.Context,
71
- EntityId = $CONTEXT_GUID,
72
- LanguageCode = "it",
73
- Label = "$LABEL_IT",
74
- Description = "$DESC_IT",
75
- CreatedAt = seedDate
76
- });
77
- translations.Add(new {
78
- Id = GenerateGuid(index++),
79
- EntityType = NavigationEntityType.Context,
80
- EntityId = $CONTEXT_GUID,
81
- LanguageCode = "de",
82
- Label = "$LABEL_DE",
83
- Description = "$DESC_DE",
84
- CreatedAt = seedDate
85
- });
86
- ```
87
-
88
- ---
89
-
90
- ## TEMPLATE: APPLICATION
91
-
92
- ### Navigation Entity
93
-
94
- ```csharp
95
- // Dans NavigationApplicationConfiguration.cs - HasData()
96
- new {
97
- Id = Guid.Parse("$APP_GUID"),
98
- ContextId = Guid.Parse("$CONTEXT_GUID"),
99
- Code = "$CODE", // ex: "sales"
100
- Label = "$LABEL_FR", // ex: "Ventes"
101
- Description = "$DESC_FR", // ex: "Gestion des ventes"
102
- Icon = "$ICON", // ex: "TrendingUp"
103
- IconType = IconType.Lucide,
104
- Route = "/$CONTEXT/$CODE", // ex: "/erp/sales"
105
- DisplayOrder = $ORDER,
106
- IsActive = true,
107
- CreatedAt = seedDate
108
- }
109
- ```
110
-
111
- ### Translations (4 langues)
112
-
113
- ```csharp
114
- // Application translations
115
- translations.Add(new {
116
- Id = GenerateGuid(index++),
117
- EntityType = NavigationEntityType.Application,
118
- EntityId = $APP_GUID,
119
- LanguageCode = "fr",
120
- Label = "$LABEL_FR",
121
- Description = "$DESC_FR",
122
- CreatedAt = seedDate
123
- });
124
- translations.Add(new {
125
- Id = GenerateGuid(index++),
126
- EntityType = NavigationEntityType.Application,
127
- EntityId = $APP_GUID,
128
- LanguageCode = "en",
129
- Label = "$LABEL_EN",
130
- Description = "$DESC_EN",
131
- CreatedAt = seedDate
132
- });
133
- translations.Add(new {
134
- Id = GenerateGuid(index++),
135
- EntityType = NavigationEntityType.Application,
136
- EntityId = $APP_GUID,
137
- LanguageCode = "it",
138
- Label = "$LABEL_IT",
139
- Description = "$DESC_IT",
140
- CreatedAt = seedDate
141
- });
142
- translations.Add(new {
143
- Id = GenerateGuid(index++),
144
- EntityType = NavigationEntityType.Application,
145
- EntityId = $APP_GUID,
146
- LanguageCode = "de",
147
- Label = "$LABEL_DE",
148
- Description = "$DESC_DE",
149
- CreatedAt = seedDate
150
- });
151
- ```
152
-
153
- ---
154
-
155
- ## TEMPLATE: MODULE
156
-
157
- ### Navigation Entity
158
-
159
- ```csharp
160
- // Dans NavigationModuleConfiguration.cs - HasData()
161
- new {
162
- Id = Guid.Parse("$MODULE_GUID"),
163
- ApplicationId = Guid.Parse("$APP_GUID"),
164
- Code = "$CODE", // ex: "products"
165
- Label = "$LABEL_FR", // ex: "Produits"
166
- Description = "$DESC_FR", // ex: "Gestion des produits"
167
- Icon = "$ICON", // ex: "Package"
168
- IconType = IconType.Lucide,
169
- Route = "/$CONTEXT/$APP/$CODE", // ex: "/erp/sales/products"
170
- DisplayOrder = $ORDER,
171
- IsActive = true,
172
- CreatedAt = seedDate
173
- }
174
- ```
175
-
176
- ### Translations (4 langues)
177
-
178
- ```csharp
179
- // Module translations
180
- translations.Add(new {
181
- Id = GenerateGuid(index++),
182
- EntityType = NavigationEntityType.Module,
183
- EntityId = $MODULE_GUID,
184
- LanguageCode = "fr",
185
- Label = "$LABEL_FR",
186
- Description = "$DESC_FR",
187
- CreatedAt = seedDate
188
- });
189
- translations.Add(new {
190
- Id = GenerateGuid(index++),
191
- EntityType = NavigationEntityType.Module,
192
- EntityId = $MODULE_GUID,
193
- LanguageCode = "en",
194
- Label = "$LABEL_EN",
195
- Description = "$DESC_EN",
196
- CreatedAt = seedDate
197
- });
198
- translations.Add(new {
199
- Id = GenerateGuid(index++),
200
- EntityType = NavigationEntityType.Module,
201
- EntityId = $MODULE_GUID,
202
- LanguageCode = "it",
203
- Label = "$LABEL_IT",
204
- Description = "$DESC_IT",
205
- CreatedAt = seedDate
206
- });
207
- translations.Add(new {
208
- Id = GenerateGuid(index++),
209
- EntityType = NavigationEntityType.Module,
210
- EntityId = $MODULE_GUID,
211
- LanguageCode = "de",
212
- Label = "$LABEL_DE",
213
- Description = "$DESC_DE",
214
- CreatedAt = seedDate
215
- });
216
- ```
217
-
218
- ---
219
-
220
- ## TEMPLATE: SECTION
221
-
222
- ### Navigation Entity
223
-
224
- ```csharp
225
- // Dans NavigationSectionConfiguration.cs - HasData()
226
- new {
227
- Id = Guid.Parse("$SECTION_GUID"),
228
- ModuleId = Guid.Parse("$MODULE_GUID"),
229
- Code = "$CODE", // ex: "inventory"
230
- Label = "$LABEL_FR", // ex: "Inventaire"
231
- Description = "$DESC_FR", // ex: "Gestion des stocks"
232
- Icon = "$ICON", // ex: "Warehouse"
233
- IconType = IconType.Lucide,
234
- Route = "/$CONTEXT/$APP/$MODULE/$CODE", // ex: "/erp/sales/products/inventory"
235
- DisplayOrder = $ORDER,
236
- IsActive = true,
237
- CreatedAt = seedDate
238
- }
239
- ```
240
-
241
- ### Translations (4 langues)
242
-
243
- ```csharp
244
- // Section translations
245
- translations.Add(new {
246
- Id = GenerateGuid(index++),
247
- EntityType = NavigationEntityType.Section,
248
- EntityId = $SECTION_GUID,
249
- LanguageCode = "fr",
250
- Label = "$LABEL_FR",
251
- Description = "$DESC_FR",
252
- CreatedAt = seedDate
253
- });
254
- translations.Add(new {
255
- Id = GenerateGuid(index++),
256
- EntityType = NavigationEntityType.Section,
257
- EntityId = $SECTION_GUID,
258
- LanguageCode = "en",
259
- Label = "$LABEL_EN",
260
- Description = "$DESC_EN",
261
- CreatedAt = seedDate
262
- });
263
- translations.Add(new {
264
- Id = GenerateGuid(index++),
265
- EntityType = NavigationEntityType.Section,
266
- EntityId = $SECTION_GUID,
267
- LanguageCode = "it",
268
- Label = "$LABEL_IT",
269
- Description = "$DESC_IT",
270
- CreatedAt = seedDate
271
- });
272
- translations.Add(new {
273
- Id = GenerateGuid(index++),
274
- EntityType = NavigationEntityType.Section,
275
- EntityId = $SECTION_GUID,
276
- LanguageCode = "de",
277
- Label = "$LABEL_DE",
278
- Description = "$DESC_DE",
279
- CreatedAt = seedDate
280
- });
281
- ```
282
-
283
- ---
284
-
285
- ## TEMPLATE: PERMISSIONS SEED
286
-
287
- ### Permission Entity
288
-
289
- ```csharp
290
- // Dans PermissionConfiguration.cs - HasData()
291
- // Pour chaque action CRUD + assign + execute
292
-
293
- // Read
294
- new {
295
- Id = Guid.Parse("$PERM_READ_GUID"),
296
- Code = "$CONTEXT.$APP.$MODULE.read",
297
- Name = "View $MODULE_LABEL",
298
- Description = "View $MODULE_LABEL list and details",
299
- Category = "$CONTEXT.$APP.$MODULE",
300
- CreatedAt = seedDate
301
- },
302
- // Create
303
- new {
304
- Id = Guid.Parse("$PERM_CREATE_GUID"),
305
- Code = "$CONTEXT.$APP.$MODULE.create",
306
- Name = "Create $MODULE_LABEL",
307
- Description = "Create new $MODULE_LABEL",
308
- Category = "$CONTEXT.$APP.$MODULE",
309
- CreatedAt = seedDate
310
- },
311
- // Update
312
- new {
313
- Id = Guid.Parse("$PERM_UPDATE_GUID"),
314
- Code = "$CONTEXT.$APP.$MODULE.update",
315
- Name = "Update $MODULE_LABEL",
316
- Description = "Modify existing $MODULE_LABEL",
317
- Category = "$CONTEXT.$APP.$MODULE",
318
- CreatedAt = seedDate
319
- },
320
- // Delete
321
- new {
322
- Id = Guid.Parse("$PERM_DELETE_GUID"),
323
- Code = "$CONTEXT.$APP.$MODULE.delete",
324
- Name = "Delete $MODULE_LABEL",
325
- Description = "Remove $MODULE_LABEL",
326
- Category = "$CONTEXT.$APP.$MODULE",
327
- CreatedAt = seedDate
328
- }
329
- ```
330
-
331
- ### RolePermission Seed (Default Roles)
332
-
333
- ```csharp
334
- // Dans RolePermissionConfiguration.cs - HasData()
335
- // SuperAdmin gets all permissions automatically (wildcard)
336
-
337
- // PlatformAdmin - if platform context
338
- new { RoleId = Guid.Parse("...PlatformAdminRoleId..."), PermissionId = $PERM_READ_GUID },
339
- new { RoleId = Guid.Parse("...PlatformAdminRoleId..."), PermissionId = $PERM_CREATE_GUID },
340
- new { RoleId = Guid.Parse("...PlatformAdminRoleId..."), PermissionId = $PERM_UPDATE_GUID },
341
- new { RoleId = Guid.Parse("...PlatformAdminRoleId..."), PermissionId = $PERM_DELETE_GUID },
342
-
343
- // StandardUser - read only by default
344
- new { RoleId = Guid.Parse("...StandardUserRoleId..."), PermissionId = $PERM_READ_GUID }
345
- ```
346
-
347
- ---
348
-
349
- ## TEMPLATE: SECTION PERMISSIONS SEED (Level 4)
350
-
351
- > **Usage:** Quand un Module a des sous-pages avec permissions différentes
352
-
353
- ### Permission Entity - Section Level
354
-
355
- ```csharp
356
- // Dans PermissionConfiguration.cs - HasData()
357
- // Pattern: {context}.{application}.{module}.{section}.{action}
358
-
359
- // Déclarer le SectionId (doit correspondre à NavigationSectionConfiguration.cs)
360
- var {section}SectionId = Guid.Parse("$SECTION_GUID");
361
-
362
- // Wildcard Section
363
- new {
364
- Id = Guid.Parse("$PERM_SECTION_WILDCARD_GUID"),
365
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.*",
366
- Level = PermissionLevel.Section,
367
- IsWildcard = true,
368
- SectionId = {section}SectionId,
369
- Description = "Full $SECTION_LABEL access",
370
- CreatedAt = seedDate
371
- },
372
- // Read
373
- new {
374
- Id = Guid.Parse("$PERM_SECTION_READ_GUID"),
375
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.read",
376
- Level = PermissionLevel.Section,
377
- Action = PermissionAction.Read,
378
- IsWildcard = false,
379
- SectionId = {section}SectionId,
380
- Description = "View $SECTION_LABEL",
381
- CreatedAt = seedDate
382
- },
383
- // Create
384
- new {
385
- Id = Guid.Parse("$PERM_SECTION_CREATE_GUID"),
386
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.create",
387
- Level = PermissionLevel.Section,
388
- Action = PermissionAction.Create,
389
- IsWildcard = false,
390
- SectionId = {section}SectionId,
391
- Description = "Create in $SECTION_LABEL",
392
- CreatedAt = seedDate
393
- },
394
- // Update
395
- new {
396
- Id = Guid.Parse("$PERM_SECTION_UPDATE_GUID"),
397
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.update",
398
- Level = PermissionLevel.Section,
399
- Action = PermissionAction.Update,
400
- IsWildcard = false,
401
- SectionId = {section}SectionId,
402
- Description = "Update in $SECTION_LABEL",
403
- CreatedAt = seedDate
404
- },
405
- // Delete
406
- new {
407
- Id = Guid.Parse("$PERM_SECTION_DELETE_GUID"),
408
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.delete",
409
- Level = PermissionLevel.Section,
410
- Action = PermissionAction.Delete,
411
- IsWildcard = false,
412
- SectionId = {section}SectionId,
413
- Description = "Delete in $SECTION_LABEL",
414
- CreatedAt = seedDate
415
- },
416
- // Execute (optionnel)
417
- new {
418
- Id = Guid.Parse("$PERM_SECTION_EXECUTE_GUID"),
419
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.execute",
420
- Level = PermissionLevel.Section,
421
- Action = PermissionAction.Execute,
422
- IsWildcard = false,
423
- SectionId = {section}SectionId,
424
- Description = "Execute actions in $SECTION_LABEL",
425
- CreatedAt = seedDate
426
- }
427
- ```
428
-
429
- ---
430
-
431
- ## TEMPLATE: RESOURCE PERMISSIONS SEED (Level 5)
432
-
433
- > **Usage:** Niveau le plus fin - sous-ressources avec permissions distinctes (ex: Prompts → Blocks)
434
-
435
- ### Permission Entity - Resource Level
436
-
437
- ```csharp
438
- // Dans PermissionConfiguration.cs - HasData()
439
- // Pattern: {context}.{application}.{module}.{section}.{resource}.{action}
440
-
441
- // Déclarer le ResourceId (doit correspondre à NavigationResourceConfiguration.cs)
442
- var {resource}ResourceId = Guid.Parse("$RESOURCE_GUID");
443
-
444
- // Wildcard Resource
445
- new {
446
- Id = Guid.Parse("$PERM_RESOURCE_WILDCARD_GUID"),
447
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.*",
448
- Level = PermissionLevel.Resource,
449
- IsWildcard = true,
450
- ResourceId = {resource}ResourceId,
451
- Description = "Full $RESOURCE_LABEL access",
452
- CreatedAt = seedDate
453
- },
454
- // Read
455
- new {
456
- Id = Guid.Parse("$PERM_RESOURCE_READ_GUID"),
457
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.read",
458
- Level = PermissionLevel.Resource,
459
- Action = PermissionAction.Read,
460
- IsWildcard = false,
461
- ResourceId = {resource}ResourceId,
462
- Description = "View $RESOURCE_LABEL",
463
- CreatedAt = seedDate
464
- },
465
- // Create
466
- new {
467
- Id = Guid.Parse("$PERM_RESOURCE_CREATE_GUID"),
468
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.create",
469
- Level = PermissionLevel.Resource,
470
- Action = PermissionAction.Create,
471
- IsWildcard = false,
472
- ResourceId = {resource}ResourceId,
473
- Description = "Create $RESOURCE_LABEL",
474
- CreatedAt = seedDate
475
- },
476
- // Update
477
- new {
478
- Id = Guid.Parse("$PERM_RESOURCE_UPDATE_GUID"),
479
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.update",
480
- Level = PermissionLevel.Resource,
481
- Action = PermissionAction.Update,
482
- IsWildcard = false,
483
- ResourceId = {resource}ResourceId,
484
- Description = "Update $RESOURCE_LABEL",
485
- CreatedAt = seedDate
486
- },
487
- // Delete
488
- new {
489
- Id = Guid.Parse("$PERM_RESOURCE_DELETE_GUID"),
490
- Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.delete",
491
- Level = PermissionLevel.Resource,
492
- Action = PermissionAction.Delete,
493
- IsWildcard = false,
494
- ResourceId = {resource}ResourceId,
495
- Description = "Delete $RESOURCE_LABEL",
496
- CreatedAt = seedDate
497
- }
498
- ```
499
-
500
- ---
501
-
502
- ## TEMPLATE: BULK OPERATIONS PERMISSIONS
503
-
504
- > **OBLIGATOIRE:** Toujours prévoir pour les modules CRUD
505
-
506
- ### Permission Entity - Bulk Operations
507
-
508
- ```csharp
509
- // Dans PermissionConfiguration.cs - HasData()
510
- // Ajouter après les permissions CRUD standard
511
-
512
- // Bulk Create
513
- new {
514
- Id = Guid.Parse("$PERM_BULK_CREATE_GUID"),
515
- Path = "$CONTEXT.$APP.$MODULE.bulk-create",
516
- Level = PermissionLevel.Module,
517
- Action = PermissionAction.Create,
518
- IsWildcard = false,
519
- ModuleId = {module}ModuleId,
520
- Description = "Bulk create $MODULE_LABEL",
521
- CreatedAt = seedDate
522
- },
523
- // Bulk Update
524
- new {
525
- Id = Guid.Parse("$PERM_BULK_UPDATE_GUID"),
526
- Path = "$CONTEXT.$APP.$MODULE.bulk-update",
527
- Level = PermissionLevel.Module,
528
- Action = PermissionAction.Update,
529
- IsWildcard = false,
530
- ModuleId = {module}ModuleId,
531
- Description = "Bulk update $MODULE_LABEL",
532
- CreatedAt = seedDate
533
- },
534
- // Bulk Delete
535
- new {
536
- Id = Guid.Parse("$PERM_BULK_DELETE_GUID"),
537
- Path = "$CONTEXT.$APP.$MODULE.bulk-delete",
538
- Level = PermissionLevel.Module,
539
- Action = PermissionAction.Delete,
540
- IsWildcard = false,
541
- ModuleId = {module}ModuleId,
542
- Description = "Bulk delete $MODULE_LABEL",
543
- CreatedAt = seedDate
544
- },
545
- // Export
546
- new {
547
- Id = Guid.Parse("$PERM_EXPORT_GUID"),
548
- Path = "$CONTEXT.$APP.$MODULE.export",
549
- Level = PermissionLevel.Module,
550
- Action = PermissionAction.Execute,
551
- IsWildcard = false,
552
- ModuleId = {module}ModuleId,
553
- Description = "Export $MODULE_LABEL data",
554
- CreatedAt = seedDate
555
- },
556
- // Import
557
- new {
558
- Id = Guid.Parse("$PERM_IMPORT_GUID"),
559
- Path = "$CONTEXT.$APP.$MODULE.import",
560
- Level = PermissionLevel.Module,
561
- Action = PermissionAction.Create,
562
- IsWildcard = false,
563
- ModuleId = {module}ModuleId,
564
- Description = "Import $MODULE_LABEL data",
565
- CreatedAt = seedDate
566
- }
567
- ```
568
-
569
- ---
570
-
571
- ## EXEMPLE COMPLET: Module "Products" dans "ERP > Sales"
572
-
573
- ### Variables
574
-
575
- ```
576
- $CONTEXT = erp
577
- $CONTEXT_GUID = e1e1e1e1-1111-1111-1111-111111111111
578
- $APP = sales
579
- $APP_GUID = e2e2e2e2-2222-2222-2222-222222222222
580
- $MODULE = products
581
- $MODULE_GUID = e3e3e3e3-3333-3333-3333-333333333333
582
-
583
- $LABEL_FR = Produits
584
- $LABEL_EN = Products
585
- $LABEL_IT = Prodotti
586
- $LABEL_DE = Produkte
587
-
588
- $DESC_FR = Gestion des produits
589
- $DESC_EN = Product management
590
- $DESC_IT = Gestione prodotti
591
- $DESC_DE = Produktverwaltung
592
-
593
- $ICON = Package
594
- $ORDER = 1
595
- ```
596
-
597
- ### Fichiers à modifier
598
-
599
- 1. `NavigationContextConfiguration.cs` - Ajouter context ERP (si nouveau)
600
- 2. `NavigationApplicationConfiguration.cs` - Ajouter application Sales
601
- 3. `NavigationModuleConfiguration.cs` - Ajouter module Products
602
- 4. `NavigationTranslationConfiguration.cs` - Ajouter 4 traductions × nombre d'entités
603
- 5. `PermissionConfiguration.cs` - Ajouter permissions CRUD
604
- 6. `RolePermissionConfiguration.cs` - Assigner aux rôles par défaut
605
-
606
- ---
607
-
608
- ## CHECKLIST SEED
609
-
610
- | Vérification | Status |
611
- |--------------|--------|
612
- | ☐ GUID déterministe (pas NewGuid) | |
613
- | ☐ 4 langues pour chaque entité | |
614
- | ☐ Index translations continue la séquence existante | |
615
- | ☐ Route alignée avec permission path | |
616
- | ☐ DisplayOrder cohérent | |
617
- | ☐ Permissions CRUD créées (Level 3 - Module) | |
618
- | ☐ Permissions Section si sous-pages (Level 4) | |
619
- | ☐ Permissions Resource si sous-ressources (Level 5) | |
620
- | ☐ Permissions Bulk Operations créées | |
621
- | ☐ RolePermissions assignés | |
622
-
623
- ---
624
-
625
- ## HIÉRARCHIE DES PERMISSIONS (5 Niveaux)
626
-
627
- ```
628
- Level 1: CONTEXT
629
- └─ Path: {context}.*
630
- └─ Ex: platform.* → Accès complet au context
631
-
632
- Level 2: APPLICATION
633
- └─ Path: {context}.{application}.*
634
- └─ Ex: platform.administration.* → Accès complet à l'app
635
-
636
- Level 3: MODULE
637
- └─ Path: {context}.{application}.{module}.{action}
638
- └─ Ex: platform.administration.users.read
639
-
640
- Level 4: SECTION
641
- └─ Path: {context}.{application}.{module}.{section}.{action}
642
- └─ Ex: platform.administration.ai.settings.update
643
-
644
- Level 5: RESOURCE (finest granularity)
645
- └─ Path: {context}.{application}.{module}.{section}.{resource}.{action}
646
- └─ Ex: platform.administration.ai.prompts.blocks.delete
647
- ```
1
+ # Templates DB Seed - Application Skill
2
+
3
+ > Ces templates génèrent les seeds EF Core pour les entités de navigation et leurs traductions.
4
+
5
+ ---
6
+
7
+ ## RÈGLES DE GÉNÉRATION GUID
8
+
9
+ ```csharp
10
+ // JAMAIS de GUIDs séquentiels générés par NewGuid()
11
+ // TOUJOURS utiliser la méthode déterministe
12
+
13
+ private static Guid GenerateGuid(int index)
14
+ {
15
+ // Format: 11111111-1111-1111-1111-{index:D12}
16
+ return Guid.Parse($"11111111-1111-1111-1111-{index:D12}");
17
+ }
18
+
19
+ // Pour les seeds existants, continuer la séquence
20
+ // Vérifier le dernier index utilisé dans NavigationTranslationConfiguration.cs
21
+ ```
22
+
23
+ ---
24
+
25
+ ## TEMPLATE: CONTEXT
26
+
27
+ ### Navigation Entity
28
+
29
+ ```csharp
30
+ // Dans NavigationContextConfiguration.cs - HasData()
31
+ new {
32
+ Id = Guid.Parse("$CONTEXT_GUID"),
33
+ Code = "$CODE", // ex: "erp"
34
+ Label = "$LABEL_FR", // ex: "ERP"
35
+ Description = "$DESC_FR", // ex: "Gestion d'entreprise"
36
+ Icon = "$ICON", // ex: "Building2"
37
+ IconType = IconType.Lucide,
38
+ Route = "/$CODE", // ex: "/erp"
39
+ DisplayOrder = $ORDER, // ex: 4
40
+ IsActive = true,
41
+ CreatedAt = seedDate
42
+ }
43
+ ```
44
+
45
+ ### Translations (4 langues)
46
+
47
+ ```csharp
48
+ // Dans NavigationTranslationConfiguration.cs - GetSeedData()
49
+ // Context translations
50
+ translations.Add(new {
51
+ Id = GenerateGuid(index++),
52
+ EntityType = NavigationEntityType.Context,
53
+ EntityId = $CONTEXT_GUID,
54
+ LanguageCode = "fr",
55
+ Label = "$LABEL_FR",
56
+ Description = "$DESC_FR",
57
+ CreatedAt = seedDate
58
+ });
59
+ translations.Add(new {
60
+ Id = GenerateGuid(index++),
61
+ EntityType = NavigationEntityType.Context,
62
+ EntityId = $CONTEXT_GUID,
63
+ LanguageCode = "en",
64
+ Label = "$LABEL_EN",
65
+ Description = "$DESC_EN",
66
+ CreatedAt = seedDate
67
+ });
68
+ translations.Add(new {
69
+ Id = GenerateGuid(index++),
70
+ EntityType = NavigationEntityType.Context,
71
+ EntityId = $CONTEXT_GUID,
72
+ LanguageCode = "it",
73
+ Label = "$LABEL_IT",
74
+ Description = "$DESC_IT",
75
+ CreatedAt = seedDate
76
+ });
77
+ translations.Add(new {
78
+ Id = GenerateGuid(index++),
79
+ EntityType = NavigationEntityType.Context,
80
+ EntityId = $CONTEXT_GUID,
81
+ LanguageCode = "de",
82
+ Label = "$LABEL_DE",
83
+ Description = "$DESC_DE",
84
+ CreatedAt = seedDate
85
+ });
86
+ ```
87
+
88
+ ---
89
+
90
+ ## TEMPLATE: APPLICATION
91
+
92
+ ### Navigation Entity
93
+
94
+ ```csharp
95
+ // Dans NavigationApplicationConfiguration.cs - HasData()
96
+ new {
97
+ Id = Guid.Parse("$APP_GUID"),
98
+ ContextId = Guid.Parse("$CONTEXT_GUID"),
99
+ Code = "$CODE", // ex: "sales"
100
+ Label = "$LABEL_FR", // ex: "Ventes"
101
+ Description = "$DESC_FR", // ex: "Gestion des ventes"
102
+ Icon = "$ICON", // ex: "TrendingUp"
103
+ IconType = IconType.Lucide,
104
+ Route = "/$CONTEXT/$CODE", // ex: "/erp/sales"
105
+ DisplayOrder = $ORDER,
106
+ IsActive = true,
107
+ CreatedAt = seedDate
108
+ }
109
+ ```
110
+
111
+ ### Translations (4 langues)
112
+
113
+ ```csharp
114
+ // Application translations
115
+ translations.Add(new {
116
+ Id = GenerateGuid(index++),
117
+ EntityType = NavigationEntityType.Application,
118
+ EntityId = $APP_GUID,
119
+ LanguageCode = "fr",
120
+ Label = "$LABEL_FR",
121
+ Description = "$DESC_FR",
122
+ CreatedAt = seedDate
123
+ });
124
+ translations.Add(new {
125
+ Id = GenerateGuid(index++),
126
+ EntityType = NavigationEntityType.Application,
127
+ EntityId = $APP_GUID,
128
+ LanguageCode = "en",
129
+ Label = "$LABEL_EN",
130
+ Description = "$DESC_EN",
131
+ CreatedAt = seedDate
132
+ });
133
+ translations.Add(new {
134
+ Id = GenerateGuid(index++),
135
+ EntityType = NavigationEntityType.Application,
136
+ EntityId = $APP_GUID,
137
+ LanguageCode = "it",
138
+ Label = "$LABEL_IT",
139
+ Description = "$DESC_IT",
140
+ CreatedAt = seedDate
141
+ });
142
+ translations.Add(new {
143
+ Id = GenerateGuid(index++),
144
+ EntityType = NavigationEntityType.Application,
145
+ EntityId = $APP_GUID,
146
+ LanguageCode = "de",
147
+ Label = "$LABEL_DE",
148
+ Description = "$DESC_DE",
149
+ CreatedAt = seedDate
150
+ });
151
+ ```
152
+
153
+ ---
154
+
155
+ ## TEMPLATE: MODULE
156
+
157
+ ### Navigation Entity
158
+
159
+ ```csharp
160
+ // Dans NavigationModuleConfiguration.cs - HasData()
161
+ new {
162
+ Id = Guid.Parse("$MODULE_GUID"),
163
+ ApplicationId = Guid.Parse("$APP_GUID"),
164
+ Code = "$CODE", // ex: "products"
165
+ Label = "$LABEL_FR", // ex: "Produits"
166
+ Description = "$DESC_FR", // ex: "Gestion des produits"
167
+ Icon = "$ICON", // ex: "Package"
168
+ IconType = IconType.Lucide,
169
+ Route = "/$CONTEXT/$APP/$CODE", // ex: "/erp/sales/products"
170
+ DisplayOrder = $ORDER,
171
+ IsActive = true,
172
+ CreatedAt = seedDate
173
+ }
174
+ ```
175
+
176
+ ### Translations (4 langues)
177
+
178
+ ```csharp
179
+ // Module translations
180
+ translations.Add(new {
181
+ Id = GenerateGuid(index++),
182
+ EntityType = NavigationEntityType.Module,
183
+ EntityId = $MODULE_GUID,
184
+ LanguageCode = "fr",
185
+ Label = "$LABEL_FR",
186
+ Description = "$DESC_FR",
187
+ CreatedAt = seedDate
188
+ });
189
+ translations.Add(new {
190
+ Id = GenerateGuid(index++),
191
+ EntityType = NavigationEntityType.Module,
192
+ EntityId = $MODULE_GUID,
193
+ LanguageCode = "en",
194
+ Label = "$LABEL_EN",
195
+ Description = "$DESC_EN",
196
+ CreatedAt = seedDate
197
+ });
198
+ translations.Add(new {
199
+ Id = GenerateGuid(index++),
200
+ EntityType = NavigationEntityType.Module,
201
+ EntityId = $MODULE_GUID,
202
+ LanguageCode = "it",
203
+ Label = "$LABEL_IT",
204
+ Description = "$DESC_IT",
205
+ CreatedAt = seedDate
206
+ });
207
+ translations.Add(new {
208
+ Id = GenerateGuid(index++),
209
+ EntityType = NavigationEntityType.Module,
210
+ EntityId = $MODULE_GUID,
211
+ LanguageCode = "de",
212
+ Label = "$LABEL_DE",
213
+ Description = "$DESC_DE",
214
+ CreatedAt = seedDate
215
+ });
216
+ ```
217
+
218
+ ---
219
+
220
+ ## TEMPLATE: SECTION
221
+
222
+ ### Navigation Entity
223
+
224
+ ```csharp
225
+ // Dans NavigationSectionConfiguration.cs - HasData()
226
+ new {
227
+ Id = Guid.Parse("$SECTION_GUID"),
228
+ ModuleId = Guid.Parse("$MODULE_GUID"),
229
+ Code = "$CODE", // ex: "inventory"
230
+ Label = "$LABEL_FR", // ex: "Inventaire"
231
+ Description = "$DESC_FR", // ex: "Gestion des stocks"
232
+ Icon = "$ICON", // ex: "Warehouse"
233
+ IconType = IconType.Lucide,
234
+ Route = "/$CONTEXT/$APP/$MODULE/$CODE", // ex: "/erp/sales/products/inventory"
235
+ DisplayOrder = $ORDER,
236
+ IsActive = true,
237
+ CreatedAt = seedDate
238
+ }
239
+ ```
240
+
241
+ ### Translations (4 langues)
242
+
243
+ ```csharp
244
+ // Section translations
245
+ translations.Add(new {
246
+ Id = GenerateGuid(index++),
247
+ EntityType = NavigationEntityType.Section,
248
+ EntityId = $SECTION_GUID,
249
+ LanguageCode = "fr",
250
+ Label = "$LABEL_FR",
251
+ Description = "$DESC_FR",
252
+ CreatedAt = seedDate
253
+ });
254
+ translations.Add(new {
255
+ Id = GenerateGuid(index++),
256
+ EntityType = NavigationEntityType.Section,
257
+ EntityId = $SECTION_GUID,
258
+ LanguageCode = "en",
259
+ Label = "$LABEL_EN",
260
+ Description = "$DESC_EN",
261
+ CreatedAt = seedDate
262
+ });
263
+ translations.Add(new {
264
+ Id = GenerateGuid(index++),
265
+ EntityType = NavigationEntityType.Section,
266
+ EntityId = $SECTION_GUID,
267
+ LanguageCode = "it",
268
+ Label = "$LABEL_IT",
269
+ Description = "$DESC_IT",
270
+ CreatedAt = seedDate
271
+ });
272
+ translations.Add(new {
273
+ Id = GenerateGuid(index++),
274
+ EntityType = NavigationEntityType.Section,
275
+ EntityId = $SECTION_GUID,
276
+ LanguageCode = "de",
277
+ Label = "$LABEL_DE",
278
+ Description = "$DESC_DE",
279
+ CreatedAt = seedDate
280
+ });
281
+ ```
282
+
283
+ ---
284
+
285
+ ## TEMPLATE: PERMISSIONS SEED
286
+
287
+ ### Permission Entity
288
+
289
+ ```csharp
290
+ // Dans PermissionConfiguration.cs - HasData()
291
+ // Pour chaque action CRUD + assign + execute
292
+
293
+ // Read
294
+ new {
295
+ Id = Guid.Parse("$PERM_READ_GUID"),
296
+ Code = "$CONTEXT.$APP.$MODULE.read",
297
+ Name = "View $MODULE_LABEL",
298
+ Description = "View $MODULE_LABEL list and details",
299
+ Category = "$CONTEXT.$APP.$MODULE",
300
+ CreatedAt = seedDate
301
+ },
302
+ // Create
303
+ new {
304
+ Id = Guid.Parse("$PERM_CREATE_GUID"),
305
+ Code = "$CONTEXT.$APP.$MODULE.create",
306
+ Name = "Create $MODULE_LABEL",
307
+ Description = "Create new $MODULE_LABEL",
308
+ Category = "$CONTEXT.$APP.$MODULE",
309
+ CreatedAt = seedDate
310
+ },
311
+ // Update
312
+ new {
313
+ Id = Guid.Parse("$PERM_UPDATE_GUID"),
314
+ Code = "$CONTEXT.$APP.$MODULE.update",
315
+ Name = "Update $MODULE_LABEL",
316
+ Description = "Modify existing $MODULE_LABEL",
317
+ Category = "$CONTEXT.$APP.$MODULE",
318
+ CreatedAt = seedDate
319
+ },
320
+ // Delete
321
+ new {
322
+ Id = Guid.Parse("$PERM_DELETE_GUID"),
323
+ Code = "$CONTEXT.$APP.$MODULE.delete",
324
+ Name = "Delete $MODULE_LABEL",
325
+ Description = "Remove $MODULE_LABEL",
326
+ Category = "$CONTEXT.$APP.$MODULE",
327
+ CreatedAt = seedDate
328
+ }
329
+ ```
330
+
331
+ ### RolePermission Seed (Default Roles)
332
+
333
+ ```csharp
334
+ // Dans RolePermissionConfiguration.cs - HasData()
335
+ // SuperAdmin gets all permissions automatically (wildcard)
336
+
337
+ // PlatformAdmin - if platform context
338
+ new { RoleId = Guid.Parse("...PlatformAdminRoleId..."), PermissionId = $PERM_READ_GUID },
339
+ new { RoleId = Guid.Parse("...PlatformAdminRoleId..."), PermissionId = $PERM_CREATE_GUID },
340
+ new { RoleId = Guid.Parse("...PlatformAdminRoleId..."), PermissionId = $PERM_UPDATE_GUID },
341
+ new { RoleId = Guid.Parse("...PlatformAdminRoleId..."), PermissionId = $PERM_DELETE_GUID },
342
+
343
+ // StandardUser - read only by default
344
+ new { RoleId = Guid.Parse("...StandardUserRoleId..."), PermissionId = $PERM_READ_GUID }
345
+ ```
346
+
347
+ ---
348
+
349
+ ## TEMPLATE: SECTION PERMISSIONS SEED (Level 4)
350
+
351
+ > **Usage:** Quand un Module a des sous-pages avec permissions différentes
352
+
353
+ ### Permission Entity - Section Level
354
+
355
+ ```csharp
356
+ // Dans PermissionConfiguration.cs - HasData()
357
+ // Pattern: {context}.{application}.{module}.{section}.{action}
358
+
359
+ // Déclarer le SectionId (doit correspondre à NavigationSectionConfiguration.cs)
360
+ var {section}SectionId = Guid.Parse("$SECTION_GUID");
361
+
362
+ // Wildcard Section
363
+ new {
364
+ Id = Guid.Parse("$PERM_SECTION_WILDCARD_GUID"),
365
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.*",
366
+ Level = PermissionLevel.Section,
367
+ IsWildcard = true,
368
+ SectionId = {section}SectionId,
369
+ Description = "Full $SECTION_LABEL access",
370
+ CreatedAt = seedDate
371
+ },
372
+ // Read
373
+ new {
374
+ Id = Guid.Parse("$PERM_SECTION_READ_GUID"),
375
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.read",
376
+ Level = PermissionLevel.Section,
377
+ Action = PermissionAction.Read,
378
+ IsWildcard = false,
379
+ SectionId = {section}SectionId,
380
+ Description = "View $SECTION_LABEL",
381
+ CreatedAt = seedDate
382
+ },
383
+ // Create
384
+ new {
385
+ Id = Guid.Parse("$PERM_SECTION_CREATE_GUID"),
386
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.create",
387
+ Level = PermissionLevel.Section,
388
+ Action = PermissionAction.Create,
389
+ IsWildcard = false,
390
+ SectionId = {section}SectionId,
391
+ Description = "Create in $SECTION_LABEL",
392
+ CreatedAt = seedDate
393
+ },
394
+ // Update
395
+ new {
396
+ Id = Guid.Parse("$PERM_SECTION_UPDATE_GUID"),
397
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.update",
398
+ Level = PermissionLevel.Section,
399
+ Action = PermissionAction.Update,
400
+ IsWildcard = false,
401
+ SectionId = {section}SectionId,
402
+ Description = "Update in $SECTION_LABEL",
403
+ CreatedAt = seedDate
404
+ },
405
+ // Delete
406
+ new {
407
+ Id = Guid.Parse("$PERM_SECTION_DELETE_GUID"),
408
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.delete",
409
+ Level = PermissionLevel.Section,
410
+ Action = PermissionAction.Delete,
411
+ IsWildcard = false,
412
+ SectionId = {section}SectionId,
413
+ Description = "Delete in $SECTION_LABEL",
414
+ CreatedAt = seedDate
415
+ },
416
+ // Execute (optionnel)
417
+ new {
418
+ Id = Guid.Parse("$PERM_SECTION_EXECUTE_GUID"),
419
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.execute",
420
+ Level = PermissionLevel.Section,
421
+ Action = PermissionAction.Execute,
422
+ IsWildcard = false,
423
+ SectionId = {section}SectionId,
424
+ Description = "Execute actions in $SECTION_LABEL",
425
+ CreatedAt = seedDate
426
+ }
427
+ ```
428
+
429
+ ---
430
+
431
+ ## TEMPLATE: RESOURCE PERMISSIONS SEED (Level 5)
432
+
433
+ > **Usage:** Niveau le plus fin - sous-ressources avec permissions distinctes (ex: Prompts → Blocks)
434
+
435
+ ### Permission Entity - Resource Level
436
+
437
+ ```csharp
438
+ // Dans PermissionConfiguration.cs - HasData()
439
+ // Pattern: {context}.{application}.{module}.{section}.{resource}.{action}
440
+
441
+ // Déclarer le ResourceId (doit correspondre à NavigationResourceConfiguration.cs)
442
+ var {resource}ResourceId = Guid.Parse("$RESOURCE_GUID");
443
+
444
+ // Wildcard Resource
445
+ new {
446
+ Id = Guid.Parse("$PERM_RESOURCE_WILDCARD_GUID"),
447
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.*",
448
+ Level = PermissionLevel.Resource,
449
+ IsWildcard = true,
450
+ ResourceId = {resource}ResourceId,
451
+ Description = "Full $RESOURCE_LABEL access",
452
+ CreatedAt = seedDate
453
+ },
454
+ // Read
455
+ new {
456
+ Id = Guid.Parse("$PERM_RESOURCE_READ_GUID"),
457
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.read",
458
+ Level = PermissionLevel.Resource,
459
+ Action = PermissionAction.Read,
460
+ IsWildcard = false,
461
+ ResourceId = {resource}ResourceId,
462
+ Description = "View $RESOURCE_LABEL",
463
+ CreatedAt = seedDate
464
+ },
465
+ // Create
466
+ new {
467
+ Id = Guid.Parse("$PERM_RESOURCE_CREATE_GUID"),
468
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.create",
469
+ Level = PermissionLevel.Resource,
470
+ Action = PermissionAction.Create,
471
+ IsWildcard = false,
472
+ ResourceId = {resource}ResourceId,
473
+ Description = "Create $RESOURCE_LABEL",
474
+ CreatedAt = seedDate
475
+ },
476
+ // Update
477
+ new {
478
+ Id = Guid.Parse("$PERM_RESOURCE_UPDATE_GUID"),
479
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.update",
480
+ Level = PermissionLevel.Resource,
481
+ Action = PermissionAction.Update,
482
+ IsWildcard = false,
483
+ ResourceId = {resource}ResourceId,
484
+ Description = "Update $RESOURCE_LABEL",
485
+ CreatedAt = seedDate
486
+ },
487
+ // Delete
488
+ new {
489
+ Id = Guid.Parse("$PERM_RESOURCE_DELETE_GUID"),
490
+ Path = "$CONTEXT.$APP.$MODULE.$SECTION.$RESOURCE.delete",
491
+ Level = PermissionLevel.Resource,
492
+ Action = PermissionAction.Delete,
493
+ IsWildcard = false,
494
+ ResourceId = {resource}ResourceId,
495
+ Description = "Delete $RESOURCE_LABEL",
496
+ CreatedAt = seedDate
497
+ }
498
+ ```
499
+
500
+ ---
501
+
502
+ ## TEMPLATE: BULK OPERATIONS PERMISSIONS
503
+
504
+ > **OBLIGATOIRE:** Toujours prévoir pour les modules CRUD
505
+
506
+ ### Permission Entity - Bulk Operations
507
+
508
+ ```csharp
509
+ // Dans PermissionConfiguration.cs - HasData()
510
+ // Ajouter après les permissions CRUD standard
511
+
512
+ // Bulk Create
513
+ new {
514
+ Id = Guid.Parse("$PERM_BULK_CREATE_GUID"),
515
+ Path = "$CONTEXT.$APP.$MODULE.bulk-create",
516
+ Level = PermissionLevel.Module,
517
+ Action = PermissionAction.Create,
518
+ IsWildcard = false,
519
+ ModuleId = {module}ModuleId,
520
+ Description = "Bulk create $MODULE_LABEL",
521
+ CreatedAt = seedDate
522
+ },
523
+ // Bulk Update
524
+ new {
525
+ Id = Guid.Parse("$PERM_BULK_UPDATE_GUID"),
526
+ Path = "$CONTEXT.$APP.$MODULE.bulk-update",
527
+ Level = PermissionLevel.Module,
528
+ Action = PermissionAction.Update,
529
+ IsWildcard = false,
530
+ ModuleId = {module}ModuleId,
531
+ Description = "Bulk update $MODULE_LABEL",
532
+ CreatedAt = seedDate
533
+ },
534
+ // Bulk Delete
535
+ new {
536
+ Id = Guid.Parse("$PERM_BULK_DELETE_GUID"),
537
+ Path = "$CONTEXT.$APP.$MODULE.bulk-delete",
538
+ Level = PermissionLevel.Module,
539
+ Action = PermissionAction.Delete,
540
+ IsWildcard = false,
541
+ ModuleId = {module}ModuleId,
542
+ Description = "Bulk delete $MODULE_LABEL",
543
+ CreatedAt = seedDate
544
+ },
545
+ // Export
546
+ new {
547
+ Id = Guid.Parse("$PERM_EXPORT_GUID"),
548
+ Path = "$CONTEXT.$APP.$MODULE.export",
549
+ Level = PermissionLevel.Module,
550
+ Action = PermissionAction.Execute,
551
+ IsWildcard = false,
552
+ ModuleId = {module}ModuleId,
553
+ Description = "Export $MODULE_LABEL data",
554
+ CreatedAt = seedDate
555
+ },
556
+ // Import
557
+ new {
558
+ Id = Guid.Parse("$PERM_IMPORT_GUID"),
559
+ Path = "$CONTEXT.$APP.$MODULE.import",
560
+ Level = PermissionLevel.Module,
561
+ Action = PermissionAction.Create,
562
+ IsWildcard = false,
563
+ ModuleId = {module}ModuleId,
564
+ Description = "Import $MODULE_LABEL data",
565
+ CreatedAt = seedDate
566
+ }
567
+ ```
568
+
569
+ ---
570
+
571
+ ## EXEMPLE COMPLET: Module "Products" dans "ERP > Sales"
572
+
573
+ ### Variables
574
+
575
+ ```
576
+ $CONTEXT = erp
577
+ $CONTEXT_GUID = e1e1e1e1-1111-1111-1111-111111111111
578
+ $APP = sales
579
+ $APP_GUID = e2e2e2e2-2222-2222-2222-222222222222
580
+ $MODULE = products
581
+ $MODULE_GUID = e3e3e3e3-3333-3333-3333-333333333333
582
+
583
+ $LABEL_FR = Produits
584
+ $LABEL_EN = Products
585
+ $LABEL_IT = Prodotti
586
+ $LABEL_DE = Produkte
587
+
588
+ $DESC_FR = Gestion des produits
589
+ $DESC_EN = Product management
590
+ $DESC_IT = Gestione prodotti
591
+ $DESC_DE = Produktverwaltung
592
+
593
+ $ICON = Package
594
+ $ORDER = 1
595
+ ```
596
+
597
+ ### Fichiers à modifier
598
+
599
+ 1. `NavigationContextConfiguration.cs` - Ajouter context ERP (si nouveau)
600
+ 2. `NavigationApplicationConfiguration.cs` - Ajouter application Sales
601
+ 3. `NavigationModuleConfiguration.cs` - Ajouter module Products
602
+ 4. `NavigationTranslationConfiguration.cs` - Ajouter 4 traductions × nombre d'entités
603
+ 5. `PermissionConfiguration.cs` - Ajouter permissions CRUD
604
+ 6. `RolePermissionConfiguration.cs` - Assigner aux rôles par défaut
605
+
606
+ ---
607
+
608
+ ## CHECKLIST SEED
609
+
610
+ | Vérification | Status |
611
+ |--------------|--------|
612
+ | ☐ GUID déterministe (pas NewGuid) | |
613
+ | ☐ 4 langues pour chaque entité | |
614
+ | ☐ Index translations continue la séquence existante | |
615
+ | ☐ Route alignée avec permission path | |
616
+ | ☐ DisplayOrder cohérent | |
617
+ | ☐ Permissions CRUD créées (Level 3 - Module) | |
618
+ | ☐ Permissions Section si sous-pages (Level 4) | |
619
+ | ☐ Permissions Resource si sous-ressources (Level 5) | |
620
+ | ☐ Permissions Bulk Operations créées | |
621
+ | ☐ RolePermissions assignés | |
622
+
623
+ ---
624
+
625
+ ## HIÉRARCHIE DES PERMISSIONS (5 Niveaux)
626
+
627
+ ```
628
+ Level 1: CONTEXT
629
+ └─ Path: {context}.*
630
+ └─ Ex: platform.* → Accès complet au context
631
+
632
+ Level 2: APPLICATION
633
+ └─ Path: {context}.{application}.*
634
+ └─ Ex: platform.administration.* → Accès complet à l'app
635
+
636
+ Level 3: MODULE
637
+ └─ Path: {context}.{application}.{module}.{action}
638
+ └─ Ex: platform.administration.users.read
639
+
640
+ Level 4: SECTION
641
+ └─ Path: {context}.{application}.{module}.{section}.{action}
642
+ └─ Ex: platform.administration.ai.settings.update
643
+
644
+ Level 5: RESOURCE (finest granularity)
645
+ └─ Path: {context}.{application}.{module}.{section}.{resource}.{action}
646
+ └─ Ex: platform.administration.ai.prompts.blocks.delete
647
+ ```