@atlashub/smartstack-cli 1.4.0 → 1.5.0

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 (66) hide show
  1. package/.documentation/agents.html +8 -4
  2. package/.documentation/apex.html +8 -4
  3. package/.documentation/business-analyse.html +833 -406
  4. package/.documentation/commands.html +8 -4
  5. package/.documentation/css/styles.css +153 -15
  6. package/.documentation/efcore.html +8 -4
  7. package/.documentation/gitflow.html +795 -230
  8. package/.documentation/hooks.html +8 -4
  9. package/.documentation/index.html +13 -9
  10. package/.documentation/installation.html +23 -19
  11. package/.documentation/ralph-loop.html +530 -0
  12. package/.documentation/test-web.html +8 -4
  13. package/README.md +52 -10
  14. package/dist/index.js +813 -283
  15. package/dist/index.js.map +1 -1
  16. package/package.json +1 -1
  17. package/templates/agents/efcore/conflicts.md +44 -17
  18. package/templates/agents/efcore/db-status.md +27 -6
  19. package/templates/agents/efcore/scan.md +43 -13
  20. package/templates/commands/ai-prompt.md +315 -315
  21. package/templates/commands/application/create.md +362 -362
  22. package/templates/commands/controller/create.md +216 -216
  23. package/templates/commands/controller.md +59 -0
  24. package/templates/commands/create/agent.md +138 -0
  25. package/templates/commands/create/command.md +166 -0
  26. package/templates/commands/create/hook.md +234 -0
  27. package/templates/commands/create/plugin.md +329 -0
  28. package/templates/commands/create/project.md +507 -0
  29. package/templates/commands/create/skill.md +199 -0
  30. package/templates/commands/create.md +220 -0
  31. package/templates/commands/documentation/module.md +202 -202
  32. package/templates/commands/efcore/_env-check.md +153 -153
  33. package/templates/commands/efcore/conflicts.md +109 -192
  34. package/templates/commands/efcore/db-status.md +101 -89
  35. package/templates/commands/efcore/migration.md +23 -11
  36. package/templates/commands/efcore/scan.md +115 -119
  37. package/templates/commands/efcore.md +54 -6
  38. package/templates/commands/feature-full.md +267 -267
  39. package/templates/commands/gitflow/11-finish.md +145 -11
  40. package/templates/commands/gitflow/13-sync.md +216 -216
  41. package/templates/commands/gitflow/14-rebase.md +251 -251
  42. package/templates/commands/gitflow/2-status.md +120 -10
  43. package/templates/commands/gitflow/3-commit.md +150 -0
  44. package/templates/commands/gitflow/7-pull-request.md +134 -5
  45. package/templates/commands/gitflow/9-merge.md +142 -1
  46. package/templates/commands/implement.md +663 -663
  47. package/templates/commands/init.md +562 -0
  48. package/templates/commands/mcp-integration.md +330 -0
  49. package/templates/commands/notification.md +129 -129
  50. package/templates/commands/validate.md +233 -0
  51. package/templates/commands/workflow.md +193 -193
  52. package/templates/skills/ai-prompt/SKILL.md +778 -778
  53. package/templates/skills/application/SKILL.md +563 -563
  54. package/templates/skills/application/templates-backend.md +450 -450
  55. package/templates/skills/application/templates-frontend.md +531 -531
  56. package/templates/skills/application/templates-i18n.md +520 -520
  57. package/templates/skills/application/templates-seed.md +647 -647
  58. package/templates/skills/controller/SKILL.md +240 -240
  59. package/templates/skills/controller/postman-templates.md +614 -614
  60. package/templates/skills/controller/templates.md +1468 -1468
  61. package/templates/skills/documentation/SKILL.md +133 -133
  62. package/templates/skills/documentation/templates.md +476 -476
  63. package/templates/skills/feature-full/SKILL.md +838 -838
  64. package/templates/skills/notification/SKILL.md +555 -555
  65. package/templates/skills/ui-components/SKILL.md +870 -870
  66. package/templates/skills/workflow/SKILL.md +582 -582
@@ -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
+ ```