payment-kit 1.19.0 → 1.19.1

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 (133) hide show
  1. package/api/src/crons/index.ts +8 -0
  2. package/api/src/index.ts +4 -0
  3. package/api/src/libs/credit-grant.ts +146 -0
  4. package/api/src/libs/env.ts +1 -0
  5. package/api/src/libs/invoice.ts +4 -3
  6. package/api/src/libs/notification/template/base.ts +388 -2
  7. package/api/src/libs/notification/template/customer-credit-grant-granted.ts +149 -0
  8. package/api/src/libs/notification/template/customer-credit-grant-low-balance.ts +151 -0
  9. package/api/src/libs/notification/template/customer-credit-insufficient.ts +254 -0
  10. package/api/src/libs/notification/template/subscription-canceled.ts +193 -202
  11. package/api/src/libs/notification/template/subscription-refund-succeeded.ts +215 -237
  12. package/api/src/libs/notification/template/subscription-renewed.ts +130 -200
  13. package/api/src/libs/notification/template/subscription-succeeded.ts +100 -202
  14. package/api/src/libs/notification/template/subscription-trial-start.ts +142 -188
  15. package/api/src/libs/notification/template/subscription-trial-will-end.ts +146 -174
  16. package/api/src/libs/notification/template/subscription-upgraded.ts +96 -192
  17. package/api/src/libs/notification/template/subscription-will-canceled.ts +94 -135
  18. package/api/src/libs/notification/template/subscription-will-renew.ts +220 -245
  19. package/api/src/libs/payment.ts +69 -0
  20. package/api/src/libs/queue/index.ts +3 -2
  21. package/api/src/libs/session.ts +8 -0
  22. package/api/src/libs/subscription.ts +74 -3
  23. package/api/src/libs/ws.ts +23 -1
  24. package/api/src/locales/en.ts +33 -0
  25. package/api/src/locales/zh.ts +31 -0
  26. package/api/src/queues/credit-consume.ts +715 -0
  27. package/api/src/queues/credit-grant.ts +572 -0
  28. package/api/src/queues/notification.ts +173 -128
  29. package/api/src/queues/payment.ts +210 -122
  30. package/api/src/queues/subscription.ts +179 -0
  31. package/api/src/routes/checkout-sessions.ts +157 -9
  32. package/api/src/routes/connect/shared.ts +3 -2
  33. package/api/src/routes/credit-grants.ts +241 -0
  34. package/api/src/routes/credit-transactions.ts +208 -0
  35. package/api/src/routes/index.ts +8 -0
  36. package/api/src/routes/meter-events.ts +347 -0
  37. package/api/src/routes/meters.ts +219 -0
  38. package/api/src/routes/payment-currencies.ts +14 -2
  39. package/api/src/routes/payment-links.ts +1 -1
  40. package/api/src/routes/payment-methods.ts +14 -2
  41. package/api/src/routes/prices.ts +43 -0
  42. package/api/src/routes/pricing-table.ts +13 -7
  43. package/api/src/routes/products.ts +63 -4
  44. package/api/src/routes/settings.ts +1 -1
  45. package/api/src/routes/subscriptions.ts +4 -0
  46. package/api/src/store/migrations/20250610-billing-credit.ts +43 -0
  47. package/api/src/store/models/credit-grant.ts +486 -0
  48. package/api/src/store/models/credit-transaction.ts +268 -0
  49. package/api/src/store/models/customer.ts +8 -0
  50. package/api/src/store/models/index.ts +52 -1
  51. package/api/src/store/models/meter-event.ts +423 -0
  52. package/api/src/store/models/meter.ts +176 -0
  53. package/api/src/store/models/payment-currency.ts +66 -14
  54. package/api/src/store/models/price.ts +6 -0
  55. package/api/src/store/models/product.ts +2 -2
  56. package/api/src/store/models/subscription.ts +24 -0
  57. package/api/src/store/models/types.ts +28 -2
  58. package/api/tests/libs/subscription.spec.ts +53 -0
  59. package/blocklet.yml +9 -1
  60. package/package.json +4 -4
  61. package/scripts/sdk.js +233 -1
  62. package/src/app.tsx +10 -0
  63. package/src/components/collapse.tsx +11 -1
  64. package/src/components/customer/credit-grant-item-list.tsx +99 -0
  65. package/src/components/customer/credit-overview.tsx +233 -0
  66. package/src/components/customer/form.tsx +5 -2
  67. package/src/components/invoice/list.tsx +19 -1
  68. package/src/components/metadata/form.tsx +286 -90
  69. package/src/components/meter/actions.tsx +101 -0
  70. package/src/components/meter/add-usage-dialog.tsx +239 -0
  71. package/src/components/meter/events-list.tsx +657 -0
  72. package/src/components/meter/form.tsx +245 -0
  73. package/src/components/meter/products.tsx +264 -0
  74. package/src/components/meter/usage-guide.tsx +174 -0
  75. package/src/components/payment-currency/form.tsx +2 -0
  76. package/src/components/payment-intent/list.tsx +19 -1
  77. package/src/components/payment-link/preview.tsx +1 -1
  78. package/src/components/payment-link/product-select.tsx +52 -12
  79. package/src/components/payment-method/arcblock.tsx +2 -0
  80. package/src/components/payment-method/base.tsx +2 -0
  81. package/src/components/payment-method/bitcoin.tsx +2 -0
  82. package/src/components/payment-method/ethereum.tsx +2 -0
  83. package/src/components/payment-method/stripe.tsx +2 -0
  84. package/src/components/payouts/list.tsx +19 -1
  85. package/src/components/price/currency-select.tsx +51 -31
  86. package/src/components/price/form.tsx +881 -407
  87. package/src/components/pricing-table/preview.tsx +1 -1
  88. package/src/components/product/add-price.tsx +9 -7
  89. package/src/components/product/create.tsx +7 -4
  90. package/src/components/product/edit-price.tsx +21 -12
  91. package/src/components/product/features.tsx +17 -7
  92. package/src/components/product/form.tsx +104 -89
  93. package/src/components/refund/list.tsx +19 -1
  94. package/src/components/section/header.tsx +5 -18
  95. package/src/components/subscription/items/index.tsx +1 -1
  96. package/src/components/subscription/metrics.tsx +37 -5
  97. package/src/components/subscription/portal/actions.tsx +2 -1
  98. package/src/contexts/products.tsx +26 -9
  99. package/src/hooks/subscription.ts +34 -0
  100. package/src/libs/meter-utils.ts +196 -0
  101. package/src/libs/util.ts +4 -0
  102. package/src/locales/en.tsx +385 -4
  103. package/src/locales/zh.tsx +364 -0
  104. package/src/pages/admin/billing/index.tsx +61 -33
  105. package/src/pages/admin/billing/invoices/detail.tsx +1 -1
  106. package/src/pages/admin/billing/meters/create.tsx +60 -0
  107. package/src/pages/admin/billing/meters/detail.tsx +435 -0
  108. package/src/pages/admin/billing/meters/index.tsx +210 -0
  109. package/src/pages/admin/billing/meters/meter-event.tsx +346 -0
  110. package/src/pages/admin/billing/subscriptions/detail.tsx +47 -14
  111. package/src/pages/admin/customers/customers/credit-grant/detail.tsx +391 -0
  112. package/src/pages/admin/customers/customers/detail.tsx +22 -10
  113. package/src/pages/admin/customers/index.tsx +5 -0
  114. package/src/pages/admin/developers/events/detail.tsx +1 -1
  115. package/src/pages/admin/developers/index.tsx +1 -1
  116. package/src/pages/admin/payments/intents/detail.tsx +1 -1
  117. package/src/pages/admin/payments/payouts/detail.tsx +1 -1
  118. package/src/pages/admin/payments/refunds/detail.tsx +1 -1
  119. package/src/pages/admin/products/index.tsx +3 -2
  120. package/src/pages/admin/products/links/detail.tsx +1 -1
  121. package/src/pages/admin/products/prices/actions.tsx +16 -4
  122. package/src/pages/admin/products/prices/detail.tsx +30 -3
  123. package/src/pages/admin/products/prices/list.tsx +8 -1
  124. package/src/pages/admin/products/pricing-tables/detail.tsx +1 -1
  125. package/src/pages/admin/products/products/create.tsx +233 -57
  126. package/src/pages/admin/products/products/detail.tsx +2 -1
  127. package/src/pages/admin/settings/payment-methods/index.tsx +3 -0
  128. package/src/pages/customer/credit-grant/detail.tsx +308 -0
  129. package/src/pages/customer/index.tsx +35 -2
  130. package/src/pages/customer/recharge/account.tsx +5 -5
  131. package/src/pages/customer/subscription/change-payment.tsx +4 -2
  132. package/src/pages/customer/subscription/detail.tsx +48 -14
  133. package/src/pages/customer/subscription/embed.tsx +1 -1
@@ -7,10 +7,16 @@ export default flat({
7
7
  estimated: 'Estimated',
8
8
  metadata: {
9
9
  label: 'Metadata',
10
+ description: 'Add custom key-value pairs to store additional information about this meter.',
10
11
  add: 'Add more metadata',
11
12
  edit: 'Edit metadata',
12
13
  empty: 'No metadata',
13
- emptyTip: "You haven't added any metadata you can add it",
14
+ emptyTip: "You haven't added any metadata yet, you can add it",
15
+ formMode: 'Switch to form mode',
16
+ jsonMode: 'Switch to JSON mode',
17
+ jsonPlaceholder: 'Enter JSON data...',
18
+ invalidJson: 'Invalid JSON format, please check your input',
19
+ formatJson: 'Format JSON',
14
20
  },
15
21
  price: 'Price',
16
22
  add: 'Add',
@@ -51,6 +57,19 @@ export default flat({
51
57
  friday: 'Friday',
52
58
  saturday: 'Saturday',
53
59
  },
60
+ name: 'Name',
61
+ status: 'Status',
62
+ remainingCredit: 'Remaining Credit',
63
+ scope: 'Scope',
64
+ effectiveDate: 'Effective Date',
65
+ expirationDate: 'Expiration Date',
66
+ creditGrant: 'Credit Grant',
67
+ subscription: 'Subscription',
68
+ meterEvent: 'Meter Event',
69
+ creditAmount: 'Credit',
70
+ createdAt: 'Created At',
71
+ general: 'All usage-based prices',
72
+ specific: 'Specific usage-based prices',
54
73
  },
55
74
  notification: {
56
75
  preferences: {
@@ -88,9 +107,227 @@ export default flat({
88
107
  billing: 'Billing',
89
108
  invoices: 'Invoices',
90
109
  subscriptions: 'Subscriptions',
110
+ meters: 'Meters',
111
+ meterEvents: {
112
+ title: 'Meter Events',
113
+ },
114
+ meter: {
115
+ add: 'Add meter',
116
+ edit: 'Edit meter',
117
+ save: 'Save meter',
118
+ saved: 'Meter successfully saved',
119
+ activate: 'Activate meter',
120
+ activated: 'Meter activated successfully',
121
+ deactivate: 'Deactivate meter',
122
+ deactivated: 'Meter deactivated successfully',
123
+ deleted: 'Meter deleted successfully',
124
+ deleteConfirm: 'Are you sure you want to delete this meter? This action cannot be undone.',
125
+ activateConfirm: 'Are you sure you want to activate this meter? It will start collecting usage data.',
126
+ deactivateConfirm:
127
+ 'By deactivating, no further events for this meter can be reported. Attempts to create events for this meter will return an error. Previously reported usage will remain. You can reactivate at any time.',
128
+ view: 'View meter',
129
+ basicInfo: 'Basic information',
130
+ basicInfoDescription: 'Configure the core settings for your meter to track usage events.',
131
+ editDescription:
132
+ 'Update the meter name, description, and metadata. Core settings like event name and aggregation method cannot be changed.',
133
+ inactive: 'Meter is inactive',
134
+ inactiveTip: 'This meter is not collecting usage data. Activate it to start tracking events.',
135
+ name: {
136
+ label: 'Meter name',
137
+ required: 'Meter name is required',
138
+ placeholder: 'API requests',
139
+ help: 'A descriptive name for this meter that will be displayed in your dashboard.',
140
+ },
141
+ eventName: {
142
+ label: 'Event name',
143
+ required: 'Event name is required',
144
+ placeholder: 'api_request',
145
+ help: 'The event name that will be sent to this meter',
146
+ editHelp: 'Event name cannot be changed after meter creation to maintain data consistency.',
147
+ },
148
+ aggregationMethod: {
149
+ label: 'Aggregation method',
150
+ required: 'Aggregation method is required',
151
+ sum: 'Sum',
152
+ sumHint: 'Add all event values together',
153
+ sumDescription:
154
+ 'The sum aggregation method adds all usage event values together and reports the total for event summaries and billing.',
155
+ count: 'Count',
156
+ countHint: 'Count the number of events',
157
+ countDescription:
158
+ 'The count aggregation method counts the number of events received and reports the total count for event summaries and billing.',
159
+ last: 'Last value',
160
+ lastHint: 'Use the most recent event value',
161
+ lastDescription:
162
+ 'The last value aggregation method uses the most recent event value received and reports that value for event summaries and billing.',
163
+ editHelp: 'Aggregation method cannot be changed after meter creation to maintain data consistency.',
164
+ },
165
+ unit: {
166
+ label: 'Measurement unit',
167
+ required: 'Measurement unit is required',
168
+ placeholder: 'request',
169
+ help: 'The unit of measurement for this meter',
170
+ editHelp: 'Measurement unit cannot be changed after meter creation to maintain data consistency.',
171
+ },
172
+ description: {
173
+ label: 'Description',
174
+ placeholder: 'Track API usage for billing',
175
+ help: 'Optional description to help you and your team understand what this meter tracks.',
176
+ },
177
+ events: {
178
+ title: 'Events',
179
+ dailyEventCount: 'Daily Event Count',
180
+ dailyTotalValue: 'Daily Total Value',
181
+ eventName: 'Event Name',
182
+ value: 'Value',
183
+ customer: 'Customer',
184
+ subscription: 'Subscription',
185
+ reportTime: 'Report Time',
186
+ count: '{count} events total',
187
+ empty: 'No event data',
188
+ emptyTip: 'Data will appear here when events are reported',
189
+ filterByCustomer: 'Filter by customer',
190
+ eventCount: 'Event Count',
191
+ totalValue: 'Total Value',
192
+ },
193
+ usageGuide: {
194
+ title: 'How to report usage',
195
+ description:
196
+ 'Send events to this meter using the event name "{eventName}". The meter will {method} the values and track usage in {unit}.',
197
+ tip: 'Send events to this meter using the event name "{eventName}". The meter will {aggregationMethodHint} and track usage in {unit}.',
198
+ apiEndpoint: 'API Endpoint',
199
+ curlExample: 'cURL Example',
200
+ jsExample: 'JavaScript Example',
201
+ pythonExample: 'Python Example',
202
+ important: 'Important',
203
+ tip1: 'Replace YOUR_API_KEY with your actual API key',
204
+ tip2: 'The event_name must match exactly: {eventName}',
205
+ tip3: 'Include a timestamp for accurate tracking',
206
+ moreInfo: 'For more information, see our',
207
+ apiDocs: 'API documentation',
208
+ },
209
+ products: {
210
+ count: '{count} associated products',
211
+ create: 'Create product',
212
+ created: 'Product created successfully',
213
+ createPrompt: 'Enter product name:',
214
+ manage: 'Manage',
215
+ empty: 'No products',
216
+ title: 'Products',
217
+ emptyTip: 'No products are associated with this meter yet.',
218
+ meterService: 'Meter Service',
219
+ creditCharge: 'Credit Charge',
220
+ },
221
+ creditProducts: {
222
+ emptyTip: 'No credit products are associated with this meter yet.',
223
+ },
224
+ },
225
+ creditProduct: {
226
+ create: 'Create Credit Product',
227
+ defaultName: '{name} Top-up Package',
228
+ defaultDescription: '{name} Top-up Package',
229
+ defaultNickname: 'Credit Recharge',
230
+ unitLabel: 'units',
231
+ settings: 'Credit Settings',
232
+ name: {
233
+ placeholder: 'Enter Credit product name',
234
+ },
235
+ description: {
236
+ placeholder: 'Describe the purpose and value of this Credit product',
237
+ },
238
+ priceNotice:
239
+ 'Credit products are used to provide consumable credits to users, supporting both one-time purchase and package pricing models.',
240
+ creditAmount: {
241
+ label: 'Credit Amount',
242
+ placeholder: 'Amount of credits users get when purchasing this price',
243
+ help: 'Leave empty for pay-per-unit pricing, enter a number for fixed package deals',
244
+ description: 'Purchase quantity determines the amount of Credits received',
245
+ },
246
+ validDuration: {
247
+ label: 'Valid Duration',
248
+ help: 'Credit validity period, calculated from purchase time',
249
+ description: 'Set to 0 for permanent validity',
250
+ hours: 'hours',
251
+ days: 'days',
252
+ weeks: 'weeks',
253
+ months: 'months',
254
+ years: 'years',
255
+ },
256
+ associatedPrices: {
257
+ label: 'Associated Prices',
258
+ placeholder: 'Select service prices this Credit can be used for',
259
+ help: 'When selected, purchased Credits can only be used for specified services',
260
+ description: 'No selection means Credits can be used for all services',
261
+ },
262
+ priority: {
263
+ label: 'Usage Priority',
264
+ help: 'Usage order when user has multiple Credits, lower numbers have higher priority',
265
+ description: 'Range: 0-100, 0 is highest priority, 50 is default value',
266
+ },
267
+ },
268
+ meterEvent: {
269
+ title: 'Meter Event Details',
270
+ totalEvents: 'Total events: {count}',
271
+ noEvents: 'No events found',
272
+ noEventsHint: 'You can manually add test events in test mode.',
273
+ identifier: 'Identifier',
274
+ customer: 'Customer',
275
+ customerId: 'Customer ID',
276
+ value: 'Value',
277
+ subscription: 'Subscription',
278
+ creditConsumed: 'Credit Consumed',
279
+ usageValue: 'Usage Value',
280
+ reportedAt: 'Reported At',
281
+ processedAt: 'Processed At',
282
+ eventIdentifier: 'Event Identifier',
283
+ usageDetails: 'Usage Details',
284
+ chart: {
285
+ eventCount: 'Daily Event Count',
286
+ totalValue: 'Daily Total Value',
287
+ },
288
+ filter: {
289
+ customer: 'Filter by Customer',
290
+ },
291
+ add: {
292
+ button: 'Add usage',
293
+ title: 'Add usage',
294
+ customerId: 'Customer',
295
+ customerIdPlaceholder: 'Select customer',
296
+ value: 'Value',
297
+ valuePlaceholder: 'Enter usage value',
298
+ subscriptionId: 'Subscription',
299
+ subscriptionIdPlaceholder: 'Enter subscription ID (optional)',
300
+ subscriptionIdHint: 'Optional - link this usage to a specific subscription',
301
+ timestamp: 'Timestamp',
302
+ timestampHint: 'When this usage occurred',
303
+ validation: 'Customer and value are required',
304
+ success: 'Usage event added successfully',
305
+ submit: 'Submit',
306
+ },
307
+ },
91
308
  developers: 'Developers',
92
309
  webhooks: 'Webhooks',
93
- events: 'Events',
310
+ events: {
311
+ title: 'Events',
312
+ dailyEventCount: 'Daily Event Count',
313
+ dailyTotalValue: 'Daily Total Value',
314
+ eventName: 'Event Name',
315
+ value: 'Value',
316
+ customer: 'Customer',
317
+ subscription: 'Subscription',
318
+ reportTime: 'Report Time',
319
+ count: '{count} events total',
320
+ empty: 'No event data',
321
+ emptyTip: 'Data will appear here when events are reported',
322
+ filterByCustomer: 'Filter by customer',
323
+ eventCount: 'Event Count',
324
+ totalValue: 'Total Value',
325
+ hourly: 'Hourly',
326
+ totalEvents: 'Total Events',
327
+ timeRange: 'Time Range',
328
+ hourlyView: 'Hourly View',
329
+ dailyView: 'Daily View',
330
+ },
94
331
  refunds: 'Refunds',
95
332
  payouts: 'Payouts',
96
333
  logs: 'Logs',
@@ -101,6 +338,7 @@ export default flat({
101
338
  business: 'Business',
102
339
  summary: 'Summary',
103
340
  product: {
341
+ empty: 'No product',
104
342
  info: 'Product information',
105
343
  add: 'Add product',
106
344
  view: 'View product details',
@@ -119,7 +357,7 @@ export default flat({
119
357
  removeTip: 'Removing will hide this product from new purchases. Are you sure you want to remove this product?',
120
358
  archived: 'This product has been archived',
121
359
  archivedTip:
122
- 'This product cant be added to new invoices, subscriptions, payment links, or pricing tables. Any existing subscriptions with this product remain active until canceled and any existing payment links or pricing tables are deactivated.',
360
+ "This product can't be added to new invoices, subscriptions, payment links, or pricing tables. Any existing subscriptions with this product remain active until canceled and any existing payment links or pricing tables are deactivated.",
123
361
  locked: 'This product is locked because at least one of its prices is used by a subscription or a payment.',
124
362
  currencyNotAligned: 'all prices must have the same currency settings',
125
363
  image: {
@@ -148,18 +386,43 @@ export default flat({
148
386
  label: 'Unit label',
149
387
  placeholder: 'Seat',
150
388
  },
389
+ billingType: {
390
+ label: 'Billing type',
391
+ standard: 'Standard billing',
392
+ standardDesc: 'Charge a fixed amount on a recurring basis',
393
+ metered: 'Metered billing',
394
+ meteredDesc: 'Charge based on usage tracked by a meter',
395
+ help: 'Choose how customers will be charged for this product',
396
+ },
397
+ meter: {
398
+ label: 'Meter',
399
+ placeholder: 'Select a meter to track usage',
400
+ required: 'Please select a meter for metered billing',
401
+ help: 'Select the meter to track usage for this product',
402
+ pricingNote:
403
+ 'For metered products, pricing is automatically based on usage tracked by the selected meter. You only need to set the unit price and billing period.',
404
+ },
151
405
  cross_sell: {
152
406
  title: 'Cross-sells',
153
407
  to: 'Cross-sells to',
154
408
  tip: '',
155
409
  },
410
+ type: {
411
+ label: 'Product Type',
412
+ service: 'Service',
413
+ credit: 'Credit',
414
+ good: 'Good',
415
+ },
156
416
  },
157
417
  price: {
158
418
  name: 'Price',
159
419
  type: 'Usage type',
420
+ plan: 'Price plan',
160
421
  info: 'Price information',
161
422
  count: '{count} prices',
162
423
  empty: 'No price',
424
+ addAnother: 'Add another price',
425
+ order: 'Plan {order}',
163
426
  lookupKey: 'Lookup key',
164
427
  setAsDefault: 'Set as default price',
165
428
  detail: 'Pricing details',
@@ -205,15 +468,44 @@ export default flat({
205
468
  },
206
469
  models: {
207
470
  standard: 'Standard pricing',
471
+ standardDesc: 'A single, fixed price',
208
472
  package: 'Package pricing',
473
+ packageDesc: 'Price by number of units',
209
474
  graduated: 'Graduated Pricing',
210
475
  volume: 'Volume pricing',
211
476
  custom: 'Customer choose price',
477
+ usageBased: 'Usage-based',
478
+ creditMetered: 'Credit metered',
479
+ },
480
+ creditMetered: {
481
+ label: 'Credit metered',
482
+ placeholder: 'Select a meter to track usage',
483
+ required: 'Please select a meter for metered billing',
484
+ help: 'Select the meter to track usage for this product',
485
+ selectMeter: 'Select meter',
486
+ pricingNote: 'For metered products, pricing is automatically based on usage tracked by the selected meter.',
487
+ description:
488
+ 'Credit metered billing requires a corresponding Credit consumption. If the Credit is consumed, the corresponding service will stop.',
212
489
  },
213
490
  types: {
214
491
  onetime: 'One time',
492
+ onetimeDesc: 'Charge a one-time fee',
215
493
  recurring: 'Recurring',
494
+ recurringDesc: 'Charge an ongoing fee',
216
495
  },
496
+ paymentType: 'Payment Type',
497
+ billingModel: 'Billing Model',
498
+ pricing: 'Pricing',
499
+ additionalCurrencies: 'Additional Currencies',
500
+ advanced: 'Advanced Settings',
501
+ customInterval: 'Custom Interval',
502
+ perUnit: 'Per Unit',
503
+ choosePricingModel: 'Choose your pricing model',
504
+ usage: 'Usage',
505
+ usageDesc:
506
+ 'Price by number of users, units, or seats. Needs a record for Stripe to track customer service usage.',
507
+ meter: 'Meter',
508
+ billingPeriod: 'Billing period',
217
509
  aggregate: {
218
510
  sum: 'Sum of usage values during period',
219
511
  max: 'Maximum usage value during period',
@@ -655,6 +947,49 @@ export default flat({
655
947
  line2: 'Line2',
656
948
  postal_code: 'Postal Code',
657
949
  },
950
+ creditGrants: {
951
+ title: 'Credit Grants',
952
+ description: 'View your available credit grants and usage history',
953
+ grants: 'Credit Grants',
954
+ transactions: 'Credit Usage',
955
+ summary: 'Credit Summary',
956
+ noGrants: 'No credit grants available',
957
+ grantDetail: 'Credit Grant Details',
958
+ creditBalance: 'Credit Balance',
959
+ totalAmount: 'Total Amount',
960
+ status: {
961
+ granted: 'Active',
962
+ pending: 'Pending',
963
+ expired: 'Expired',
964
+ depleted: 'Depleted',
965
+ voided: 'Voided',
966
+ },
967
+ originalAmount: 'Original Amount',
968
+ usage: 'Usage',
969
+ grantId: 'Grant ID',
970
+ currency: 'Currency',
971
+ created: 'Created',
972
+ effectiveDate: 'Effective Date',
973
+ expirationDate: 'Expiration Date',
974
+ transactionHistory: 'Transaction History',
975
+ backToGrants: 'Back to Credit Grants',
976
+ viewDetails: 'View Details',
977
+ overview: 'Overview',
978
+ overviewDescription: 'Monitor all currency credit balances, usage, and outstanding debt.',
979
+ availableBalance: 'Available Balance',
980
+ viewGrants: 'View Grants',
981
+ viewUsage: 'View Usage',
982
+ recentActivity: 'Recent Activity',
983
+ quickStats: 'Quick Stats',
984
+ activeGrants: 'Active Grants',
985
+ outstandingDebt: 'Outstanding Debt',
986
+ buyCredits: 'Buy Credits',
987
+ viewAllActivity: 'View All Activity',
988
+ pendingAmount: 'Outstanding Charges',
989
+ grantCount: 'Grant Count',
990
+ noGrantsDescription: "You don't have any credit grants yet. Please contact the administrator to add them.",
991
+ addCredit: 'Add Credit',
992
+ },
658
993
  },
659
994
  passport: {
660
995
  intro:
@@ -805,6 +1140,50 @@ export default flat({
805
1140
  depositFailed: 'Deposit to vault request failed',
806
1141
  appBalance: 'App Balance',
807
1142
  },
1143
+ creditGrants: {
1144
+ title: 'Credit Grants',
1145
+ summary: 'Credit Summary',
1146
+ noGrants: 'No credit grants found',
1147
+ grantDetail: 'Credit Grant Details',
1148
+ overview: 'Credit Overview',
1149
+ overviewDescription: 'Monitor credit balances, usage, and outstanding debt across all currencies.',
1150
+ availableBalance: 'Available Balance',
1151
+ usage: 'Usage',
1152
+ viewGrants: 'View Grants',
1153
+ viewUsage: 'View Usage',
1154
+ recentActivity: 'Recent Activity',
1155
+ quickStats: 'Quick Stats',
1156
+ activeGrants: 'Active Grants',
1157
+ totalCreditValue: 'Total Credit Value',
1158
+ outstandingDebt: 'Outstanding Debt',
1159
+ buyCredits: 'Buy Credits',
1160
+ viewAllActivity: 'View All Activity',
1161
+ creditBalance: 'Credit Balance',
1162
+ totalAmount: 'Total Amount',
1163
+ pendingAmount: 'Pending Amount',
1164
+ grantCount: 'Grant Count',
1165
+ noGrantsDescription: "You don't have any credit grants yet. Please contact the administrator to add them.",
1166
+ status: {
1167
+ granted: 'Active',
1168
+ pending: 'Pending',
1169
+ expired: 'Expired',
1170
+ depleted: 'Depleted',
1171
+ voided: 'Voided',
1172
+ },
1173
+ originalAmount: 'Original Amount',
1174
+ grantId: 'Grant ID',
1175
+ grants: 'Grants',
1176
+ addCredit: 'Add Credit',
1177
+ viewDetails: 'View Details',
1178
+ },
1179
+ creditTransactions: {
1180
+ title: 'Credit Transactions',
1181
+ summary: 'Transaction Summary',
1182
+ noTransactions: 'No credit transactions found',
1183
+ totalTransactions: 'Total Transactions',
1184
+ totalCreditUsed: 'Total Credit Used',
1185
+ transactionDate: 'Transaction Date',
1186
+ },
808
1187
  },
809
1188
  empty: {
810
1189
  image: 'No Image',
@@ -823,7 +1202,7 @@ export default flat({
823
1202
  records: 'No matching records found',
824
1203
  payments: 'No Payments',
825
1204
  prices: 'No Prices',
826
- pricing: 'You havent added any prices you can add it',
1205
+ pricing: "You haven't added any prices you can add it",
827
1206
  summary: 'No Summary',
828
1207
  },
829
1208
  customer: {
@@ -900,6 +1279,8 @@ export default flat({
900
1279
  },
901
1280
  unpaidInvoicesWarning: 'You currently have unpaid invoices, please settle your invoices first.',
902
1281
  unpaidInvoicesWarningTip: 'You currently have unpaid invoices, please settle your invoices promptly.',
1282
+ pendingAmountWarningTip:
1283
+ 'You have {amount} {symbol} in unpaid usage charges due to insufficient credit balance. Please top up your account.',
903
1284
  invoice: {
904
1285
  relatedInvoice: 'Related Invoice',
905
1286
  donation: 'Donation',