@deliverart/sdk-js-subscription 2.14.1 → 2.14.2

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.
package/README.md CHANGED
@@ -10,6 +10,7 @@ Subscription management package for the Deliverart JavaScript SDK.
10
10
  - subscription CRUD for `infinite`, `consumption` and `time_based`
11
11
  - renewal CRUD for `consumption` and `time_based`
12
12
  - subscription overview from point of sale
13
+ - admin billing queue and billing overview
13
14
  - credit adjustments for consumption subscriptions
14
15
  - renewal payment initialization for `stripe` and `bank_transfer`
15
16
  - manual renewal payment resolution for offline payment methods
@@ -103,7 +104,8 @@ await sdk.call(
103
104
  ```
104
105
 
105
106
  For `bank_transfer`, the purchase or renewal moves to `pending_verification` until a
106
- `ROLE_SUBSCRIPTION_ADMIN` approves or rejects it.
107
+ `ROLE_SUBSCRIPTION_BILLING_ADMIN`, `ROLE_SUBSCRIPTION_ADMIN` or `ROLE_SUPER_ADMIN`
108
+ approves or rejects it.
107
109
 
108
110
  Cancel a non-completed purchase:
109
111
 
@@ -197,6 +199,40 @@ Allowed statuses are `paid`, `failed` and `canceled`.
197
199
 
198
200
  The renewal must typically be in `pending_verification` before manual approval.
199
201
 
202
+ ## Admin Billing Read Models
203
+
204
+ Pending verification queue:
205
+
206
+ ```ts
207
+ import { GetSubscriptionBillingPendingVerification } from '@deliverart/sdk-js-subscription'
208
+
209
+ const queue = await sdk.call(
210
+ new GetSubscriptionBillingPendingVerification({
211
+ query: {
212
+ kind: 'purchase',
213
+ olderThanHours: 24,
214
+ limit: 20,
215
+ },
216
+ }),
217
+ )
218
+ ```
219
+
220
+ Billing overview counters:
221
+
222
+ ```ts
223
+ import { GetSubscriptionBillingOverview } from '@deliverart/sdk-js-subscription'
224
+
225
+ const overview = await sdk.call(new GetSubscriptionBillingOverview())
226
+ ```
227
+
228
+ The overview payload exposes:
229
+
230
+ - pending verification counts for purchases and renewals
231
+ - failed payment counts
232
+ - open purchase counts
233
+ - pending renewal counts
234
+ - a `queuePreview` array with the same item shape returned by the pending verification queue
235
+
200
236
  ## Renewal Lifecycle Actions
201
237
 
202
238
  Consumption renewal: