wengz-credits-payments
Changes Wengz credits, packages, subscriptions, payment proofs, provider wallet, withdrawals, or finance settings. Use when touching credit-logic, subscription/payment routers, free trial, settleCompl
Files1
View on GitHubSKILL.md.cursor/skills/wengz-credits-payments/SKILL.md
GitHubWengz credits, payments, and wallet
Prerequisites
- Business:
docs/ADVANCED_BUSINESS.md§§ Commercial model, Provider earnings, Client journey steps 6–9 / 14. - Technical:
docs/ADVANCED_TECHNICAL.md(cron release holds, env).
Client money path
- Free trial —
assignFreeClientSubscriptionon client approve (free-client-subscription.ts). Once per user (isFreeTrialUsed). Silent no-op if free package missing — surface errors if changing that behavior. - Subscribe paid —
subscription.subscribe→ inactive sub; old active plan stays spendable until proof approved. - Proof —
payment.submitProof(USD amount = package price; ≤10MB image). Bank / InstaPay only. - Approve —
payment.approvePayment(FM/SA): CAS proof, deactivate other actives, activate paid, reset period; does not carry leftover credits from old plan. - Reject — cancel that pending sub only.
- Spend —
checkAndDeductCredits/ revision paid path:isActive+endDate >= now+ package service scope.
Provider money path
- Client/staff approve delivered →
settleCompletedRequest→ ledger HOLD + wallet held balances. - Cron
release-provider-holds→ available after 7 days. - Withdraw / dispute → FM/SA review with proof (
provider-wallet.ts, admin finance).
Invariants
| Rule | Enforcement |
|---|---|
| No spend on unpaid (inactive) sub | credit-logic / create-request |
| File/voice attributes add 0 credits | attribute-validation |
| Settlement ≠ package price | finance-settings credit USD price |
| No automatic payout gateway | manual FM/SA |
addCredits unused |
do not invent refunds without product decision |
Checklist
- Correct procedure:
clientProcedurevsfinanceManagerProcedure. - Invalidate subscription cache when activating/cancelling when helpers exist.
- Notify client with recipient locale.
- Update business doc if money rules change.
Related: .cursor/skills/wengz-domain-workflows/SKILL.md