@adonis-agora/payments 0.8.1 → 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 (44) hide show
  1. package/CHANGELOG.md +41 -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/testing/in_memory_billing_store.d.ts +5 -1
  40. package/dist/src/testing/in_memory_billing_store.d.ts.map +1 -1
  41. package/dist/src/testing/in_memory_billing_store.js +63 -3
  42. package/dist/src/testing/in_memory_billing_store.js.map +1 -1
  43. package/package.json +1 -1
  44. package/dist/assets/spa/assets/index-BQtKssQN.js +0 -10
package/CHANGELOG.md CHANGED
@@ -1,5 +1,46 @@
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
+
3
44
  ## 0.8.1
4
45
 
5
46
  ### Patch Changes