2.1 KiB
2.1 KiB
Offering schedule (offering-schedule)
- Slug: offering-schedule
- Type: Feature (small), built outside the AI-DLC flow and documented afterwards
- Status: Commits
8af156cand32b98feonfeature/contact-forms-module; on the test hosts once CI run 109 is deployed (not merged, nothing in production) - Affected components:
SlpModularCms.Modules.Offerings(+ Tests),openapi/slpsoftware.v1.json, frontend admin (frontend/src/features/offerings) - Documented: 2026-11-15
- Documentation Language: English
- Conversation Language: Dutch (user language)
Not run through the AI-DLC stages; this file records what the code does. There are no
requirements,plansoraudit.md.
Purpose
An offering (package) can be switched on or off and limited to a period, so it can be prepared in advance or retired without deleting it.
Behaviour
| Item | Behaviour |
|---|---|
Fields on Offering |
IsActive (default true), StartsAt?, EndsAt? (UTC). Migration 20261115100000_AddOfferingSchedule. |
| Live | An offering is live when it is switched on, StartsAt is empty or not in the future, and EndsAt is empty or still in the future (OfferingSchedule.IsLive). |
| Public list | GET /api/v1/offerings returns only live offerings, evaluated at request time. Consumers that fetch at build time (the ASF website) therefore get the schedule as it is at the build moment. |
| Administrator list | GET /api/v1/offerings/all (AdminOnly) returns every offering including switched-off, planned and expired ones, with isActive, startsAt and endsAt. |
| Create / update | CreateOfferingRequest / UpdateOfferingRequest accept isActive, startsAt, endsAt; the schedule is validated (OfferingSchedule.Validate, end must be after start). |
| Cache | Every change invalidates the host's index.html cache (SpaFallback hosts), so the SLP markers refresh at once. A schedule boundary that passes on its own is picked up when the cache entry expires (about 60 seconds). |
| Admin UI | The package form has the schedule fields and a Cancel button; the featured star keeps the schedule. The list loads /offerings/all. |