@atlashub/smartstack-cli 1.5.0 → 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 (159) hide show
  1. package/.documentation/agents.html +920 -916
  2. package/.documentation/apex.html +1022 -1018
  3. package/.documentation/business-analyse.html +1505 -1501
  4. package/.documentation/commands.html +684 -680
  5. package/.documentation/css/styles.css +2168 -2168
  6. package/.documentation/efcore.html +2509 -2505
  7. package/.documentation/gitflow.html +2622 -2618
  8. package/.documentation/hooks.html +417 -413
  9. package/.documentation/index.html +327 -323
  10. package/.documentation/init.html +565 -0
  11. package/.documentation/installation.html +548 -462
  12. package/.documentation/js/app.js +794 -794
  13. package/.documentation/ralph-loop.html +534 -530
  14. package/.documentation/test-web.html +517 -513
  15. package/config/default-config.json +86 -86
  16. package/config/settings.json +53 -53
  17. package/config/settings.local.example.json +16 -16
  18. package/dist/index.js +18 -8
  19. package/dist/index.js.map +1 -1
  20. package/package.json +88 -88
  21. package/templates/agents/action.md +36 -36
  22. package/templates/agents/efcore/conflicts.md +84 -84
  23. package/templates/agents/efcore/db-deploy.md +51 -51
  24. package/templates/agents/efcore/db-reset.md +59 -59
  25. package/templates/agents/efcore/db-seed.md +56 -56
  26. package/templates/agents/efcore/db-status.md +64 -64
  27. package/templates/agents/efcore/migration.md +85 -85
  28. package/templates/agents/efcore/rebase-snapshot.md +62 -62
  29. package/templates/agents/efcore/scan.md +90 -90
  30. package/templates/agents/efcore/squash.md +67 -67
  31. package/templates/agents/explore-codebase.md +65 -65
  32. package/templates/agents/explore-docs.md +97 -97
  33. package/templates/agents/fix-grammar.md +49 -49
  34. package/templates/agents/gitflow/abort.md +45 -45
  35. package/templates/agents/gitflow/cleanup.md +85 -85
  36. package/templates/agents/gitflow/commit.md +40 -40
  37. package/templates/agents/gitflow/exec.md +48 -48
  38. package/templates/agents/gitflow/finish.md +92 -92
  39. package/templates/agents/gitflow/init.md +139 -139
  40. package/templates/agents/gitflow/merge.md +62 -62
  41. package/templates/agents/gitflow/plan.md +42 -42
  42. package/templates/agents/gitflow/pr.md +78 -78
  43. package/templates/agents/gitflow/review.md +49 -49
  44. package/templates/agents/gitflow/start.md +61 -61
  45. package/templates/agents/gitflow/status.md +32 -32
  46. package/templates/agents/snipper.md +36 -36
  47. package/templates/agents/websearch.md +46 -46
  48. package/templates/commands/_resources/formatting-guide.md +124 -124
  49. package/templates/commands/ai-prompt.md +315 -315
  50. package/templates/commands/apex/1-analyze.md +100 -100
  51. package/templates/commands/apex/2-plan.md +145 -145
  52. package/templates/commands/apex/3-execute.md +171 -171
  53. package/templates/commands/apex/4-examine.md +116 -116
  54. package/templates/commands/apex/5-tasks.md +209 -209
  55. package/templates/commands/apex.md +76 -76
  56. package/templates/commands/application/create.md +362 -362
  57. package/templates/commands/application/templates-backend.md +463 -463
  58. package/templates/commands/application/templates-frontend.md +517 -517
  59. package/templates/commands/application/templates-i18n.md +478 -478
  60. package/templates/commands/application/templates-seed.md +362 -362
  61. package/templates/commands/application.md +303 -303
  62. package/templates/commands/business-analyse/0-orchestrate.md +640 -640
  63. package/templates/commands/business-analyse/1-init.md +269 -269
  64. package/templates/commands/business-analyse/2-discover.md +520 -520
  65. package/templates/commands/business-analyse/3-analyse.md +408 -408
  66. package/templates/commands/business-analyse/4-specify.md +598 -598
  67. package/templates/commands/business-analyse/5-validate.md +326 -326
  68. package/templates/commands/business-analyse/6-handoff.md +746 -746
  69. package/templates/commands/business-analyse/7-doc-html.md +602 -602
  70. package/templates/commands/business-analyse/bug.md +325 -325
  71. package/templates/commands/business-analyse/change-request.md +368 -368
  72. package/templates/commands/business-analyse/hotfix.md +200 -200
  73. package/templates/commands/business-analyse.md +640 -640
  74. package/templates/commands/controller/create.md +216 -216
  75. package/templates/commands/controller/postman-templates.md +528 -528
  76. package/templates/commands/controller/templates.md +600 -600
  77. package/templates/commands/controller.md +337 -337
  78. package/templates/commands/create/agent.md +138 -138
  79. package/templates/commands/create/command.md +166 -166
  80. package/templates/commands/create/hook.md +234 -234
  81. package/templates/commands/create/plugin.md +329 -329
  82. package/templates/commands/create/project.md +507 -507
  83. package/templates/commands/create/skill.md +199 -199
  84. package/templates/commands/create.md +220 -220
  85. package/templates/commands/debug.md +95 -95
  86. package/templates/commands/documentation/module.md +202 -202
  87. package/templates/commands/documentation/templates.md +432 -432
  88. package/templates/commands/documentation.md +190 -190
  89. package/templates/commands/efcore/_env-check.md +153 -153
  90. package/templates/commands/efcore/conflicts.md +186 -186
  91. package/templates/commands/efcore/db-deploy.md +193 -193
  92. package/templates/commands/efcore/db-reset.md +426 -426
  93. package/templates/commands/efcore/db-seed.md +326 -326
  94. package/templates/commands/efcore/db-status.md +226 -226
  95. package/templates/commands/efcore/migration.md +400 -400
  96. package/templates/commands/efcore/rebase-snapshot.md +264 -264
  97. package/templates/commands/efcore/scan.md +198 -198
  98. package/templates/commands/efcore/squash.md +298 -298
  99. package/templates/commands/efcore.md +224 -224
  100. package/templates/commands/epct.md +69 -69
  101. package/templates/commands/explain.md +186 -186
  102. package/templates/commands/explore.md +45 -45
  103. package/templates/commands/feature-full.md +267 -267
  104. package/templates/commands/gitflow/1-init.md +1038 -1038
  105. package/templates/commands/gitflow/10-start.md +768 -768
  106. package/templates/commands/gitflow/11-finish.md +457 -457
  107. package/templates/commands/gitflow/12-cleanup.md +276 -276
  108. package/templates/commands/gitflow/13-sync.md +216 -216
  109. package/templates/commands/gitflow/14-rebase.md +251 -251
  110. package/templates/commands/gitflow/2-status.md +277 -277
  111. package/templates/commands/gitflow/3-commit.md +344 -344
  112. package/templates/commands/gitflow/4-plan.md +145 -145
  113. package/templates/commands/gitflow/5-exec.md +147 -147
  114. package/templates/commands/gitflow/6-abort.md +344 -344
  115. package/templates/commands/gitflow/7-pull-request.md +453 -355
  116. package/templates/commands/gitflow/8-review.md +240 -176
  117. package/templates/commands/gitflow/9-merge.md +451 -365
  118. package/templates/commands/gitflow.md +128 -128
  119. package/templates/commands/implement.md +663 -663
  120. package/templates/commands/init.md +567 -562
  121. package/templates/commands/mcp-integration.md +330 -330
  122. package/templates/commands/notification.md +129 -129
  123. package/templates/commands/oneshot.md +57 -57
  124. package/templates/commands/quick-search.md +72 -72
  125. package/templates/commands/ralph-loop/cancel-ralph.md +18 -18
  126. package/templates/commands/ralph-loop/help.md +126 -126
  127. package/templates/commands/ralph-loop/ralph-loop.md +18 -18
  128. package/templates/commands/review.md +106 -106
  129. package/templates/commands/utils/test-web-config.md +160 -160
  130. package/templates/commands/utils/test-web.md +151 -151
  131. package/templates/commands/validate.md +233 -233
  132. package/templates/commands/workflow.md +193 -193
  133. package/templates/gitflow/config.json +138 -138
  134. package/templates/hooks/ef-migration-check.md +139 -139
  135. package/templates/hooks/hooks.json +25 -25
  136. package/templates/hooks/stop-hook.sh +177 -177
  137. package/templates/skills/ai-prompt/SKILL.md +778 -778
  138. package/templates/skills/application/SKILL.md +563 -563
  139. package/templates/skills/application/templates-backend.md +450 -450
  140. package/templates/skills/application/templates-frontend.md +531 -531
  141. package/templates/skills/application/templates-i18n.md +520 -520
  142. package/templates/skills/application/templates-seed.md +647 -647
  143. package/templates/skills/business-analyse/SKILL.md +191 -191
  144. package/templates/skills/business-analyse/questionnaire.md +283 -283
  145. package/templates/skills/business-analyse/templates-frd.md +477 -477
  146. package/templates/skills/business-analyse/templates-react.md +580 -580
  147. package/templates/skills/controller/SKILL.md +240 -240
  148. package/templates/skills/controller/postman-templates.md +614 -614
  149. package/templates/skills/controller/templates.md +1468 -1468
  150. package/templates/skills/documentation/SKILL.md +133 -133
  151. package/templates/skills/documentation/templates.md +476 -476
  152. package/templates/skills/feature-full/SKILL.md +838 -838
  153. package/templates/skills/notification/SKILL.md +555 -555
  154. package/templates/skills/ui-components/SKILL.md +870 -870
  155. package/templates/skills/workflow/SKILL.md +582 -582
  156. package/templates/test-web/api-health.json +38 -38
  157. package/templates/test-web/minimal.json +19 -19
  158. package/templates/test-web/npm-package.json +46 -46
  159. 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
+ ```