A repository themed on Salesforce and external system integration: a booking system (NestJS / Next.js) integrated with Salesforce in both directions, carried through requirements → design → implementation → testing → live verification.
The booking projection list on the Experience Site. Bookings eligible for cancellation are highlighted.
When a cancellation is accepted from the site, the processing status transitions from QUEUED to SUCCEEDED, and the booking status is updated to CANCELLED.
Cancellation accepted (processing status: QUEUED)
Processing complete (processing status: SUCCEEDED, booking status updated)
The admin console on the booking system side, reflecting the cancellation result.
- ✅ Two-way integration — booking projection (booking → SF) and cancel commands (SF → booking)
- ✅ Live verification — 5 browser test items + 8 automated verification items, all passed (including fault induction → manual recovery)
- ✅ Security — JWT Bearer authentication, idempotent commands, row-level sharing (Sharing Set), CRUD/FLS
- ✅ Documentation-driven — 24 documents across three stages (requirements, basic design, detailed design) + a verification coverage ledger
flowchart LR
subgraph BS["booking-system (separate repo)"]
FE["Next.js UI"] --> BE["NestJS API"] --> DB[("PostgreSQL")]
end
subgraph SF["Salesforce"]
SITE["Experience Site (LWC)"]
APEX["Apex REST / Queueable"]
OBJ[("Booking__c / Booking_Command__c")]
end
BE -- "① Booking projection (ECA, JWT Bearer)" --> APEX
APEX --> OBJ
SITE --> OBJ
SITE -- "② Cancel command (Named Credential)" --> BE
| # | Scenario | Path | Verified result |
|---|---|---|---|
| ① | Booking projection booking → SF | NestJS → ECA (JWT Bearer) → Apex REST | Canonical changes reflected in Booking__c, SYNCED |
| ② | Cancel command SF → booking | Site LWC → Queueable → NC → Guard auth + 5-step validation → version+1 | SUCCEEDED, both sides CANCELLED/v1/SYNCED |
| ③ | Failure & recovery | Tunnel down → HTTP 530×3 → FAILED → RESET DML + re-enqueue (same commandId) | SUCCEEDED, idempotency proven (side effect exactly once) |
| Category | Result |
|---|---|
| Automated verification | 8 items, all passed (equivalent to MV-04–06, 08–11) |
| Browser live tests | 5 items, all passed (MV-01/02/03, 07, 08) |
| Unit tests | Apex 36/36 (4 booking classes, aggregate coverage 88.55%) / Backend Jest 273/273 / Frontend Jest 94/94 |
| Failure recovery | Command induced to FAILED → manual retry → SUCCEEDED (idempotency proven) |
| Type | File | Role |
|---|---|---|
| Apex | BookingProjectionRest.cls | IF-01 receiver (idempotency, version gate, upsert) |
| Apex | BookingProjectionDmlHelper.cls | Projection DML (explicit system context) |
| Apex | BookingCommandQueueable.cls | IF-02 command execution + result write-back |
| Apex | BookingSiteController.cls | Site LWC backend (list / cancel / polling) |
| Test | BookingProjectionRestTest / BookingSiteControllerTest / BookingCommandQueueableTest | Unit tests for the 4 classes above |
| LWC | bookingProjectionList | Booking projection list (3-second polling, terminal-state display) |
| Objects | Booking__c / Booking_Command__c | Canonical snapshot (incl. version-monotonic VR) / command |
| Security | Booking_Projection_Sharing.sharingSet / PermissionSets ×3 | Row-level sharing (per Account) / Site & integration user permissions |
| Integration config | Named Credential / External Credential / ECA | IF-02 outbound entry / static Bearer / IF-01 JWT Bearer (Api, RefreshToken) |
| Chain | Resources |
|---|---|
| LWC | showcaseContactList / showcaseContactCreate / ShowcaseContactController.cls (+2 Tests) / ContactCreated channel (LMS same-page refresh) |
| Aura | BulkCreateContactQuickAction → BulkCreateComponent → BulkCreateComponentChild / ContactDataController.cls (+Test, keyset paging / server-side trust boundary) / EventService (unified Apex gateway + in-table event bus) / quickActions ×2 |
| Repository | Key resources |
|---|---|
| Cho-Geer/booking-backend | integrations module (Guard, commands, projection sender) / integration.guard.ts / integration migration p02 (contract) / p03 (mapping) |
| Cho-Geer/booking-frontend | SalesforceWorkbenchEntry.tsx (3-state gate) / AdminPage.tsx |
Requirements definition (8)
- 01 Requirements List (business background & scope)
- 02 NFR List / 03 Business List / 04 Business Flow
- 05 Business Rules / 06 Glossary / 07 Systemization Scope / 08 To-Be Model & Issues
Basic design (12)
- system-architecture (overall structure) / interface-design (IF-01/02 contracts, auth, timeouts, payloads)
- function-design / function-list / screen-items / screens
- erd / common-design (permissions & PII policy) / nonfunctional-design / code-list / data-migration / reports
Detailed design (4) + ledger
- module-design / table-definitions / unit-test-spec / batch-design
- Ledger: coverage-matrix-summary.xlsx (deliverable × verification mapping, 17 sheets)
- 01 Requirements List — business background and scope
- interface-design.md — IF-01/02 contracts (auth, timeouts, payloads)
- BookingProjectionRest.cls — receiving-side implementation (idempotency, version gate)
- integration-commands.service.ts — sending-side Guard auth + 5-step validation and retry
- coverage-matrix-summary.xlsx — full deliverable × verification ledger
Zixi Tao — Salesforce & external system integration (design, implementation, testing, failure recovery)
Deploy this repo: sf project deploy start -o <org-alias>
Companion repos: booking-backend / booking-frontend (see each repo's README for setup)




