New Update for Stored Value Engine
Health:
Previous Updates
On Trackabout 1 month ago by Lars Daniel Blom Rasmussen
## Phase 1 Status: All Code Complete — Awaiting Merge
All code for Phase 1 (Punchcards MVP) is written, tested, and in PRs with passing CI across all repositories. The SVE is fully integrated in both the Storefront and Backoffice.
### Open PRs Ready for Review & Merge
| Repo | PR | Title | CI |
|------|----|-------|----|
| stored-value-engine | #9 | Punchcard-purchased SQS handler + notification pipeline | Building |
| storefront | #433 | amountCoveredCents for price calculation | Passing |
| backoffice | #3855 | Punchcards integration for Backoffice | Passing |
| api-storefront | #239 | Shadow SVE voucher lookup | Passing |
| api-payment | #336 | Punchcard checkout endpoint | Passing |
| api-payment | #300 | Punchcard redemption at checkout | Passing |
| email-templates | #129 | Punchcard-bought email template | Passing |
| infrastructure-shared | #186 | ECR repo for notification Lambda | Passing |
| infrastructure-core | #1635 | Notification Lambda infrastructure | Blocked (needs tfvars) |
### Completed Today (Feb 23)
- ✅ US-7139: Receipt page link issue — resolved (component updated to show email notification message)
- ✅ US-6981: Feature flag wiring — confirmed already fully wired across all layers
- ✅ US-7137: i18n translations for receipt page — 4 keys added across 9 locales
- ✅ US-7147: Email notification pipeline — code, template, infrastructure, and CI/CD all in PRs
- ✅ POEditor translation files created for email template (9 locales)
- ✅ US-7156: Created VAT handling ticket for punchcards & gift cards (EU SPV/MPV rules)
### Deployment Sequence for Notification Lambda
1. Merge infrastructure-shared PR #186 (ECR repo)
2. Merge SVE PR #9 (builds + pushes notification image)
3. Add image tag to Terraform Cloud dev workspace tfvars
4. Merge infrastructure-core PR #1635 (Lambda + SQS + SNS wiring)
### Phase 1 Checklist (per PRD)
- [x] Token / TokenType aggregates
- [x] Handler interface and registry (via policy pattern)
- [x] Punchcard handler implementation
- [x] Backoffice: Punchcards under Settings → Integrations (PR #3855)
- [x] Storefront: Punchcard purchase flow (PRs #433, #336)
- [x] Storefront: Punchcard redemption at checkout (PR #300)
- [x] Purchase confirmation email (PRs #9, #129, #1635, #186)
- [ ] Extension scopes and role integration (US-6686 — deferred)
- [ ] VAT handling (US-7156 — new, backlog)
On Trackabout 1 month ago by Lars Daniel Blom Rasmussen
## SVE Integration Status — Phase 1
### Completed Today
- **US-7147**: Punchcard purchase confirmation email — delivery pipeline sender, email template, infrastructure (3 PRs)
- **US-7137**: Receipt page translations — all 9 locales updated with 4 missing keys
- **US-7139**: Broken receipt link — resolved (email notification replaces broken share link)
- **US-6981**: Feature flag wiring — confirmed already fully wired across all layers
### Open PRs (All passing CI, ready for merge)
| Repo | PR | Title | Status |
|------|-----|-------|--------|
| storefront | #433 | Punchcard price calculation + redemption (US-6685) | ✅ Passing |
| backoffice | #3855 | Punchcards integration page (US-6683) | ✅ Passing |
| api-storefront | #239 | Shadow SVE voucher lookup | ✅ Passing |
| api-payment | #336 | Punchcard checkout endpoint | ✅ Passing |
| stored-value-engine | #9 | Punchcard handler + notification | ✅ Passing |
| email-templates | #129 | Punchcard bought template | ✅ Passing |
| infrastructure-core | #1635 | Notification Lambda infra | ✅ Passing |
### Remaining for Production
- Merge open PRs to dev branches
- ECR repository for notification Lambda
- Dockerfile + CI/CD for notification Lambda
- POEditor translation imports for email template
- E2E testing of complete purchase flow
### Phase 1 Scope Assessment
All critical Phase 1 code is written and in PR. The Storefront purchase flow, redemption flow, backoffice integration, email confirmation, and feature flag pipeline are all implemented. No blocking issues remain.
On Trackabout 1 month ago by Lars Daniel Blom Rasmussen
## Stored Value Engine — Project Status Update (Feb 15, 2026)
### Overview
The SVE is an infrastructure layer for managing stored value tokens (Gift Cards, Punchcards, Entry Passes). It uses a "dumb ledger" architecture with handlers owning all business logic. Built with Go, DDD, CQRS, event sourcing, and ConnectRPC.
**Repos:** `stored-value-engine` (core engine), `storefront` (frontend + storefronts-core proxy)
**Lead:** Lars Daniel Blom Rasmussen
**PRD:** [Notion](https://www.notion.so/2ea657695d5981daad7cc4d58718af6e)
---
### Issue Tracker (27 issues total)
#### ✅ Done (16 issues)
| Issue | Title | Priority |
|-------|-------|----------|
| US-6678 | Set up SVE service skeleton with go-domain | — |
| US-6679¹ | Implement Token and TokenType aggregates | — |
| US-6680¹ | Implement Handler interface and registry | — |
| US-6681¹ | Implement Punchcard handler | — |
| US-6682 | Build SVE RPC API | — |
| US-6688 | Update price calculation for punchcard support | — |
| US-6689 | Include appliedPunchcard in booking submission | — |
| US-6690 | Call redeemPunchcard API on booking completion | — |
| US-6691 | Implement gateway-agnostic punchcard purchase (backend) | — |
| US-6694 | Write Playwright E2E tests for punchcard flows | — |
| US-6696 | Punchcards feature missing translations | Bug |
| US-6698 | Missing error interceptor to map domain errors to ConnectRPC | High |
| US-6699 | Missing testdata factories for domain aggregates | Medium |
| US-6700 | Missing command handler tests for token/token_type | High |
| US-6702 | Handlers layer violates DDD — use domain policies instead | High |
| US-6704 | Missing mock generation setup | Medium |
| US-6707 | Code lookup uses in-memory map — DynamoDB GSI implemented | High |
| US-6723 | SVE: Support items with quotedPrice/quantityLeft in gift card lookup | High |
| US-6752 | [Critical] Implement DynamoDB-backed Code Lookup | Urgent |
| US-6753 | [Critical] Validate gift card redemption amount matches item values | Urgent |
| US-6754 | Enforce punchcard ExperienceID restriction on redemption | Medium |
| US-6755 | Enforce gift card config flags (AllowPartialRedemption, Min/Max) | Medium |
¹ Issues US-6679/6680/6681 are in Backlog status but the work was done as part of the initial skeleton — status needs updating.
#### 🔄 In Review (4 issues)
| Issue | Title | Priority |
|-------|-------|----------|
| US-6683 | Backoffice: Punchcards integration page | — |
| US-6684 | Storefront: Punchcard purchase flow | — |
| US-6685 | Storefront: Punchcard redemption at checkout | — |
| US-6697 | Missing event sourcing infrastructure (event processor, reconciler) | Urgent |
| US-6756 | [Architectural] Implement Policy pattern for business rules | Low |
#### 🚧 In Progress (1 issue)
| Issue | Title | Priority |
|-------|-------|----------|
| US-6981 | Wire punchcard feature flag through storefronts-core to storefront-web | High |
#### 📋 Backlog (6 issues)
| Issue | Title | Priority |
|-------|-------|----------|
| US-6686 | Define extension scopes and role integration | — |
| US-6692 | Add punchcard balance and remaining punches display | — |
| US-6693 | Add comprehensive punchcard error handling | — |
| US-6701 | Error codes should use typed ErrorCode instead of string constants | Low |
| US-6703 | Missing dependency injection pattern using singleton/transient | Medium |
| US-6705 | Missing validation library usage — use go-validate | Low |
| US-6706 | Missing go-garden integration for lifecycle orchestration | Medium |
| US-6708 | Feature layer adapters duplicate repository interfaces | Low |
| US-6709 | Missing observability setup (logging, metrics, tracing) | Medium |
| US-6795 | Add "expired" status for gift cards with automatic expiration | Medium |
| US-6796 | Configurable code prefix per tenant | Low |
| US-6928 | Backoffice: Manual punchcard redemption via QR scanner | Medium |
---
### Open PRs
| Repo | PR | Title |
|------|----|-------|
| storefront | [#433](https://github.com/understory-io/storefront/pull/433) | feat: add amountCoveredCents to AppliedPunchcard for price calculation (US-6685) |
| stored-value-engine | [#1](https://github.com/understory-io/stored-value-engine/pull/1) | chore: Configure Renovate |
---
### Recent Progress (This Session)
**US-6981: Wire punchcard feature flag** — Committed and pushed to `feature/storefronts-core-punchcard-api` (PR #433). The `/punchcards` storefront page was always returning 404 because the punchcard feature flag was missing from every layer of the pipeline: proto → Go models → Go mappers → frontend mapper. Now wired end-to-end across 14 files:
- Added `Punchcards` to proto `Features` message (both backend and frontend copies)
- Added to Go domain model, external API model, and both mappers
- Added to frontend `mapFeatures()` in `storefronts-core.ts`
- Removed TODO/inline type hack from `punchcards.tsx`
- Bumped `@understory-io/utils-types` from 0.0.6 → 0.0.15 (already included `PunchcardsFeature`)
---
### Key Risks & Blockers
1. **Event sourcing infra (US-6697)** — In Review but critical. Without event processor + reconciler, views never get populated, blocking local E2E testing of storefronts-core.
2. **No production deployment yet** — SVE runs locally only. Needs infrastructure (Lambda, DynamoDB tables, API Gateway) to be provisioned.
3. **Punchcard feature flag in profiles API** — The external profiles API (main backend) also needs to return `punchcards.enabled` for companies that have it configured. Currently only the local pipeline is wired.
### Next Steps
1. Move US-6981 to Done once PR #433 is merged
2. Complete local E2E testing of punchcard purchase flow (blocked on event sourcing infra)
3. Address backlog items by priority: observability (US-6709), lifecycle orchestration (US-6706), DI pattern (US-6703)
4. Plan production deployment infrastructure