12. Production Readiness and Adding Future Packages Safely
12.1 Migration status
No migration was required or created. Every entity used already existed
(SubscriptionPackage/SubscriptionPlan/SubscriptionPlanPackage/SubscriptionFeature/
SubscriptionPackageFeature/SubscriptionFeatureSettingsGroup/SubscriptionPackageFeatureRule/
SubscriptionFeatureReportAction/AppReportNameAction) — this task only added seed data through five
new ICustomSeeder classes and one additive JSON row, plus Shumoul.Framework.MultiTenancy.Api's
version bump (1.0.116 → 1.0.117) and the corresponding BackEnd PackageReference update.
12.2 Deployment
The five new seeders run automatically at Shumoul.Api startup (same CustomSeederRunner pipeline as
every existing seeder) — no manual production step is required beyond the normal package release +
deploy. First startup after this deploy inserts the 4 packages/8 plan-packages/14 package-features/5
rules/21 report-action links; every subsequent startup is a confirmed no-op.
12.3 How to add a future package safely
- Add a package entry to
Packages/ShumoulSubscriptionPackages.json(or a new, similarly-scoped JSON- seeder if it's a genuinely different product line) — never edit the original, gated
SubscriptionPackages.json/SubscriptionPackageSeeder.
- seeder if it's a genuinely different product line) — never edit the original, gated
- Decide the package's feature set from the already-existing
SubscriptionFeaturecatalog first (Chapter 3) — only add a newSubscriptionFeatureif no existing key fits, and only through the admin API (never invent one in a seeder). - Add
(PackageFName, FeatureKey)rows toPackages/ShumoulPackageFeatures.json. - If the package needs limits, add
(PackageFName, FeatureKey, EntityName, RowCounter, ApplyPeriod)rows to a rules JSON, attaching each rule to the single most relevant feature the package includes. Remember: seeding a rule only makes it queryable/displayable — enforcement is a separate step, see Chapter 13 for the enforcement mechanism now in place for Shumoul Starter's five rules. - Add
(FeatureKey, ReportNameActionKey)rows toFeatureReportActions/ShumoulFeatureReportActions.json, using onlyActionKeystrings already derivable fromReports.json/ReportActions.json(Chapter 8) — never invent a report or numeric Id. - Never reuse the gated legacy seeders (
SubscriptionPackageSeeder,PlanPackagesSeeder,Starter/ Basic/AdvancedPackageFeaturesSeeder,SubscriptionFeatureReportActionSeeder) as a template for new work — they only run once, ever, per environment (Chapter 4). Always follow the gate-freeComputeSeedPlanpattern this guide's seeders use. - Add a
ComputeSeedPlanunit test suite and an "only references known-safe features"/"never references Administrative/platform reports" regression test, mirroring Chapter 11, before considering the package done. - Confirm on
GET api/Subscription/Packages/pricingthat the package appears correctly before registering any real or test tenant against it.
12.4 Read-only production checks (if this work is deployed)
Since no migration or destructive change is involved, the only recommended production check after
deploy is confirming the seeders ran cleanly (search production logs for "Completed seeding Shumoul subscription packages" with the expected Inserted=4 on first deploy, Inserted=0 thereafter) and
that GET api/Subscription/Packages/pricing returns all four new packages alongside the three existing
ones with no duplicates.
