7.3 KiB
Sozsoft Platform Module Implementation Rules & Instructions
Purpose
This document summarizes the rules, standards, and step-by-step instructions for implementing any module (e.g., CRM, MRP, HR) with a sample list (e.g., Opportunity, Order) in the Sozsoft Platform. Replace all placeholders (e.g., {Modul}, {Liste}, {Entity}) with your actual module, list, or entity names. Use as a reference for future development and as a prompt guide for similar tasks.
Bu doküman depo içi seeder'larla (DbMigrator/Migrations) modül eklemeyi anlatır. Çalışma zamanında Wizard / Custom Components / CRUD Endpoint Manager ile üretim yapacaksan
lowcode.instructions.mdesastır; oradaki seed dosyalarıconfigs/seedsaltına düşer.
General Principles
- Configuration First: Always prefer platform configuration (menus, permissions, forms, localization) over custom code.
- Modularization: Each module (e.g., {Modul}) must have its own seeder, permission group, and localization entries.
- Naming Conventions:
- Table names:
{Modul}_T_{Entity}(e.g.,Mrp_T_Order) - Menu/permission keys:
{Modul},{Modul}.{Liste}
- Table names:
- Tenant Isolation: All data, forms, and permissions must be tenant-aware.
- Localization: Every menu, list, and field must have a corresponding entry in
configs/seeds/data/Sas.Languages.LanguageText.json. - No Redundant Code: Avoid duplicating permission grants or seeding logic across modules.
- SeedConsts Rule: For every new module/entity, add a constant to
SeedConsts(e.g.,public static class {Modul}andpublic const string {Liste}) if it does not already exist. Never duplicate existing constants. - DeleteCommand Rule: In all
ListFormSeeder_{Modul}.csfiles, theDeleteCommandproperty must use theDefaultDeleteCommandfunction, e.g.,DeleteCommand = DefaultDeleteCommand("{TabloAdı}"). Never use a raw SQL string directly forDeleteCommand.
Special File Handling Rules
-
configs/seeds/data/Sas.Menus.*.json:
- Never add, remove or re-path a route in
Sas.Menus.Routes.json. The only field set you may edit on an existing row is itsSeo*columns (lowcode §0.9). OnlySas.Menus.Module.jsonandSas.Menus.Menu.jsoncan be changed for menu additions or updates. All menu additions must use the platform's configuration mechanisms or be added to those two files as required by platform design.
- Never add, remove or re-path a route in
-
configs/seeds/data/Sas.Languages.LanguageText.json:
- When adding a new key, always check if the key already exists. Only add the key if it does not exist to prevent duplicates.
- Each key is two rows (
CultureNameenandtr).Id= UUID v5 (URL namespace) ofSas_H_LanguageText:{ResourceName}:{Key}:{CultureName}; never a random GUID.
File-by-File Change Summary
1. configs/seeds/data/Sas.Menus.Menu.json
- {Modul} menu added as a top-level menu with
ModuleId: {Modul}; the module row goes intoSas.Menus.Module.json. - {Liste} added as a child menu under {Modul}.
2. configs/seeds/data/Abp.Identity.Permissions.json
- {Modul} permissions grouped under
{Modul}. - {Liste} permissions nested under {Modul} group.
3. ListFormSeeder_Adm.cs
- Removed {Liste} seeding logic (moved to {Modul} seeder).
4. ListFormSeeder_{Modul}.cs
- Created new seeder file for {Modul}.
- Seeds {Liste} list-form, referencing
{Modul}_T_{Entity}.
5. SqlObjects.sql
- Renamed {Liste} table to
{Modul}_T_{Entity}. - Updated all related constraints and references.
6. PlatformIdentityDataSeeder.cs
- Removed redundant {Modul} permission grant logic (now handled by the permission seed data).
7. Sas.Languages.LanguageText.json
- Added localization entries for:
- {Modul} menu and {Liste} list
- {Liste} list fields (e.g.,
FullName,Phone)
Step-by-Step Instructions (Prompt Examples)
1. Add a New Module (e.g., {Modul})
Yeni bir modül ekle (ör: {Modul}):
- configs/seeds/data/Sas.Menus.Menu.json'a kök menü, Sas.Menus.Module.json'a modül kaydı olarak ekle
- configs/seeds/data/Abp.Identity.PermissionGroups.json'da ayrı bir grup oluştur
- ListFormSeeder_{Modul}.cs dosyası oluştur ve list-form seed'ini buraya taşı
- SqlObjects.sql'de tabloyu {Modul}_T_{Entity} olarak adlandır
- configs/seeds/data/Sas.Languages.LanguageText.json dosyasına menü, liste ve alan çevirilerini ekle
2. Add a New List Under a Module
Yeni bir liste ekle (ör: {Liste}):
- {Modul} ana menüsünün altına ekle
- ListFormSeeder_{Modul}.cs dosyasına seed kodunu ekle
- SqlObjects.sql'de tabloyu {Modul}_T_{Entity} olarak oluştur
- configs/seeds/data/Abp.Identity.Permissions.json'da ilgili izinleri {Modul} grubuna ekle
- configs/seeds/data/Sas.Languages.LanguageText.json dosyasına liste ve alan çevirilerini ekle
3. Enforce Tenant Isolation and Full Audit
Tablo ve list-form için tenant izolasyonu ve full-audit alanlarını ekle:
- Tabloya TenantId, CreationTime, CreatorId, LastModificationTime, LastModifierId, IsDeleted, DeleterId, DeletionTime alanlarını ekle
- List-form seed'inde tenant-aware ayarları kontrol et
4. Add/Update Localization
Yeni menü, liste veya alan eklediğinde configs/seeds/data/Sas.Languages.LanguageText.json dosyasına (EN + TR satırı) şu şekilde ekle:
- {Modul}
- {Modul}.{Liste}
- Sas.Listform.ListformField.{Alan}
5. SeedConsts and DeleteCommand Rules
- SeedConsts.cs dosyasına, yeni modül veya entity için (ör: public static class {Modul} ve altında public const string {Liste}) sabit ekle. Eğer zaten varsa tekrar ekleme.
- ListFormSeeder_{Modul}.cs dosyalarında DeleteCommand satırı **her zaman** DefaultDeleteCommand fonksiyonu ile olmalı:
DeleteCommand = DefaultDeleteCommand("{TabloAdı}")
- DeleteCommand'da doğrudan SQL stringi **kullanma**.
5. Remove Redundant or Incorrect Code
- Farklı modüllerde aynı izin veya seed kodu varsa, sadece ilgili modülde bırak
- PlatformIdentityDataSeeder.cs'de Permission grant kodunu kaldır, Abp.Identity.Permissions.json'dan yönet
Validation Checklist
- Menü ve izinler doğru hiyerarşide mi?
- List-form seed'leri doğru modül dosyasında mı?
- Tablo isimleri ve referansları standartlara uygun mu? (örn: {Modul}T{Entity})
- Sas.Languages.LanguageText.json'da tüm yeni menü, liste ve alanlar var mı?
- Redundant kod veya izin grant'ı var mı?
- Seed ve migration sonrası UI'da çeviriler doğru görünüyor mu?
- SeedConsts.cs dosyasında ilgili sabitler var mı, tekrar eklenmemiş mi?
- ListFormSeeder dosyalarında DeleteCommand satırı DefaultDeleteCommand fonksiyonu ile mi atanmış?
Rollback Strategy
- Değişiklikleri modül bazında geri al (örn: sadece {Modul} ile ilgili dosyaları revert et)
- JSON dosyalarında eski anahtarları ve çevirileri sil
- Seeder ve migration dosyalarını eski haline getir
Quick Prompts for Future Use
- "Yeni bir modül ekle ve tüm standartlara göre yapılandır."
- "Yeni bir liste ekle, tenant izolasyonu ve çevirileriyle birlikte."
- "Mevcut bir modülde eksik olan çeviri veya izinleri tamamla."
- "Tüm {Modul} ile ilgili seed ve izinleri modüler yapıya uygun şekilde güncelle."
Not: Tüm işlemlerden sonra seed'leri çalıştırıp UI'da menü ve çevirileri kontrol etmeyi unutma.