Add Community Formula Library feature

Companies can now share their custom formula templates to a platform-wide
community library. Other tenants can browse, preview, and import formulas
as independent local copies. Includes attribution (source company name),
"Inspired by" lineage for re-contributed formulas, import counts, own-formula
badge, cascade diagram nullification, and AI assistant + help docs updates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-27 21:54:51 -04:00
parent 32d09b38f1
commit ca7e905832
24 changed files with 12959 additions and 10 deletions
@@ -130,6 +130,10 @@ public class UnitOfWork : IUnitOfWork
// Custom Formula Templates
private IRepository<CustomItemTemplate>? _customItemTemplates;
// Formula Community Library
private IPlainRepository<FormulaLibraryItem>? _formulaLibrary;
private IRepository<FormulaLibraryImport>? _formulaLibraryImports;
// Purchase Orders
private IPurchaseOrderRepository? _purchaseOrders;
private IRepository<PurchaseOrderItem>? _purchaseOrderItems;
@@ -476,6 +480,14 @@ public class UnitOfWork : IUnitOfWork
public IRepository<CustomItemTemplate> CustomItemTemplates =>
_customItemTemplates ??= new Repository<CustomItemTemplate>(_context);
/// <summary>Repository for <see cref="FormulaLibraryItem"/> community library entries; platform-level, no tenant filter.</summary>
public IPlainRepository<FormulaLibraryItem> FormulaLibrary =>
_formulaLibrary ??= new PlainRepository<FormulaLibraryItem>(_context);
/// <summary>Repository for <see cref="FormulaLibraryImport"/> per-company import records; tenant-filtered with soft delete.</summary>
public IRepository<FormulaLibraryImport> FormulaLibraryImports =>
_formulaLibraryImports ??= new Repository<FormulaLibraryImport>(_context);
// Job Templates
/// <summary>Repository for <see cref="JobTemplate"/> reusable job blueprints; tenant-filtered with soft delete.</summary>
public IJobTemplateRepository JobTemplates =>