# Domain Entities — Unit: Offerings ## Entity Relationships ```mermaid %%{init: {'themeVariables': {'primaryTextColor':'#000000','textColor':'#000000','tertiaryTextColor':'#000000'}}}%% graph TD offering["Offering
(entity)"] public_dto["OfferingDto
(public contract, FR-6)"] admin_dto["OfferingAdminDto
(admin view, FR-7)"] offering -->|"projected to (excludes IsDeleted/DeletedAt)"| public_dto offering -->|"projected to (adds DisplayOrder)"| admin_dto classDef entity fill:#bee3f8,stroke:#0d47a1,stroke-width:2px,color:#000000,font-weight:bold; classDef dto fill:#fed7aa,stroke:#e65100,stroke-width:2px,color:#000000,font-weight:bold; class offering entity; class public_dto,admin_dto dto; ``` Text alternative: the single `Offering` entity projects into two different DTO shapes — the public contract (no internal/administrative fields) and the admin view (adds `DisplayOrder` for the list UI) — blue for the stateful entity, orange for the two value-object projections. ## Entity Definitions ### Offering | Field | Type | Required | Description | |---|---|---|---| | `Id` | `Guid` | Yes | System-generated (Application Design Q4 = A). Public contract exposes this as a `string`. | | `Title` | `string` | Yes | Max 100 characters (Functional Design Q3 = A). | | `Description` | `string` | Yes | Max 500 characters. | | `Price` | `string` | Yes | Max 50 characters. Pre-formatted display string, not numeric (FR-5) — e.g. `"€ 300"` or `"Op maat"`. | | `PriceNote` | `string` | Yes | Max 100 characters. | | `Features` | `List` | Yes | Min 1, max 10 items; each item max 200 characters. Ordered — array order is display order. | | `CtaLabel` | `string` | Yes | Max 50 characters. | | `Featured` | `bool` | No (default `false`) | At most one non-deleted `Offering` may have this `true` at any time (US-10, enforced in `IOfferingsService`, not at the database/constraint level — see business-rules.md). | | `DisplayOrder` | `int` | Yes | Determines public array order and admin list order. Unique among non-deleted offerings; not necessarily contiguous after deletions (soft delete does not renumber). | | `IsDeleted` | `bool` | Yes (default `false`) | Soft-delete flag (Application Design Q5 = B). Never exposed on either DTO. | | `DeletedAt` | `DateTimeOffset?` | No | Set when `IsDeleted` becomes `true`. Never exposed on either DTO. | | `CreatedAt` | `DateTimeOffset` | Yes | Set once on creation. Part of the SECURITY-13 audit trail ("when"). | | `UpdatedAt` | `DateTimeOffset` | Yes | Set on every create/update. Same rationale as `CreatedAt`. | | `LastModifiedByUserId` | `Guid` | Yes | The authenticated admin's user id, set on every create/update/delete (NFR Requirements Q3 = A). Closes the "who" half of the SECURITY-13 open item alongside `CreatedAt`/`UpdatedAt`'s "when" — together a minimal audit trail without building a full audit-log table. | ### OfferingDto (public contract, FR-6) | Field | Type | Maps From | |---|---|---| | `id` | `string` | `Offering.Id.ToString()` | | `title` | `string` | `Offering.Title` | | `description` | `string` | `Offering.Description` | | `price` | `string` | `Offering.Price` | | `priceNote` | `string` | `Offering.PriceNote` | | `features` | `string[]` | `Offering.Features` | | `ctaLabel` | `string` | `Offering.CtaLabel` | | `featured` | `bool` | `Offering.Featured` | ### OfferingAdminDto (admin view, FR-7) Same fields as `OfferingDto`, plus: | Field | Type | Maps From | |---|---|---| | `displayOrder` | `int` | `Offering.DisplayOrder` | `IsDeleted`/`DeletedAt`/`CreatedAt`/`UpdatedAt`/`LastModifiedByUserId` are intentionally not exposed on either DTO — soft-deleted rows are never returned to any caller (repository-level filtering, per services.md), and the audit fields exist for potential future audit tooling, not for display in this unit's admin UI.