Lets BreakPilot staff open a product that is still disabled in the catalogue (Werkmeister) for one tenant, for a limited time. Example: a seeded staging tenant for portal#86. Stage and prod stay identical.
Changes
Migration 0018: adds tenant_products.preview and preview_expires_at (with a CHECK). These are separate from a booking's expires_at.
Entitlement check: a disabled product is allowed only under an active preview, and the answer then carries "preview": true.
Expiry is checked at evaluation time (reason preview_expired).
A plain row left over for a product that's off sale stays unknown_product.
Bookings win: a real booking (ERP, trial, catalogue upsert) clears the preview and its expiry, so a preview never cuts off a paid entitlement. A preview over an existing booking is refused with 409.
Usage: usage under a preview is accepted and tagged properties.preview=true, and it never goes to the ERP outbox, so it isn't invoiced.
Claims: a preview product is listed only while its preview is active.
Admin API (staff only, audited):
POST /v1/admin/tenants/{id}/preview-grants with {product, expires_at}, where expires_at is at most 180 days away.
DELETE …/preview-grants/{product}.
Both need a named staff member (X-Staff-Subject).
Tests
Full suite passes; coverage 77.6%; golangci-lint reports 0 issues.
New tests cover: grant, check, expiry, booking clearing a preview, the 409, usage tagging and outbox skip, claims filtering, admin auth.
The companion stage tooling is the orca-platform PR feat/stage-preview-grant (demo-console.sh preview-grant/preview-revoke).
Lets BreakPilot staff open a product that is still disabled in the catalogue (Werkmeister) for one tenant, for a limited time. Example: a seeded staging tenant for portal#86. Stage and prod stay identical.
## Changes
- **Migration 0018:** adds `tenant_products.preview` and `preview_expires_at` (with a CHECK). These are separate from a booking's `expires_at`.
- **Entitlement check:** a disabled product is allowed only under an active preview, and the answer then carries `"preview": true`.
- Expiry is checked at evaluation time (reason `preview_expired`).
- A plain row left over for a product that's off sale stays `unknown_product`.
- **Bookings win:** a real booking (ERP, trial, catalogue upsert) clears the preview and its expiry, so a preview never cuts off a paid entitlement. A preview over an existing booking is refused with 409.
- **Usage:** usage under a preview is accepted and tagged `properties.preview=true`, and it never goes to the ERP outbox, so it isn't invoiced.
- **Claims:** a preview product is listed only while its preview is active.
- **Admin API (staff only, audited):**
- `POST /v1/admin/tenants/{id}/preview-grants` with `{product, expires_at}`, where `expires_at` is at most 180 days away.
- `DELETE …/preview-grants/{product}`.
- Both need a named staff member (`X-Staff-Subject`).
## Tests
- Full suite passes; coverage 77.6%; golangci-lint reports 0 issues.
- New tests cover: grant, check, expiry, booking clearing a preview, the 409, usage tagging and outbox skip, claims filtering, admin auth.
The companion stage tooling is the orca-platform PR `feat/stage-preview-grant` (`demo-console.sh preview-grant/preview-revoke`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Lets BreakPilot staff open a product that is still disabled in the
catalogue (Werkmeister) for one tenant for a limited time, e.g. a seeded
staging tenant for portal#86, without a stage/prod divergence:
- Migration 0018: tenant_products.preview and preview_expires_at, kept
apart from a booking's expires_at.
- Entitlement check: a disabled product is allowed only under an active
preview (answer carries "preview": true); expiry is enforced at check
time (reason preview_expired). A leftover plain row of a product off
sale stays unknown_product.
- A real booking (ERP, trial, catalogue upsert) clears the preview and
its expiry, so it never cuts off a paid entitlement; a preview over a
booking is refused (409).
- Usage under a preview is accepted, tagged properties.preview=true and
kept out of the ERP outbox; claims list a preview product only while
it is active.
- Staff only, audited: POST /v1/admin/tenants/{id}/preview-grants
{product, expires_at ≤ 180 d}, DELETE …/preview-grants/{product}; a
named staff member (X-Staff-Subject) is required.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Lets BreakPilot staff open a product that is still disabled in the catalogue (Werkmeister) for one tenant, for a limited time. Example: a seeded staging tenant for portal#86. Stage and prod stay identical.
Changes
tenant_products.previewandpreview_expires_at(with a CHECK). These are separate from a booking'sexpires_at."preview": true.preview_expired).unknown_product.properties.preview=true, and it never goes to the ERP outbox, so it isn't invoiced.POST /v1/admin/tenants/{id}/preview-grantswith{product, expires_at}, whereexpires_atis at most 180 days away.DELETE …/preview-grants/{product}.X-Staff-Subject).Tests
The companion stage tooling is the orca-platform PR
feat/stage-preview-grant(demo-console.sh preview-grant/preview-revoke).🤖 Generated with Claude Code
Lets BreakPilot staff open a product that is still disabled in the catalogue (Werkmeister) for one tenant for a limited time, e.g. a seeded staging tenant for portal#86, without a stage/prod divergence: - Migration 0018: tenant_products.preview and preview_expires_at, kept apart from a booking's expires_at. - Entitlement check: a disabled product is allowed only under an active preview (answer carries "preview": true); expiry is enforced at check time (reason preview_expired). A leftover plain row of a product off sale stays unknown_product. - A real booking (ERP, trial, catalogue upsert) clears the preview and its expiry, so it never cuts off a paid entitlement; a preview over a booking is refused (409). - Usage under a preview is accepted, tagged properties.preview=true and kept out of the ERP outbox; claims list a preview product only while it is active. - Staff only, audited: POST /v1/admin/tenants/{id}/preview-grants {product, expires_at ≤ 180 d}, DELETE …/preview-grants/{product}; a named staff member (X-Staff-Subject) is required. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>