@adonis-agora/payments 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +61 -0
  2. package/dist/assets/spa/assets/index-6JAJxOK8.js +10 -0
  3. package/dist/assets/spa/assets/{index-BQtKssQN.js.map → index-6JAJxOK8.js.map} +1 -1
  4. package/dist/assets/spa/assets/{index-BqeSOw2s.css → index-D6oPV1WS.css} +1 -1
  5. package/dist/assets/spa/index.html +2 -2
  6. package/dist/providers/dashboard_provider.d.ts +9 -0
  7. package/dist/providers/dashboard_provider.d.ts.map +1 -1
  8. package/dist/providers/dashboard_provider.js +44 -4
  9. package/dist/providers/dashboard_provider.js.map +1 -1
  10. package/dist/src/billing/billing_health.d.ts +3 -1
  11. package/dist/src/billing/billing_health.d.ts.map +1 -1
  12. package/dist/src/billing/billing_health.js +38 -1
  13. package/dist/src/billing/billing_health.js.map +1 -1
  14. package/dist/src/billing/billing_overview.d.ts +14 -6
  15. package/dist/src/billing/billing_overview.d.ts.map +1 -1
  16. package/dist/src/billing/billing_overview.js +52 -1
  17. package/dist/src/billing/billing_overview.js.map +1 -1
  18. package/dist/src/billing/billing_store.d.ts +46 -0
  19. package/dist/src/billing/billing_store.d.ts.map +1 -1
  20. package/dist/src/billing/billing_store.js.map +1 -1
  21. package/dist/src/billing/lucid_billing_store.d.ts +2 -6
  22. package/dist/src/billing/lucid_billing_store.d.ts.map +1 -1
  23. package/dist/src/billing/lucid_billing_store.js +51 -8
  24. package/dist/src/billing/lucid_billing_store.js.map +1 -1
  25. package/dist/src/billing/managed_subscriptions.d.ts.map +1 -1
  26. package/dist/src/billing/managed_subscriptions.js +18 -4
  27. package/dist/src/billing/managed_subscriptions.js.map +1 -1
  28. package/dist/src/billing/mixins/with_subscription.d.ts +12 -0
  29. package/dist/src/billing/mixins/with_subscription.d.ts.map +1 -1
  30. package/dist/src/billing/mixins/with_subscription.js +9 -0
  31. package/dist/src/billing/mixins/with_subscription.js.map +1 -1
  32. package/dist/src/billing/schema.d.ts.map +1 -1
  33. package/dist/src/billing/schema.js +10 -0
  34. package/dist/src/billing/schema.js.map +1 -1
  35. package/dist/src/dashboard/handlers.d.ts +16 -0
  36. package/dist/src/dashboard/handlers.d.ts.map +1 -1
  37. package/dist/src/dashboard/handlers.js +44 -8
  38. package/dist/src/dashboard/handlers.js.map +1 -1
  39. package/dist/src/payments_manager.d.ts.map +1 -1
  40. package/dist/src/payments_manager.js +18 -4
  41. package/dist/src/payments_manager.js.map +1 -1
  42. package/dist/src/testing/in_memory_billing_store.d.ts +5 -1
  43. package/dist/src/testing/in_memory_billing_store.d.ts.map +1 -1
  44. package/dist/src/testing/in_memory_billing_store.js +63 -3
  45. package/dist/src/testing/in_memory_billing_store.js.map +1 -1
  46. package/package.json +1 -1
  47. package/dist/assets/spa/assets/index-BQtKssQN.js +0 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,66 @@
1
1
  # @adonis-agora/payments
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#32](https://github.com/DavideCarvalho/adonis-agora-payments/pull/32) [`de9387c`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/de9387c89c9a850d91e4630a65e907994a1a1d92) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - The console can see — and be trusted about — library-managed subscriptions.
8
+
9
+ Managed subscriptions shipped without the console catching up, and the gap was widest exactly
10
+ where it matters: a managed row has no `gatewayId`, so there is no gateway dashboard to fall
11
+ back to. The console WAS the fallback, and it showed a null id and nothing else.
12
+
13
+ **A dead renewal cron is now visible.** `renewDue` only runs because something calls it; if the
14
+ cron stops, nothing renews, nothing fails, and nothing says so — the revenue just stops. New
15
+ health check `overdue_renewals` counts active managed subscriptions whose next charge came due
16
+ over 2 h ago (configurable via `overdueRenewalAfter`).
17
+
18
+ **A failing renewal is now visible.** A failed cycle deliberately changes nothing on the row —
19
+ the period does not advance, so it retries — which is also why it was invisible: one failing for
20
+ a week looked identical to one due for the first time. The runner now records
21
+ `lastRenewalError`, `lastRenewalAttemptAt` and `renewalFailureCount` (a streak, reset on the
22
+ first success), surfaced as the `failing_renewals` check and in the subscriptions list. The two
23
+ checks are separate because the causes are opposite: one is the cron stopped, the other is the
24
+ cron running and the gateway saying no.
25
+
26
+ **The subscriptions list carries the recurrence.** `amount`, `currency`, `cycle`,
27
+ `currentPeriodEnd`, `nextChargeAt`, `cancelAtPeriodEnd` and the renewal-failure fields, plus a
28
+ `managed` flag so an operator knows there is nothing to open at the gateway.
29
+
30
+ **MRR.** `subscriptionAmountByCycle` groups active managed subscriptions by cycle and the new
31
+ `monthlyRecurringRevenue()` normalises to a month. Managed only — a gateway-owned subscription
32
+ keeps its price at the gateway, and summing both would present half the truth as the total. An
33
+ unknown cycle is skipped rather than counted as monthly: an MRR wrong upwards is worse than an
34
+ incomplete one, because nobody audits a number that looks good.
35
+
36
+ **No more buttons that cannot work.** `GET <api>/providers` now returns per-provider
37
+ capabilities, and `refundable` on a payment row accounts for them. Every paid Woovi/OpenPix Pix
38
+ row offered a Refund the gateway has no API for; the operator found out by clicking. With no
39
+ reachable manager the action is still offered — the previous behaviour, and better than hiding a
40
+ working button because a lookup was unavailable.
41
+
42
+ `BillingCountQuery` gains `managed`, `nextChargeBefore` and `minRenewalFailures`.
43
+
44
+ ## 0.8.1
45
+
46
+ ### Patch Changes
47
+
48
+ - [#30](https://github.com/DavideCarvalho/adonis-agora-payments/pull/30) [`cc34e21`](https://github.com/DavideCarvalho/adonis-agora-payments/commit/cc34e2158268616f66989e7906c9a65c11dfd213) Thanks [@DavideCarvalho](https://github.com/DavideCarvalho)! - An application with no payment providers configured can boot.
49
+
50
+ `PaymentsManager` threw in its CONSTRUCTOR when the driver map was empty. The provider
51
+ resolves the manager during boot — to publish `getPayments()` and to check webhook
52
+ verification — so an app with no credentials configured could not start at all. Not "payments
53
+ are off": the process exits. The message also named `config/payments.ts` at an app that had
54
+ deliberately configured nothing there.
55
+
56
+ That state is legitimate. An application can ship before it has a gateway, and one with a
57
+ "no credentials, subscriptions are simulated" mode runs its whole test suite and local
58
+ development that way.
59
+
60
+ Building an empty manager is now fine; ASKING it for a driver is the error, and `driver()`
61
+ says so with its own message rather than `Driver "" is not configured. Available drivers:
62
+ (none)` — true, and useless.
63
+
3
64
  ## 0.8.0
4
65
 
5
66
  ### Minor Changes