Purpose
Purchases and Pro Access enforce Firestruct's commercial access model. Free users can connect projects, inspect read-only data, use Settings, and use Support. Pro access unlocks write, destructive, export/import, upload, deploy, script, and saved-workflow capabilities.
Entitlements
The app supports:
- Pro monthly
- Pro yearly
- lifetime purchase
- restore purchase
Gated Capabilities
Current Pro feature gates include:
- Auth import/export
- Auth writes
- Auth scripts
- Firestore export
- Firestore import
- Firestore writes
- saved Firestore queries
- saved Firestore scripts
- Firestore scripts
- Firestore transfer
- Index Advisor sync
- migration apply
- Push send
- Push token scripts
- seed apply
- seed template files
- Storage writes
- Workspace deploy
- Workspace link persistence
Paywall Behavior
When a gated action is requested without entitlement, the app should present the paywall before work begins. The paywall must not enqueue tasks or mutate local/external state until purchase or restore succeeds.
The paywall should name the requested capability so users understand why it appeared. For example, exporting Auth users, applying a seed, uploading Storage objects, or running a Firestore script should each connect the purchase prompt to the action the user selected.
Restore purchase must be easy to find and should update entitlement state before the blocked action resumes. If restore fails, the app should leave the original operation unstarted and show an actionable StoreKit or network error.
Current local verification covers the app-state boundary: successful purchase service completion activates Pro access and closes the paywall, restore activates Pro access when an active entitlement is returned, restore with no active entitlement keeps the paywall open with a clear status message, and failed purchase keeps the original gated operation unstarted. This is not StoreKit transaction proof; a local StoreKit test-plan run or approved sandbox purchase run is still required before claiming purchase/restore execution through StoreKit itself.
Safety
Pro access does not bypass project read-only mode or production confirmation. Entitlement, read-only, and confirmation checks are separate guardrails.
Verification
swift test --filter StoreKitReleaseWiringTestspassed on 2026-06-26 with 9 tests.- Remaining release gate: run a real StoreKit local configuration or sandbox flow that records purchase success and restore success or actionable restore failure through StoreKit itself.
Source Anchors
Sources/FirestructApp/Features/Purchases/Model/ProAccessState.swiftSources/FirestructApp/Features/Purchases/Services/AppModel+Purchases.swiftSources/FirestructApp/Features/Purchases/Services/StoreKitPurchaseService.swiftSources/FirestructApp/Features/Purchases/UI/PaywallView.swift