@djangocfg/api 1.0.4 → 1.0.5

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 (134) hide show
  1. package/dist/index.cjs +15856 -34128
  2. package/dist/index.cjs.map +1 -1
  3. package/dist/index.d.cts +15274 -34396
  4. package/dist/index.d.ts +15274 -34396
  5. package/dist/index.mjs +15853 -33956
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -2
  8. package/src/cfg/contexts/payments/ApiKeysContext.tsx +21 -58
  9. package/src/cfg/contexts/payments/BalancesContext.tsx +19 -72
  10. package/src/cfg/contexts/payments/CurrenciesContext.tsx +5 -18
  11. package/src/cfg/contexts/payments/OverviewContext.tsx +78 -124
  12. package/src/cfg/contexts/payments/PaymentsContext.tsx +37 -36
  13. package/src/cfg/contexts/payments/RootPaymentsContext.tsx +7 -76
  14. package/src/cfg/contexts/payments/index.ts +5 -24
  15. package/src/cfg/generated/_utils/fetchers/cfg__payments.ts +38 -2380
  16. package/src/cfg/generated/_utils/fetchers/index.ts +0 -1
  17. package/src/cfg/generated/_utils/hooks/cfg__payments.ts +41 -2615
  18. package/src/cfg/generated/_utils/hooks/index.ts +0 -1
  19. package/src/cfg/generated/_utils/schemas/ArchiveItem.schema.ts +1 -1
  20. package/src/cfg/generated/_utils/schemas/ArchiveItemChunk.schema.ts +1 -1
  21. package/src/cfg/generated/_utils/schemas/ArchiveItemChunkDetail.schema.ts +1 -1
  22. package/src/cfg/generated/_utils/schemas/ArchiveItemChunkRequest.schema.ts +1 -1
  23. package/src/cfg/generated/_utils/schemas/ArchiveItemDetail.schema.ts +1 -1
  24. package/src/cfg/generated/_utils/schemas/ArchiveItemRequest.schema.ts +1 -1
  25. package/src/cfg/generated/_utils/schemas/ChatMessage.schema.ts +2 -2
  26. package/src/cfg/generated/_utils/schemas/ChatSession.schema.ts +3 -3
  27. package/src/cfg/generated/_utils/schemas/ChatSessionRequest.schema.ts +3 -3
  28. package/src/cfg/generated/_utils/schemas/Document.schema.ts +1 -1
  29. package/src/cfg/generated/_utils/schemas/DocumentRequest.schema.ts +1 -1
  30. package/src/cfg/generated/_utils/schemas/PatchedArchiveItemChunkRequest.schema.ts +1 -1
  31. package/src/cfg/generated/_utils/schemas/PatchedArchiveItemRequest.schema.ts +1 -1
  32. package/src/cfg/generated/_utils/schemas/PatchedChatSessionRequest.schema.ts +3 -3
  33. package/src/cfg/generated/_utils/schemas/PatchedDocumentRequest.schema.ts +1 -1
  34. package/src/cfg/generated/_utils/schemas/PaymentDetail.schema.ts +44 -0
  35. package/src/cfg/generated/_utils/schemas/PaymentList.schema.ts +7 -11
  36. package/src/cfg/generated/_utils/schemas/index.ts +1 -81
  37. package/src/cfg/generated/cfg__payments/client.ts +40 -1732
  38. package/src/cfg/generated/cfg__payments/models.ts +50 -1795
  39. package/src/cfg/generated/client.ts +0 -3
  40. package/src/cfg/generated/enums.ts +5 -347
  41. package/src/cfg/generated/index.ts +0 -5
  42. package/src/cfg/generated/schema.ts +5918 -18352
  43. package/src/cfg/services/payments/ApiKeysService.ts +34 -116
  44. package/src/cfg/services/payments/DashboardService.ts +37 -122
  45. package/src/cfg/services/payments/PaymentsService.ts +36 -69
  46. package/src/cfg/services/payments/SubscriptionsService.ts +35 -136
  47. package/src/cfg/services/webhooks/WebhooksService.ts +24 -66
  48. package/src/index.ts +1 -6
  49. package/src/cfg/generated/_utils/fetchers/cfg__payments__webhooks.ts +0 -109
  50. package/src/cfg/generated/_utils/hooks/cfg__payments__webhooks.ts +0 -100
  51. package/src/cfg/generated/_utils/schemas/APIKeyCreate.schema.ts +0 -24
  52. package/src/cfg/generated/_utils/schemas/APIKeyCreateRequest.schema.ts +0 -24
  53. package/src/cfg/generated/_utils/schemas/APIKeyDetail.schema.ts +0 -35
  54. package/src/cfg/generated/_utils/schemas/APIKeyList.schema.ts +0 -32
  55. package/src/cfg/generated/_utils/schemas/APIKeyUpdate.schema.ts +0 -24
  56. package/src/cfg/generated/_utils/schemas/APIKeyUpdateRequest.schema.ts +0 -24
  57. package/src/cfg/generated/_utils/schemas/APIKeyValidationRequest.schema.ts +0 -23
  58. package/src/cfg/generated/_utils/schemas/APIKeyValidationResponse.schema.ts +0 -29
  59. package/src/cfg/generated/_utils/schemas/APIKeysOverview.schema.ts +0 -26
  60. package/src/cfg/generated/_utils/schemas/AdminPaymentCreate.schema.ts +0 -26
  61. package/src/cfg/generated/_utils/schemas/AdminPaymentCreateRequest.schema.ts +0 -27
  62. package/src/cfg/generated/_utils/schemas/AdminPaymentDetail.schema.ts +0 -50
  63. package/src/cfg/generated/_utils/schemas/AdminPaymentList.schema.ts +0 -38
  64. package/src/cfg/generated/_utils/schemas/AdminPaymentStats.schema.ts +0 -29
  65. package/src/cfg/generated/_utils/schemas/AdminPaymentUpdate.schema.ts +0 -25
  66. package/src/cfg/generated/_utils/schemas/AdminPaymentUpdateRequest.schema.ts +0 -25
  67. package/src/cfg/generated/_utils/schemas/AdminUser.schema.ts +0 -24
  68. package/src/cfg/generated/_utils/schemas/BalanceOverview.schema.ts +0 -25
  69. package/src/cfg/generated/_utils/schemas/ChartDataPoint.schema.ts +0 -20
  70. package/src/cfg/generated/_utils/schemas/ChartSeries.schema.ts +0 -22
  71. package/src/cfg/generated/_utils/schemas/Currency.schema.ts +0 -35
  72. package/src/cfg/generated/_utils/schemas/CurrencyAnalyticsItem.schema.ts +0 -25
  73. package/src/cfg/generated/_utils/schemas/CurrencyList.schema.ts +0 -32
  74. package/src/cfg/generated/_utils/schemas/CurrencyRates.schema.ts +0 -26
  75. package/src/cfg/generated/_utils/schemas/EndpointGroup.schema.ts +0 -28
  76. package/src/cfg/generated/_utils/schemas/Network.schema.ts +0 -30
  77. package/src/cfg/generated/_utils/schemas/PaginatedAPIKeyListList.schema.ts +0 -24
  78. package/src/cfg/generated/_utils/schemas/PaginatedAdminPaymentListList.schema.ts +0 -24
  79. package/src/cfg/generated/_utils/schemas/PaginatedAdminPaymentStatsList.schema.ts +0 -24
  80. package/src/cfg/generated/_utils/schemas/PaginatedAdminUserList.schema.ts +0 -24
  81. package/src/cfg/generated/_utils/schemas/PaginatedCurrencyListList.schema.ts +0 -24
  82. package/src/cfg/generated/_utils/schemas/PaginatedEndpointGroupList.schema.ts +0 -24
  83. package/src/cfg/generated/_utils/schemas/PaginatedNetworkList.schema.ts +0 -24
  84. package/src/cfg/generated/_utils/schemas/PaginatedProviderCurrencyList.schema.ts +0 -24
  85. package/src/cfg/generated/_utils/schemas/PaginatedRecentPaymentList.schema.ts +0 -24
  86. package/src/cfg/generated/_utils/schemas/PaginatedRecentTransactionList.schema.ts +0 -24
  87. package/src/cfg/generated/_utils/schemas/PaginatedSubscriptionListList.schema.ts +0 -24
  88. package/src/cfg/generated/_utils/schemas/PaginatedTariffList.schema.ts +0 -24
  89. package/src/cfg/generated/_utils/schemas/PaginatedTransactionList.schema.ts +0 -24
  90. package/src/cfg/generated/_utils/schemas/PaginatedUserBalanceList.schema.ts +0 -24
  91. package/src/cfg/generated/_utils/schemas/PaginatedWebhookEventListList.schema.ts +0 -24
  92. package/src/cfg/generated/_utils/schemas/PaginatedWebhookStatsList.schema.ts +0 -24
  93. package/src/cfg/generated/_utils/schemas/PatchedAPIKeyUpdateRequest.schema.ts +0 -24
  94. package/src/cfg/generated/_utils/schemas/PatchedAdminPaymentUpdateRequest.schema.ts +0 -25
  95. package/src/cfg/generated/_utils/schemas/PatchedPaymentRequest.schema.ts +0 -30
  96. package/src/cfg/generated/_utils/schemas/PatchedSubscriptionRequest.schema.ts +0 -26
  97. package/src/cfg/generated/_utils/schemas/Payment.schema.ts +0 -49
  98. package/src/cfg/generated/_utils/schemas/PaymentAnalyticsResponse.schema.ts +0 -22
  99. package/src/cfg/generated/_utils/schemas/PaymentCreate.schema.ts +0 -28
  100. package/src/cfg/generated/_utils/schemas/PaymentCreateRequest.schema.ts +0 -28
  101. package/src/cfg/generated/_utils/schemas/PaymentOverview.schema.ts +0 -31
  102. package/src/cfg/generated/_utils/schemas/PaymentRequest.schema.ts +0 -30
  103. package/src/cfg/generated/_utils/schemas/PaymentsChartResponse.schema.ts +0 -24
  104. package/src/cfg/generated/_utils/schemas/PaymentsDashboardOverview.schema.ts +0 -26
  105. package/src/cfg/generated/_utils/schemas/PaymentsMetrics.schema.ts +0 -26
  106. package/src/cfg/generated/_utils/schemas/ProviderAnalyticsItem.schema.ts +0 -24
  107. package/src/cfg/generated/_utils/schemas/ProviderCurrency.schema.ts +0 -36
  108. package/src/cfg/generated/_utils/schemas/RecentPayment.schema.ts +0 -32
  109. package/src/cfg/generated/_utils/schemas/RecentTransaction.schema.ts +0 -29
  110. package/src/cfg/generated/_utils/schemas/Subscription.schema.ts +0 -41
  111. package/src/cfg/generated/_utils/schemas/SubscriptionCreate.schema.ts +0 -25
  112. package/src/cfg/generated/_utils/schemas/SubscriptionCreateRequest.schema.ts +0 -25
  113. package/src/cfg/generated/_utils/schemas/SubscriptionList.schema.ts +0 -32
  114. package/src/cfg/generated/_utils/schemas/SubscriptionOverview.schema.ts +0 -37
  115. package/src/cfg/generated/_utils/schemas/SubscriptionRequest.schema.ts +0 -26
  116. package/src/cfg/generated/_utils/schemas/SupportedCurrencies.schema.ts +0 -25
  117. package/src/cfg/generated/_utils/schemas/SupportedProviders.schema.ts +0 -22
  118. package/src/cfg/generated/_utils/schemas/Tariff.schema.ts +0 -34
  119. package/src/cfg/generated/_utils/schemas/Transaction.schema.ts +0 -35
  120. package/src/cfg/generated/_utils/schemas/UserBalance.schema.ts +0 -29
  121. package/src/cfg/generated/_utils/schemas/WebhookEvent.schema.ts +0 -31
  122. package/src/cfg/generated/_utils/schemas/WebhookEventList.schema.ts +0 -25
  123. package/src/cfg/generated/_utils/schemas/WebhookEventListRequest.schema.ts +0 -25
  124. package/src/cfg/generated/_utils/schemas/WebhookEventRequest.schema.ts +0 -30
  125. package/src/cfg/generated/_utils/schemas/WebhookHealth.schema.ts +0 -21
  126. package/src/cfg/generated/_utils/schemas/WebhookProviderStats.schema.ts +0 -23
  127. package/src/cfg/generated/_utils/schemas/WebhookProviderStatsRequest.schema.ts +0 -23
  128. package/src/cfg/generated/_utils/schemas/WebhookResponse.schema.ts +0 -27
  129. package/src/cfg/generated/_utils/schemas/WebhookResponseRequest.schema.ts +0 -27
  130. package/src/cfg/generated/_utils/schemas/WebhookStats.schema.ts +0 -27
  131. package/src/cfg/generated/_utils/schemas/WebhookStatsRequest.schema.ts +0 -27
  132. package/src/cfg/generated/cfg__payments__webhooks/client.ts +0 -75
  133. package/src/cfg/generated/cfg__payments__webhooks/index.ts +0 -2
  134. package/src/cfg/generated/cfg__payments__webhooks/models.ts +0 -87
@@ -4,1439 +4,7 @@ import * as Enums from "../enums";
4
4
  *
5
5
  * Response model (includes read-only fields).
6
6
  */
7
- export interface PaginatedAdminPaymentListList {
8
- /** Total number of items across all pages */
9
- count: number;
10
- /** Current page number (1-based) */
11
- page: number;
12
- /** Total number of pages */
13
- pages: number;
14
- /** Number of items per page */
15
- page_size: number;
16
- /** Whether there is a next page */
17
- has_next: boolean;
18
- /** Whether there is a previous page */
19
- has_previous: boolean;
20
- /** Next page number (null if no next page) */
21
- next_page?: number | null;
22
- /** Previous page number (null if no previous page) */
23
- previous_page?: number | null;
24
- /** Array of items for current page */
25
- results: Array<AdminPaymentList>;
26
- }
27
-
28
- /**
29
- * Serializer for creating payments in admin interface. Uses UniversalPayment
30
- * only for data creation.
31
- *
32
- * Request model (no read-only fields).
33
- */
34
- export interface AdminPaymentCreateRequest {
35
- user: number;
36
- amount_usd: number;
37
- /** Provider currency code (e.g., BTC, ZROERC20) */
38
- currency_code: string;
39
- provider: string;
40
- description?: string;
41
- callback_url?: string;
42
- cancel_url?: string;
43
- }
44
-
45
- /**
46
- * Serializer for creating payments in admin interface. Uses UniversalPayment
47
- * only for data creation.
48
- *
49
- * Response model (includes read-only fields).
50
- */
51
- export interface AdminPaymentCreate {
52
- user: number;
53
- amount_usd: number;
54
- provider: string;
55
- description?: string;
56
- callback_url?: string;
57
- cancel_url?: string;
58
- }
59
-
60
- /**
61
- * Detailed serializer for individual payment in admin interface. Uses
62
- * UniversalPayment only for data extraction.
63
- *
64
- * Response model (includes read-only fields).
65
- */
66
- export interface AdminPaymentDetail {
67
- id: string;
68
- user: Record<string, any>;
69
- internal_payment_id: string;
70
- amount_usd: number;
71
- actual_amount_usd: number;
72
- fee_amount_usd: number;
73
- currency_code: string;
74
- currency_name: string;
75
- provider: string;
76
- provider_display: string;
77
- status: string;
78
- status_display: string;
79
- pay_amount: string;
80
- pay_address: string;
81
- payment_url: string;
82
- transaction_hash: string;
83
- confirmations_count: number;
84
- security_nonce: string;
85
- expires_at: string;
86
- completed_at: string;
87
- status_changed_at: string;
88
- description: string;
89
- callback_url: string;
90
- cancel_url: string;
91
- provider_data: string;
92
- webhook_data: string;
93
- created_at: string;
94
- updated_at: string;
95
- age: string;
96
- }
97
-
98
- /**
99
- * Serializer for updating payments in admin interface.
100
- *
101
- * Request model (no read-only fields).
102
- */
103
- export interface AdminPaymentUpdateRequest {
104
- /** Current payment status
105
-
106
- * `pending` - Pending
107
- * `confirming` - Confirming
108
- * `confirmed` - Confirmed
109
- * `completed` - Completed
110
- * `failed` - Failed
111
- * `expired` - Expired
112
- * `cancelled` - Cancelled
113
- * `refunded` - Refunded */
114
- status?: Enums.AdminPaymentUpdateRequestStatus;
115
- /** Payment description */
116
- description?: string;
117
- /** Success callback URL */
118
- callback_url?: string | null;
119
- /** Cancellation URL */
120
- cancel_url?: string | null;
121
- /** Provider-specific data (validated by Pydantic) */
122
- provider_data?: string;
123
- /** Webhook data (validated by Pydantic) */
124
- webhook_data?: string;
125
- }
126
-
127
- /**
128
- * Serializer for updating payments in admin interface.
129
- *
130
- * Response model (includes read-only fields).
131
- */
132
- export interface AdminPaymentUpdate {
133
- /** Current payment status
134
-
135
- * `pending` - Pending
136
- * `confirming` - Confirming
137
- * `confirmed` - Confirmed
138
- * `completed` - Completed
139
- * `failed` - Failed
140
- * `expired` - Expired
141
- * `cancelled` - Cancelled
142
- * `refunded` - Refunded */
143
- status?: Enums.AdminPaymentUpdateStatus;
144
- /** Payment description */
145
- description?: string;
146
- /** Success callback URL */
147
- callback_url?: string | null;
148
- /** Cancellation URL */
149
- cancel_url?: string | null;
150
- /** Provider-specific data (validated by Pydantic) */
151
- provider_data?: string;
152
- /** Webhook data (validated by Pydantic) */
153
- webhook_data?: string;
154
- }
155
-
156
- /**
157
- * Serializer for updating payments in admin interface.
158
- *
159
- * Request model (no read-only fields).
160
- */
161
- export interface PatchedAdminPaymentUpdateRequest {
162
- /** Current payment status
163
-
164
- * `pending` - Pending
165
- * `confirming` - Confirming
166
- * `confirmed` - Confirmed
167
- * `completed` - Completed
168
- * `failed` - Failed
169
- * `expired` - Expired
170
- * `cancelled` - Cancelled
171
- * `refunded` - Refunded */
172
- status?: Enums.PatchedAdminPaymentUpdateRequestStatus;
173
- /** Payment description */
174
- description?: string;
175
- /** Success callback URL */
176
- callback_url?: string | null;
177
- /** Cancellation URL */
178
- cancel_url?: string | null;
179
- /** Provider-specific data (validated by Pydantic) */
180
- provider_data?: string;
181
- /** Webhook data (validated by Pydantic) */
182
- webhook_data?: string;
183
- }
184
-
185
- /**
186
- * Serializer for payment statistics in admin interface.
187
- *
188
- * Response model (includes read-only fields).
189
- */
190
- export interface AdminPaymentStats {
191
- total_payments: number;
192
- total_amount_usd: number;
193
- successful_payments: number;
194
- failed_payments: number;
195
- pending_payments: number;
196
- success_rate: number;
197
- /** Statistics by provider */
198
- by_provider: Record<string, any>;
199
- /** Statistics by currency */
200
- by_currency: Record<string, any>;
201
- /** Payments in last 24 hours */
202
- last_24h: Record<string, any>;
203
- /** Payments in last 7 days */
204
- last_7d: Record<string, any>;
205
- /** Payments in last 30 days */
206
- last_30d: Record<string, any>;
207
- }
208
-
209
- /**
210
- *
211
- * Response model (includes read-only fields).
212
- */
213
- export interface PaginatedAdminPaymentStatsList {
214
- /** Total number of items across all pages */
215
- count: number;
216
- /** Current page number (1-based) */
217
- page: number;
218
- /** Total number of pages */
219
- pages: number;
220
- /** Number of items per page */
221
- page_size: number;
222
- /** Whether there is a next page */
223
- has_next: boolean;
224
- /** Whether there is a previous page */
225
- has_previous: boolean;
226
- /** Next page number (null if no next page) */
227
- next_page?: number | null;
228
- /** Previous page number (null if no previous page) */
229
- previous_page?: number | null;
230
- /** Array of items for current page */
231
- results: Array<AdminPaymentStats>;
232
- }
233
-
234
- /**
235
- *
236
- * Response model (includes read-only fields).
237
- */
238
- export interface PaginatedAdminUserList {
239
- /** Total number of items across all pages */
240
- count: number;
241
- /** Current page number (1-based) */
242
- page: number;
243
- /** Total number of pages */
244
- pages: number;
245
- /** Number of items per page */
246
- page_size: number;
247
- /** Whether there is a next page */
248
- has_next: boolean;
249
- /** Whether there is a previous page */
250
- has_previous: boolean;
251
- /** Next page number (null if no next page) */
252
- next_page?: number | null;
253
- /** Previous page number (null if no previous page) */
254
- previous_page?: number | null;
255
- /** Array of items for current page */
256
- results: Array<AdminUser>;
257
- }
258
-
259
- /**
260
- * Simplified user serializer for admin interface.
261
- *
262
- * Response model (includes read-only fields).
263
- */
264
- export interface AdminUser {
265
- id: number;
266
- /** Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. */
267
- username: string;
268
- email: string;
269
- first_name: string;
270
- last_name: string;
271
- /** Designates whether this user should be treated as active. Unselect this instead of deleting accounts. */
272
- is_active: boolean;
273
- }
274
-
275
- /**
276
- * Serializer for comprehensive webhook statistics.
277
- *
278
- * Request model (no read-only fields).
279
- */
280
- export interface WebhookStatsRequest {
281
- total: number;
282
- successful: number;
283
- failed: number;
284
- pending: number;
285
- success_rate: number;
286
- /** Statistics by provider */
287
- providers: Record<string, any>;
288
- /** Events in last 24 hours */
289
- last_24h: Record<string, any>;
290
- avg_response_time: number;
291
- max_response_time: number;
292
- }
293
-
294
- /**
295
- * Serializer for comprehensive webhook statistics.
296
- *
297
- * Response model (includes read-only fields).
298
- */
299
- export interface WebhookStats {
300
- total: number;
301
- successful: number;
302
- failed: number;
303
- pending: number;
304
- success_rate: number;
305
- /** Statistics by provider */
306
- providers: Record<string, any>;
307
- /** Events in last 24 hours */
308
- last_24h: Record<string, any>;
309
- avg_response_time: number;
310
- max_response_time: number;
311
- }
312
-
313
- /**
314
- *
315
- * Response model (includes read-only fields).
316
- */
317
- export interface PaginatedWebhookStatsList {
318
- /** Total number of items across all pages */
319
- count: number;
320
- /** Current page number (1-based) */
321
- page: number;
322
- /** Total number of pages */
323
- pages: number;
324
- /** Number of items per page */
325
- page_size: number;
326
- /** Whether there is a next page */
327
- has_next: boolean;
328
- /** Whether there is a previous page */
329
- has_previous: boolean;
330
- /** Next page number (null if no next page) */
331
- next_page?: number | null;
332
- /** Previous page number (null if no previous page) */
333
- previous_page?: number | null;
334
- /** Array of items for current page */
335
- results: Array<WebhookStats>;
336
- }
337
-
338
- /**
339
- *
340
- * Response model (includes read-only fields).
341
- */
342
- export interface PaginatedWebhookEventListList {
343
- /** Total number of items across all pages */
344
- count: number;
345
- /** Current page number (1-based) */
346
- page: number;
347
- /** Total number of pages */
348
- pages: number;
349
- /** Number of items per page */
350
- page_size: number;
351
- /** Whether there is a next page */
352
- has_next: boolean;
353
- /** Whether there is a previous page */
354
- has_previous: boolean;
355
- /** Next page number (null if no next page) */
356
- next_page?: number | null;
357
- /** Previous page number (null if no previous page) */
358
- previous_page?: number | null;
359
- /** Array of items for current page */
360
- results: Array<WebhookEventList>;
361
- }
362
-
363
- /**
364
- * Serializer for paginated webhook events list.
365
- *
366
- * Response model (includes read-only fields).
367
- */
368
- export interface WebhookEventList {
369
- events: Array<WebhookEvent>;
370
- total: number;
371
- page: number;
372
- per_page: number;
373
- has_next: boolean;
374
- has_previous: boolean;
375
- }
376
-
377
- /**
378
- * Serializer for paginated webhook events list.
379
- *
380
- * Request model (no read-only fields).
381
- */
382
- export interface WebhookEventListRequest {
383
- events: Array<WebhookEventRequest>;
384
- total: number;
385
- page: number;
386
- per_page: number;
387
- has_next: boolean;
388
- has_previous: boolean;
389
- }
390
-
391
- /**
392
- *
393
- * Response model (includes read-only fields).
394
- */
395
- export interface PaginatedAPIKeyListList {
396
- /** Total number of items across all pages */
397
- count: number;
398
- /** Current page number (1-based) */
399
- page: number;
400
- /** Total number of pages */
401
- pages: number;
402
- /** Number of items per page */
403
- page_size: number;
404
- /** Whether there is a next page */
405
- has_next: boolean;
406
- /** Whether there is a previous page */
407
- has_previous: boolean;
408
- /** Next page number (null if no next page) */
409
- next_page?: number | null;
410
- /** Previous page number (null if no previous page) */
411
- previous_page?: number | null;
412
- /** Array of items for current page */
413
- results: Array<APIKeyList>;
414
- }
415
-
416
- /**
417
- * API key creation serializer with service integration. Creates new API keys
418
- * and returns the full key value (only once).
419
- *
420
- * Request model (no read-only fields).
421
- */
422
- export interface APIKeyCreateRequest {
423
- /** Descriptive name for the API key */
424
- name: string;
425
- /** Expiration in days (optional, null for no expiration) */
426
- expires_in_days?: number | null;
427
- }
428
-
429
- /**
430
- * API key creation serializer with service integration. Creates new API keys
431
- * and returns the full key value (only once).
432
- *
433
- * Response model (includes read-only fields).
434
- */
435
- export interface APIKeyCreate {
436
- /** Descriptive name for the API key */
437
- name: string;
438
- /** Expiration in days (optional, null for no expiration) */
439
- expires_in_days?: number | null;
440
- }
441
-
442
- /**
443
- * Complete API key serializer with full details. Used for API key detail views
444
- * (no key value for security).
445
- *
446
- * Response model (includes read-only fields).
447
- */
448
- export interface APIKeyDetail {
449
- /** Unique identifier for this record */
450
- id: string;
451
- user: string;
452
- /** Human-readable name for this API key */
453
- name: string;
454
- key_preview: string;
455
- /** Whether this API key is active */
456
- is_active: boolean;
457
- is_expired: boolean;
458
- is_valid: boolean;
459
- days_until_expiry: number;
460
- /** Total number of requests made with this key */
461
- total_requests: number;
462
- /** When this API key was last used */
463
- last_used_at: string | null;
464
- /** When this API key expires (null = never expires) */
465
- expires_at: string | null;
466
- /** When this record was created */
467
- created_at: string;
468
- /** When this record was last updated */
469
- updated_at: string;
470
- }
471
-
472
- /**
473
- * API key update serializer for modifying API key properties. Allows updating
474
- * name and active status only.
475
- *
476
- * Request model (no read-only fields).
477
- */
478
- export interface APIKeyUpdateRequest {
479
- /** Human-readable name for this API key */
480
- name: string;
481
- /** Whether this API key is active */
482
- is_active?: boolean;
483
- }
484
-
485
- /**
486
- * API key update serializer for modifying API key properties. Allows updating
487
- * name and active status only.
488
- *
489
- * Response model (includes read-only fields).
490
- */
491
- export interface APIKeyUpdate {
492
- /** Human-readable name for this API key */
493
- name: string;
494
- /** Whether this API key is active */
495
- is_active?: boolean;
496
- }
497
-
498
- /**
499
- * API key update serializer for modifying API key properties. Allows updating
500
- * name and active status only.
501
- *
502
- * Request model (no read-only fields).
503
- */
504
- export interface PatchedAPIKeyUpdateRequest {
505
- /** Human-readable name for this API key */
506
- name?: string;
507
- /** Whether this API key is active */
508
- is_active?: boolean;
509
- }
510
-
511
- /**
512
- * API key validation serializer. Validates API key and returns key
513
- * information.
514
- *
515
- * Request model (no read-only fields).
516
- */
517
- export interface APIKeyValidationRequest {
518
- /** API key to validate */
519
- key: string;
520
- }
521
-
522
- /**
523
- * API key validation response serializer. Defines the structure of API key
524
- * validation response for OpenAPI schema.
525
- *
526
- * Response model (includes read-only fields).
527
- */
528
- export interface APIKeyValidationResponse {
529
- /** Whether the validation was successful */
530
- success: boolean;
531
- /** Whether the API key is valid */
532
- valid: boolean;
533
- api_key: Record<string, any> | null;
534
- /** Validation message */
535
- message: string;
536
- /** Error message if validation failed */
537
- error?: string;
538
- /** Error code if validation failed */
539
- error_code?: string;
540
- }
541
-
542
- /**
543
- *
544
- * Response model (includes read-only fields).
545
- */
546
- export interface PaginatedUserBalanceList {
547
- /** Total number of items across all pages */
548
- count: number;
549
- /** Current page number (1-based) */
550
- page: number;
551
- /** Total number of pages */
552
- pages: number;
553
- /** Number of items per page */
554
- page_size: number;
555
- /** Whether there is a next page */
556
- has_next: boolean;
557
- /** Whether there is a previous page */
558
- has_previous: boolean;
559
- /** Next page number (null if no next page) */
560
- next_page?: number | null;
561
- /** Previous page number (null if no previous page) */
562
- previous_page?: number | null;
563
- /** Array of items for current page */
564
- results: Array<UserBalance>;
565
- }
566
-
567
- /**
568
- * User balance serializer with computed fields. Provides balance information
569
- * with display helpers.
570
- *
571
- * Response model (includes read-only fields).
572
- */
573
- export interface UserBalance {
574
- user: string;
575
- /** Current balance in USD (float for performance) */
576
- balance_usd: number;
577
- /** Formatted balance display. */
578
- balance_display: string;
579
- /** Check if balance is zero. */
580
- is_empty: boolean;
581
- /** Check if user has any transactions. */
582
- has_transactions: boolean;
583
- created_at: string;
584
- updated_at: string;
585
- }
586
-
587
- /**
588
- *
589
- * Response model (includes read-only fields).
590
- */
591
- export interface PaginatedCurrencyListList {
592
- /** Total number of items across all pages */
593
- count: number;
594
- /** Current page number (1-based) */
595
- page: number;
596
- /** Total number of pages */
597
- pages: number;
598
- /** Number of items per page */
599
- page_size: number;
600
- /** Whether there is a next page */
601
- has_next: boolean;
602
- /** Whether there is a previous page */
603
- has_previous: boolean;
604
- /** Next page number (null if no next page) */
605
- next_page?: number | null;
606
- /** Previous page number (null if no previous page) */
607
- previous_page?: number | null;
608
- /** Array of items for current page */
609
- results: Array<CurrencyList>;
610
- }
611
-
612
- /**
613
- * Complete currency serializer with full details. Used for currency
614
- * information and management.
615
- *
616
- * Response model (includes read-only fields).
617
- */
618
- export interface Currency {
619
- id: number;
620
- /** Currency code (e.g., BTC, USD, ETH) */
621
- code: string;
622
- /** Full currency name (e.g., Bitcoin, US Dollar) */
623
- name: string;
624
- /** Currency symbol (e.g., $, ₿, Ξ) */
625
- symbol: string;
626
- /** Type of currency
627
-
628
- * `fiat` - Fiat Currency
629
- * `crypto` - Cryptocurrency */
630
- currency_type: Enums.CurrencyCurrencyType;
631
- type_display: string;
632
- /** Number of decimal places for this currency */
633
- decimal_places: number;
634
- /** Whether this currency is available for payments */
635
- is_active: boolean;
636
- /** Check if this is a cryptocurrency. */
637
- is_crypto: boolean;
638
- /** Check if this is a fiat currency. */
639
- is_fiat: boolean;
640
- /** When this record was created */
641
- created_at: string;
642
- /** When this record was last updated */
643
- updated_at: string;
644
- }
645
-
646
- /**
647
- * Currency rates serializer for getting exchange rates. Fetches current
648
- * exchange rates through CurrencyService.
649
- *
650
- * Response model (includes read-only fields).
651
- */
652
- export interface CurrencyRates {
653
- /** Base currency for rates (default: USD) */
654
- base_currency?: string;
655
- /** Specific currencies to get rates for (optional) */
656
- currencies?: Array<string>;
657
- /** Provider for exchange rates
658
-
659
- * `nowpayments` - NowPayments */
660
- provider?: Enums.CurrencyRatesProvider;
661
- }
662
-
663
- /**
664
- * Supported currencies serializer for provider capabilities. Gets supported
665
- * currencies from providers through CurrencyService.
666
- *
667
- * Response model (includes read-only fields).
668
- */
669
- export interface SupportedCurrencies {
670
- /** Provider to get supported currencies from
671
-
672
- * `nowpayments` - NowPayments */
673
- provider?: Enums.SupportedCurrenciesProvider;
674
- /** Filter by currency type
675
-
676
- * `all` - All
677
- * `crypto` - Cryptocurrency
678
- * `fiat` - Fiat Currency */
679
- currency_type?: Enums.SupportedCurrenciesCurrencyType;
680
- }
681
-
682
- /**
683
- *
684
- * Response model (includes read-only fields).
685
- */
686
- export interface PaginatedEndpointGroupList {
687
- /** Total number of items across all pages */
688
- count: number;
689
- /** Current page number (1-based) */
690
- page: number;
691
- /** Total number of pages */
692
- pages: number;
693
- /** Number of items per page */
694
- page_size: number;
695
- /** Whether there is a next page */
696
- has_next: boolean;
697
- /** Whether there is a previous page */
698
- has_previous: boolean;
699
- /** Next page number (null if no next page) */
700
- next_page?: number | null;
701
- /** Previous page number (null if no previous page) */
702
- previous_page?: number | null;
703
- /** Array of items for current page */
704
- results: Array<EndpointGroup>;
705
- }
706
-
707
- /**
708
- * Endpoint group serializer for API access management. Used for subscription
709
- * endpoint group configuration.
710
- *
711
- * Response model (includes read-only fields).
712
- */
713
- export interface EndpointGroup {
714
- id: number;
715
- /** Endpoint group name (e.g., 'Payment API', 'Balance API') */
716
- name: string;
717
- /** Description of what this endpoint group provides */
718
- description: string;
719
- /** Whether this endpoint group is available */
720
- is_enabled: boolean;
721
- created_at: string;
722
- updated_at: string;
723
- }
724
-
725
- /**
726
- * Complete payment serializer with full details. Used for detail views and
727
- * updates.
728
- *
729
- * Response model (includes read-only fields).
730
- */
731
- export interface Payment {
732
- /** Unique identifier for this record */
733
- id: string;
734
- user: string;
735
- /** Payment amount in USD (float for performance) */
736
- amount_usd: number;
737
- /** Calculate crypto amount from USD amount and currency rate. */
738
- amount_crypto: number;
739
- currency: string;
740
- network: string | null;
741
- /** Payment provider
742
-
743
- * `nowpayments` - NowPayments */
744
- provider?: Enums.PaymentProvider;
745
- /** Current payment status
746
-
747
- * `pending` - Pending
748
- * `confirming` - Confirming
749
- * `confirmed` - Confirmed
750
- * `completed` - Completed
751
- * `failed` - Failed
752
- * `expired` - Expired
753
- * `cancelled` - Cancelled
754
- * `refunded` - Refunded */
755
- status?: Enums.PaymentStatus;
756
- status_display: string;
757
- /** Get formatted amount display. */
758
- amount_display: string;
759
- /** Provider's payment ID */
760
- provider_payment_id: string | null;
761
- /** Payment page URL */
762
- payment_url: string | null;
763
- /** Cryptocurrency payment address */
764
- pay_address: string | null;
765
- /** Success callback URL */
766
- callback_url?: string | null;
767
- /** Cancellation URL */
768
- cancel_url?: string | null;
769
- /** Payment description */
770
- description?: string;
771
- /** Blockchain transaction hash */
772
- transaction_hash: string | null;
773
- /** Number of blockchain confirmations */
774
- confirmations_count: number;
775
- /** When this record was created */
776
- created_at: string;
777
- /** When this record was last updated */
778
- updated_at: string;
779
- /** When this payment expires */
780
- expires_at?: string | null;
781
- /** When this payment was completed */
782
- completed_at: string | null;
783
- /** Check if payment is pending. */
784
- is_pending: boolean;
785
- /** Check if payment is completed. */
786
- is_completed: boolean;
787
- /** Check if payment is failed. */
788
- is_failed: boolean;
789
- /** Check if payment is expired. */
790
- is_expired: boolean;
791
- }
792
-
793
- /**
794
- *
795
- * Response model (includes read-only fields).
796
- */
797
- export interface PaginatedNetworkList {
798
- /** Total number of items across all pages */
799
- count: number;
800
- /** Current page number (1-based) */
801
- page: number;
802
- /** Total number of pages */
803
- pages: number;
804
- /** Number of items per page */
805
- page_size: number;
806
- /** Whether there is a next page */
807
- has_next: boolean;
808
- /** Whether there is a previous page */
809
- has_previous: boolean;
810
- /** Next page number (null if no next page) */
811
- next_page?: number | null;
812
- /** Previous page number (null if no previous page) */
813
- previous_page?: number | null;
814
- /** Array of items for current page */
815
- results: Array<Network>;
816
- }
817
-
818
- /**
819
- * Network serializer for blockchain networks. Used for network information and
820
- * selection.
821
- *
822
- * Response model (includes read-only fields).
823
- */
824
- export interface Network {
825
- id: number;
826
- currency: Record<string, any> | null;
827
- /** Network name (e.g., Ethereum, Bitcoin, Polygon) */
828
- name: string;
829
- /** Network code (e.g., ETH, BTC, MATIC) */
830
- code: string;
831
- /** Whether this network is available for payments */
832
- is_active: boolean;
833
- /** When this record was created */
834
- created_at: string;
835
- /** When this record was last updated */
836
- updated_at: string;
837
- }
838
-
839
- /**
840
- * API keys overview metrics
841
- *
842
- * Response model (includes read-only fields).
843
- */
844
- export interface APIKeysOverview {
845
- /** Total number of API keys */
846
- total_keys: number;
847
- /** Number of active API keys */
848
- active_keys: number;
849
- /** Number of expired API keys */
850
- expired_keys: number;
851
- /** Total requests across all keys */
852
- total_requests: number;
853
- /** When any key was last used */
854
- last_used_at: string | null;
855
- /** Name of most used API key */
856
- most_used_key_name: string | null;
857
- /** Requests count for most used key */
858
- most_used_key_requests: number;
859
- /** Number of keys expiring within 7 days */
860
- expiring_soon_count: number;
861
- }
862
-
863
- /**
864
- * User balance overview metrics
865
- *
866
- * Response model (includes read-only fields).
867
- */
868
- export interface BalanceOverview {
869
- /** Current balance in USD */
870
- current_balance: number;
871
- /** Formatted balance display */
872
- balance_display: string;
873
- /** Total amount deposited (lifetime) */
874
- total_deposited: number;
875
- /** Total amount spent (lifetime) */
876
- total_spent: number;
877
- /** Last transaction timestamp */
878
- last_transaction_at: string | null;
879
- /** Whether user has any transactions */
880
- has_transactions: boolean;
881
- /** Whether balance is zero */
882
- is_empty: boolean;
883
- }
884
-
885
- /**
886
- * Complete chart response for payments analytics
887
- *
888
- * Response model (includes read-only fields).
889
- */
890
- export interface PaymentsChartResponse {
891
- /** Chart series data */
892
- series: Array<ChartSeries>;
893
- /** Time period */
894
- period: string;
895
- /** Total amount for period */
896
- total_amount: number;
897
- /** Total payments for period */
898
- total_payments: number;
899
- /** Success rate for period */
900
- success_rate: number;
901
- }
902
-
903
- /**
904
- * Complete payments dashboard metrics
905
- *
906
- * Response model (includes read-only fields).
907
- */
908
- export interface PaymentsMetrics {
909
- balance: Record<string, any>;
910
- subscription: Record<string, any> | null;
911
- api_keys: Record<string, any>;
912
- payments: Record<string, any>;
913
- }
914
-
915
- /**
916
- * Complete payments dashboard overview response
917
- *
918
- * Response model (includes read-only fields).
919
- */
920
- export interface PaymentsDashboardOverview {
921
- metrics: Record<string, any>;
922
- /** Recent payments */
923
- recent_payments: Array<RecentPayment>;
924
- /** Recent transactions */
925
- recent_transactions: Array<RecentTransaction>;
926
- chart_data: Record<string, any>;
927
- }
928
-
929
- /**
930
- * Payment analytics response with currency and provider breakdown
931
- *
932
- * Response model (includes read-only fields).
933
- */
934
- export interface PaymentAnalyticsResponse {
935
- /** Analytics by currency */
936
- currency_analytics: Array<CurrencyAnalyticsItem>;
937
- /** Analytics by provider */
938
- provider_analytics: Array<ProviderAnalyticsItem>;
939
- }
940
-
941
- /**
942
- *
943
- * Response model (includes read-only fields).
944
- */
945
- export interface PaginatedRecentPaymentList {
946
- /** Total number of items across all pages */
947
- count: number;
948
- /** Current page number (1-based) */
949
- page: number;
950
- /** Total number of pages */
951
- pages: number;
952
- /** Number of items per page */
953
- page_size: number;
954
- /** Whether there is a next page */
955
- has_next: boolean;
956
- /** Whether there is a previous page */
957
- has_previous: boolean;
958
- /** Next page number (null if no next page) */
959
- next_page?: number | null;
960
- /** Previous page number (null if no previous page) */
961
- previous_page?: number | null;
962
- /** Array of items for current page */
963
- results: Array<RecentPayment>;
964
- }
965
-
966
- /**
967
- *
968
- * Response model (includes read-only fields).
969
- */
970
- export interface PaginatedRecentTransactionList {
971
- /** Total number of items across all pages */
972
- count: number;
973
- /** Current page number (1-based) */
974
- page: number;
975
- /** Total number of pages */
976
- pages: number;
977
- /** Number of items per page */
978
- page_size: number;
979
- /** Whether there is a next page */
980
- has_next: boolean;
981
- /** Whether there is a previous page */
982
- has_previous: boolean;
983
- /** Next page number (null if no next page) */
984
- next_page?: number | null;
985
- /** Previous page number (null if no previous page) */
986
- previous_page?: number | null;
987
- /** Array of items for current page */
988
- results: Array<RecentTransaction>;
989
- }
990
-
991
- /**
992
- * Current subscription overview
993
- *
994
- * Response model (includes read-only fields).
995
- */
996
- export interface SubscriptionOverview {
997
- /** Subscription tier */
998
- tier: string;
999
- /** Human-readable tier name */
1000
- tier_display: string;
1001
- /** Subscription status */
1002
- status: string;
1003
- /** Human-readable status */
1004
- status_display: string;
1005
- /** Color for status display */
1006
- status_color: string;
1007
- /** Whether subscription is active */
1008
- is_active: boolean;
1009
- /** Whether subscription is expired */
1010
- is_expired: boolean;
1011
- /** Days until expiration */
1012
- days_remaining: number;
1013
- /** Hourly request limit */
1014
- requests_per_hour: number;
1015
- /** Daily request limit */
1016
- requests_per_day: number;
1017
- /** Total requests made */
1018
- total_requests: number;
1019
- /** Usage percentage for current period */
1020
- usage_percentage: number;
1021
- /** Monthly cost in USD */
1022
- monthly_cost_usd: number;
1023
- /** Formatted cost display */
1024
- cost_display: string;
1025
- /** Subscription start date */
1026
- starts_at: string;
1027
- /** Subscription expiration date */
1028
- expires_at: string;
1029
- /** Last API request timestamp */
1030
- last_request_at: string | null;
1031
- /** Number of accessible endpoint groups */
1032
- endpoint_groups_count: number;
1033
- /** List of accessible endpoint group names */
1034
- endpoint_groups: Array<string>;
1035
- }
1036
-
1037
- /**
1038
- *
1039
- * Response model (includes read-only fields).
1040
- */
1041
- export interface PaginatedPaymentListList {
1042
- /** Total number of items across all pages */
1043
- count: number;
1044
- /** Current page number (1-based) */
1045
- page: number;
1046
- /** Total number of pages */
1047
- pages: number;
1048
- /** Number of items per page */
1049
- page_size: number;
1050
- /** Whether there is a next page */
1051
- has_next: boolean;
1052
- /** Whether there is a previous page */
1053
- has_previous: boolean;
1054
- /** Next page number (null if no next page) */
1055
- next_page?: number | null;
1056
- /** Previous page number (null if no previous page) */
1057
- previous_page?: number | null;
1058
- /** Array of items for current page */
1059
- results: Array<PaymentList>;
1060
- }
1061
-
1062
- /**
1063
- * Payment creation serializer with Pydantic integration. Validates input and
1064
- * delegates to PaymentService.
1065
- *
1066
- * Request model (no read-only fields).
1067
- */
1068
- export interface PaymentCreateRequest {
1069
- /** Amount in USD (1.00 - 50,000.00) */
1070
- amount_usd: number;
1071
- /** Cryptocurrency code (validated against active currencies) */
1072
- currency_code: string;
1073
- /** Success callback URL */
1074
- callback_url?: string;
1075
- /** Cancellation URL */
1076
- cancel_url?: string;
1077
- /** Payment description */
1078
- description?: string;
1079
- /** Additional metadata */
1080
- metadata?: string;
1081
- }
1082
-
1083
- /**
1084
- * Payment creation serializer with Pydantic integration. Validates input and
1085
- * delegates to PaymentService.
1086
- *
1087
- * Response model (includes read-only fields).
1088
- */
1089
- export interface PaymentCreate {
1090
- /** Amount in USD (1.00 - 50,000.00) */
1091
- amount_usd: number;
1092
- /** Cryptocurrency code (validated against active currencies) */
1093
- currency_code: string;
1094
- /** Success callback URL */
1095
- callback_url?: string;
1096
- /** Cancellation URL */
1097
- cancel_url?: string;
1098
- /** Payment description */
1099
- description?: string;
1100
- /** Additional metadata */
1101
- metadata?: string;
1102
- }
1103
-
1104
- /**
1105
- * Complete payment serializer with full details. Used for detail views and
1106
- * updates.
1107
- *
1108
- * Request model (no read-only fields).
1109
- */
1110
- export interface PaymentRequest {
1111
- /** Payment amount in USD (float for performance) */
1112
- amount_usd: number;
1113
- /** Payment provider
1114
-
1115
- * `nowpayments` - NowPayments */
1116
- provider?: Enums.PaymentRequestProvider;
1117
- /** Current payment status
1118
-
1119
- * `pending` - Pending
1120
- * `confirming` - Confirming
1121
- * `confirmed` - Confirmed
1122
- * `completed` - Completed
1123
- * `failed` - Failed
1124
- * `expired` - Expired
1125
- * `cancelled` - Cancelled
1126
- * `refunded` - Refunded */
1127
- status?: Enums.PaymentRequestStatus;
1128
- /** Success callback URL */
1129
- callback_url?: string | null;
1130
- /** Cancellation URL */
1131
- cancel_url?: string | null;
1132
- /** Payment description */
1133
- description?: string;
1134
- /** When this payment expires */
1135
- expires_at?: string | null;
1136
- }
1137
-
1138
- /**
1139
- * Complete payment serializer with full details. Used for detail views and
1140
- * updates.
1141
- *
1142
- * Request model (no read-only fields).
1143
- */
1144
- export interface PatchedPaymentRequest {
1145
- /** Payment amount in USD (float for performance) */
1146
- amount_usd?: number;
1147
- /** Payment provider
1148
-
1149
- * `nowpayments` - NowPayments */
1150
- provider?: Enums.PatchedPaymentRequestProvider;
1151
- /** Current payment status
1152
-
1153
- * `pending` - Pending
1154
- * `confirming` - Confirming
1155
- * `confirmed` - Confirmed
1156
- * `completed` - Completed
1157
- * `failed` - Failed
1158
- * `expired` - Expired
1159
- * `cancelled` - Cancelled
1160
- * `refunded` - Refunded */
1161
- status?: Enums.PatchedPaymentRequestStatus;
1162
- /** Success callback URL */
1163
- callback_url?: string | null;
1164
- /** Cancellation URL */
1165
- cancel_url?: string | null;
1166
- /** Payment description */
1167
- description?: string;
1168
- /** When this payment expires */
1169
- expires_at?: string | null;
1170
- }
1171
-
1172
- /**
1173
- *
1174
- * Response model (includes read-only fields).
1175
- */
1176
- export interface PaginatedProviderCurrencyList {
1177
- /** Total number of items across all pages */
1178
- count: number;
1179
- /** Current page number (1-based) */
1180
- page: number;
1181
- /** Total number of pages */
1182
- pages: number;
1183
- /** Number of items per page */
1184
- page_size: number;
1185
- /** Whether there is a next page */
1186
- has_next: boolean;
1187
- /** Whether there is a previous page */
1188
- has_previous: boolean;
1189
- /** Next page number (null if no next page) */
1190
- next_page?: number | null;
1191
- /** Previous page number (null if no previous page) */
1192
- previous_page?: number | null;
1193
- /** Array of items for current page */
1194
- results: Array<ProviderCurrency>;
1195
- }
1196
-
1197
- /**
1198
- * Provider currency serializer for provider-specific currency info. Used for
1199
- * provider currency management and rates.
1200
- *
1201
- * Response model (includes read-only fields).
1202
- */
1203
- export interface ProviderCurrency {
1204
- id: number;
1205
- currency: Record<string, any>;
1206
- network: Record<string, any> | null;
1207
- /** Payment provider name (e.g., nowpayments) */
1208
- provider: string;
1209
- /** Currency code as used by the provider */
1210
- provider_currency_code: string;
1211
- /** Get minimum amount from provider configuration. */
1212
- provider_min_amount_usd: number;
1213
- /** Get maximum amount from provider configuration. */
1214
- provider_max_amount_usd: number;
1215
- /** Get fee percentage from provider configuration. */
1216
- provider_fee_percentage: number;
1217
- /** Get fixed fee from provider configuration. */
1218
- provider_fixed_fee_usd: number;
1219
- /** Whether this currency is enabled for this provider */
1220
- is_enabled: boolean;
1221
- /** When this record was created */
1222
- created_at: string;
1223
- /** When this record was last updated */
1224
- updated_at: string;
1225
- }
1226
-
1227
- /**
1228
- *
1229
- * Response model (includes read-only fields).
1230
- */
1231
- export interface PaginatedSubscriptionListList {
1232
- /** Total number of items across all pages */
1233
- count: number;
1234
- /** Current page number (1-based) */
1235
- page: number;
1236
- /** Total number of pages */
1237
- pages: number;
1238
- /** Number of items per page */
1239
- page_size: number;
1240
- /** Whether there is a next page */
1241
- has_next: boolean;
1242
- /** Whether there is a previous page */
1243
- has_previous: boolean;
1244
- /** Next page number (null if no next page) */
1245
- next_page?: number | null;
1246
- /** Previous page number (null if no previous page) */
1247
- previous_page?: number | null;
1248
- /** Array of items for current page */
1249
- results: Array<SubscriptionList>;
1250
- }
1251
-
1252
- /**
1253
- * Subscription creation serializer with service integration. Validates input
1254
- * and delegates to SubscriptionService.
1255
- *
1256
- * Request model (no read-only fields).
1257
- */
1258
- export interface SubscriptionCreateRequest {
1259
- /** Tariff ID for the subscription */
1260
- tariff_id: number;
1261
- /** Endpoint group ID (optional) */
1262
- endpoint_group_id?: number | null;
1263
- /** Subscription duration in days */
1264
- duration_days?: number;
1265
- }
1266
-
1267
- /**
1268
- * Subscription creation serializer with service integration. Validates input
1269
- * and delegates to SubscriptionService.
1270
- *
1271
- * Response model (includes read-only fields).
1272
- */
1273
- export interface SubscriptionCreate {
1274
- /** Tariff ID for the subscription */
1275
- tariff_id: number;
1276
- /** Endpoint group ID (optional) */
1277
- endpoint_group_id?: number | null;
1278
- /** Subscription duration in days */
1279
- duration_days?: number;
1280
- }
1281
-
1282
- /**
1283
- * Complete subscription serializer with full details. Used for subscription
1284
- * detail views and updates.
1285
- *
1286
- * Response model (includes read-only fields).
1287
- */
1288
- export interface Subscription {
1289
- /** Unique identifier for this record */
1290
- id: string;
1291
- user: string;
1292
- tariff: Record<string, any>;
1293
- endpoint_group: Record<string, any>;
1294
- /** Subscription status
1295
-
1296
- * `active` - Active
1297
- * `inactive` - Inactive
1298
- * `suspended` - Suspended
1299
- * `cancelled` - Cancelled
1300
- * `expired` - Expired */
1301
- status?: Enums.SubscriptionStatus;
1302
- status_display: string;
1303
- /** Get color for status display. */
1304
- status_color: string;
1305
- /** Subscription tier
1306
-
1307
- * `free` - Free Tier
1308
- * `basic` - Basic Tier
1309
- * `pro` - Pro Tier
1310
- * `enterprise` - Enterprise Tier */
1311
- tier?: Enums.SubscriptionTier;
1312
- /** Total API requests made with this subscription */
1313
- total_requests: number;
1314
- /** Get usage percentage for current period. */
1315
- usage_percentage: number;
1316
- /** When the last API request was made */
1317
- last_request_at: string | null;
1318
- /** When this subscription expires */
1319
- expires_at: string;
1320
- /** Check if subscription is active and not expired. */
1321
- is_active: boolean;
1322
- /** Check if subscription is expired. */
1323
- is_expired: boolean;
1324
- /** When this record was created */
1325
- created_at: string;
1326
- /** When this record was last updated */
1327
- updated_at: string;
1328
- }
1329
-
1330
- /**
1331
- * Complete subscription serializer with full details. Used for subscription
1332
- * detail views and updates.
1333
- *
1334
- * Request model (no read-only fields).
1335
- */
1336
- export interface SubscriptionRequest {
1337
- /** Subscription status
1338
-
1339
- * `active` - Active
1340
- * `inactive` - Inactive
1341
- * `suspended` - Suspended
1342
- * `cancelled` - Cancelled
1343
- * `expired` - Expired */
1344
- status?: Enums.SubscriptionRequestStatus;
1345
- /** Subscription tier
1346
-
1347
- * `free` - Free Tier
1348
- * `basic` - Basic Tier
1349
- * `pro` - Pro Tier
1350
- * `enterprise` - Enterprise Tier */
1351
- tier?: Enums.SubscriptionRequestTier;
1352
- /** When this subscription expires */
1353
- expires_at: string;
1354
- }
1355
-
1356
- /**
1357
- * Complete subscription serializer with full details. Used for subscription
1358
- * detail views and updates.
1359
- *
1360
- * Request model (no read-only fields).
1361
- */
1362
- export interface PatchedSubscriptionRequest {
1363
- /** Subscription status
1364
-
1365
- * `active` - Active
1366
- * `inactive` - Inactive
1367
- * `suspended` - Suspended
1368
- * `cancelled` - Cancelled
1369
- * `expired` - Expired */
1370
- status?: Enums.PatchedSubscriptionRequestStatus;
1371
- /** Subscription tier
1372
-
1373
- * `free` - Free Tier
1374
- * `basic` - Basic Tier
1375
- * `pro` - Pro Tier
1376
- * `enterprise` - Enterprise Tier */
1377
- tier?: Enums.PatchedSubscriptionRequestTier;
1378
- /** When this subscription expires */
1379
- expires_at?: string;
1380
- }
1381
-
1382
- /**
1383
- *
1384
- * Response model (includes read-only fields).
1385
- */
1386
- export interface PaginatedTariffList {
1387
- /** Total number of items across all pages */
1388
- count: number;
1389
- /** Current page number (1-based) */
1390
- page: number;
1391
- /** Total number of pages */
1392
- pages: number;
1393
- /** Number of items per page */
1394
- page_size: number;
1395
- /** Whether there is a next page */
1396
- has_next: boolean;
1397
- /** Whether there is a previous page */
1398
- has_previous: boolean;
1399
- /** Next page number (null if no next page) */
1400
- next_page?: number | null;
1401
- /** Previous page number (null if no previous page) */
1402
- previous_page?: number | null;
1403
- /** Array of items for current page */
1404
- results: Array<Tariff>;
1405
- }
1406
-
1407
- /**
1408
- * Tariff serializer for subscription pricing. Used for tariff information and
1409
- * selection.
1410
- *
1411
- * Response model (includes read-only fields).
1412
- */
1413
- export interface Tariff {
1414
- id: number;
1415
- /** Tariff name (e.g., 'Free', 'Basic', 'Pro') */
1416
- name: string;
1417
- /** Detailed description of what this tariff includes */
1418
- description: string;
1419
- /** Monthly price in USD */
1420
- monthly_price_usd: number;
1421
- /** API requests allowed per month */
1422
- requests_per_month: number;
1423
- /** API requests allowed per hour */
1424
- requests_per_hour: number;
1425
- /** Whether this tariff is available for new subscriptions */
1426
- is_active: boolean;
1427
- endpoint_groups: Array<EndpointGroup>;
1428
- endpoint_groups_count: number;
1429
- /** When this record was created */
1430
- created_at: string;
1431
- /** When this record was last updated */
1432
- updated_at: string;
1433
- }
1434
-
1435
- /**
1436
- *
1437
- * Response model (includes read-only fields).
1438
- */
1439
- export interface PaginatedTransactionList {
7
+ export interface PaginatedPaymentListList {
1440
8
  /** Total number of items across all pages */
1441
9
  count: number;
1442
10
  /** Current page number (1-based) */
@@ -1454,408 +22,95 @@ export interface PaginatedTransactionList {
1454
22
  /** Previous page number (null if no previous page) */
1455
23
  previous_page?: number | null;
1456
24
  /** Array of items for current page */
1457
- results: Array<Transaction>;
25
+ results: Array<PaymentList>;
1458
26
  }
1459
27
 
1460
28
  /**
1461
- * Transaction serializer with full details. Used for transaction history and
1462
- * details.
29
+ * Detailed payment information.
1463
30
  *
1464
31
  * Response model (includes read-only fields).
1465
32
  */
1466
- export interface Transaction {
33
+ export interface PaymentDetail {
1467
34
  /** Unique identifier for this record */
1468
35
  id: string;
1469
- user: string;
1470
- /** Transaction amount in USD (positive=credit, negative=debit) */
1471
- amount_usd: number;
1472
- amount_display: string;
1473
- /** Type of transaction
1474
-
1475
- * `deposit` - Deposit
1476
- * `withdrawal` - Withdrawal
1477
- * `payment` - Payment
1478
- * `refund` - Refund
1479
- * `fee` - Fee
1480
- * `bonus` - Bonus
1481
- * `adjustment` - Adjustment */
1482
- transaction_type: Enums.TransactionTransactionType;
1483
- type_color: string;
1484
- /** Transaction description */
1485
- description: string;
1486
- /** Related payment ID (if applicable) */
1487
- payment_id: string | null;
1488
- /** Additional transaction metadata */
1489
- metadata: string;
1490
- is_credit: boolean;
1491
- is_debit: boolean;
1492
- /** When this record was created */
1493
- created_at: string;
1494
- }
1495
-
1496
- /**
1497
- * Serializer for payment list in admin interface. Uses UniversalPayment only
1498
- * for data extraction.
1499
- *
1500
- * Response model (includes read-only fields).
1501
- */
1502
- export interface AdminPaymentList {
1503
- id: string;
36
+ /** Internal payment identifier (PAY_YYYYMMDDHHMMSS_UUID) */
1504
37
  internal_payment_id: string;
1505
- user: Record<string, any>;
1506
- amount_usd: number;
38
+ /** Payment amount in USD */
39
+ amount_usd: string;
1507
40
  currency_code: string;
1508
41
  currency_name: string;
1509
- provider: string;
1510
- provider_display: string;
1511
- status: string;
1512
- status_display: string;
1513
- pay_amount: string;
1514
- pay_address: string;
1515
- transaction_hash: string;
1516
- created_at: string;
1517
- updated_at: string;
1518
- description: string;
1519
- age: string;
1520
- }
42
+ currency_token: string;
43
+ currency_network: string;
44
+ /** Amount to pay in cryptocurrency */
45
+ pay_amount: string | null;
46
+ /** Actual amount received in cryptocurrency */
47
+ actual_amount: string | null;
48
+ /** Actual amount received in USD */
49
+ actual_amount_usd: string | null;
50
+ /** Current payment status
1521
51
 
1522
- /**
1523
- * Serializer for individual webhook event.
1524
- *
1525
- * Response model (includes read-only fields).
1526
- */
1527
- export interface WebhookEvent {
1528
- id: number;
1529
- provider: string;
1530
- event_type: string;
1531
- /** * `success` - Success
1532
- * `failed` - Failed
1533
52
  * `pending` - Pending
1534
- * `retry` - Retry */
1535
- status: Enums.WebhookEventStatus;
1536
- timestamp: string;
1537
- /** Size in bytes */
1538
- payload_size: number;
1539
- /** Response time in ms */
1540
- response_time: number;
1541
- retry_count?: number;
1542
- error_message?: string;
1543
- payload_preview?: string;
1544
- response_status_code?: number;
1545
- webhook_url?: string;
1546
- }
1547
-
1548
- /**
1549
- * Serializer for individual webhook event.
1550
- *
1551
- * Request model (no read-only fields).
1552
- */
1553
- export interface WebhookEventRequest {
1554
- provider: string;
1555
- event_type: string;
1556
- /** * `success` - Success
53
+ * `confirming` - Confirming
54
+ * `confirmed` - Confirmed
55
+ * `completed` - Completed
56
+ * `partially_paid` - Partially Paid
1557
57
  * `failed` - Failed
1558
- * `pending` - Pending
1559
- * `retry` - Retry */
1560
- status: Enums.WebhookEventRequestStatus;
1561
- timestamp: string;
1562
- /** Size in bytes */
1563
- payload_size: number;
1564
- /** Response time in ms */
1565
- response_time: number;
1566
- retry_count?: number;
1567
- error_message?: string;
1568
- payload_preview?: string;
1569
- response_status_code?: number;
1570
- webhook_url?: string;
1571
- }
1572
-
1573
- /**
1574
- * Lightweight API key serializer for lists. Optimized for API key lists with
1575
- * minimal data (no key value).
1576
- *
1577
- * Response model (includes read-only fields).
1578
- */
1579
- export interface APIKeyList {
1580
- /** Unique identifier for this record */
1581
- id: string;
1582
- user: string;
1583
- /** Human-readable name for this API key */
1584
- name: string;
1585
- /** Whether this API key is active */
1586
- is_active: boolean;
1587
- is_expired: boolean;
1588
- is_valid: boolean;
1589
- /** Total number of requests made with this key */
1590
- total_requests: number;
1591
- /** When this API key was last used */
1592
- last_used_at: string | null;
1593
- /** When this API key expires (null = never expires) */
58
+ * `expired` - Expired
59
+ * `cancelled` - Cancelled */
60
+ status: Enums.PaymentDetailStatus;
61
+ status_display: string;
62
+ /** Cryptocurrency payment address */
63
+ pay_address: string | null;
64
+ qr_code_url: string;
65
+ /** Payment page URL (if provided by provider) */
66
+ payment_url: string | null;
67
+ /** Blockchain transaction hash */
68
+ transaction_hash: string | null;
69
+ explorer_link: string;
70
+ /** Number of blockchain confirmations */
71
+ confirmations_count: number;
72
+ /** When this payment expires (typically 30 minutes) */
1594
73
  expires_at: string | null;
74
+ /** When this payment was completed */
75
+ completed_at: string | null;
1595
76
  /** When this record was created */
1596
77
  created_at: string;
1597
- }
1598
-
1599
- /**
1600
- * Lightweight currency serializer for lists. Optimized for currency selection
1601
- * and lists.
1602
- *
1603
- * Response model (includes read-only fields).
1604
- */
1605
- export interface CurrencyList {
1606
- id: number;
1607
- /** Currency code (e.g., BTC, USD, ETH) */
1608
- code: string;
1609
- /** Full currency name (e.g., Bitcoin, US Dollar) */
1610
- name: string;
1611
- /** Currency symbol (e.g., $, ₿, Ξ) */
1612
- symbol: string;
1613
- /** Type of currency
1614
-
1615
- * `fiat` - Fiat Currency
1616
- * `crypto` - Cryptocurrency */
1617
- currency_type: Enums.CurrencyListCurrencyType;
1618
- type_display: string;
1619
- /** Whether this currency is available for payments */
1620
- is_active: boolean;
1621
- /** Current USD exchange rate (1 unit = X USD) */
1622
- usd_rate: number;
1623
- /** When USD rate was last updated */
1624
- usd_rate_updated_at: string | null;
1625
- }
1626
-
1627
- /**
1628
- * Chart series data for payments visualization
1629
- *
1630
- * Response model (includes read-only fields).
1631
- */
1632
- export interface ChartSeries {
1633
- /** Series name */
1634
- name: string;
1635
- /** Data points */
1636
- data: Array<ChartDataPoint>;
1637
- /** Series color */
1638
- color: string;
1639
- }
1640
-
1641
- /**
1642
- * Payments overview metrics
1643
- *
1644
- * Response model (includes read-only fields).
1645
- */
1646
- export interface PaymentOverview {
1647
- /** Total number of payments */
1648
- total_payments: number;
1649
- /** Number of completed payments */
1650
- completed_payments: number;
1651
- /** Number of pending payments */
1652
- pending_payments: number;
1653
- /** Number of failed payments */
1654
- failed_payments: number;
1655
- /** Total payment amount in USD */
1656
- total_amount_usd: number;
1657
- /** Total completed amount in USD */
1658
- completed_amount_usd: number;
1659
- /** Average payment amount in USD */
1660
- average_payment_usd: number;
1661
- /** Payment success rate percentage */
1662
- success_rate: number;
1663
- /** Last payment timestamp */
1664
- last_payment_at: string | null;
1665
- /** Number of payments this month */
1666
- payments_this_month: number;
1667
- /** Total amount this month */
1668
- amount_this_month: number;
1669
- /** Most used currency */
1670
- top_currency: string | null;
1671
- /** Usage count for top currency */
1672
- top_currency_count: number;
1673
- }
1674
-
1675
- /**
1676
- * Recent payment item
1677
- *
1678
- * Response model (includes read-only fields).
1679
- */
1680
- export interface RecentPayment {
1681
- /** Payment ID */
1682
- id: string;
1683
- /** Internal payment ID */
1684
- internal_payment_id: string;
1685
- /** Payment amount in USD */
1686
- amount_usd: number;
1687
- /** Formatted amount display */
1688
- amount_display: string;
1689
- /** Currency code */
1690
- currency_code: string;
1691
- /** Payment status */
1692
- status: string;
1693
- /** Human-readable status */
1694
- status_display: string;
1695
- /** Color for status display */
1696
- status_color: string;
1697
- /** Payment provider */
1698
- provider: string;
1699
- /** Payment creation timestamp */
1700
- created_at: string;
1701
- /** Payment completion timestamp */
1702
- completed_at: string | null;
1703
- /** Whether payment is pending */
1704
- is_pending: boolean;
1705
- /** Whether payment is completed */
1706
78
  is_completed: boolean;
1707
- /** Whether payment failed */
1708
79
  is_failed: boolean;
1709
- }
1710
-
1711
- /**
1712
- * Recent transaction item
1713
- *
1714
- * Response model (includes read-only fields).
1715
- */
1716
- export interface RecentTransaction {
1717
- /** Transaction ID */
1718
- id: string;
1719
- /** Transaction type */
1720
- transaction_type: string;
1721
- /** Transaction amount in USD */
1722
- amount_usd: number;
1723
- /** Formatted amount display */
1724
- amount_display: string;
1725
- /** Balance after transaction */
1726
- balance_after: number;
1727
- /** Transaction description */
80
+ is_expired: boolean;
81
+ /** Payment description */
1728
82
  description: string;
1729
- /** Transaction timestamp */
1730
- created_at: string;
1731
- /** Related payment ID */
1732
- payment_id: string | null;
1733
- /** Whether this is a credit transaction */
1734
- is_credit: boolean;
1735
- /** Whether this is a debit transaction */
1736
- is_debit: boolean;
1737
- /** Color for transaction type display */
1738
- type_color: string;
1739
- }
1740
-
1741
- /**
1742
- * Analytics data for a single currency
1743
- *
1744
- * Response model (includes read-only fields).
1745
- */
1746
- export interface CurrencyAnalyticsItem {
1747
- /** Currency code (e.g., BTC) */
1748
- currency_code: string;
1749
- /** Currency name (e.g., Bitcoin) */
1750
- currency_name: string;
1751
- /** Total number of payments */
1752
- total_payments: number;
1753
- /** Total amount in USD */
1754
- total_amount: number;
1755
- /** Number of completed payments */
1756
- completed_payments: number;
1757
- /** Average payment amount in USD */
1758
- average_amount: number;
1759
- /** Success rate percentage */
1760
- success_rate: number;
1761
83
  }
1762
84
 
1763
85
  /**
1764
- * Analytics data for a single payment provider
1765
- *
1766
- * Response model (includes read-only fields).
1767
- */
1768
- export interface ProviderAnalyticsItem {
1769
- /** Provider code */
1770
- provider: string;
1771
- /** Provider display name */
1772
- provider_display: string;
1773
- /** Total number of payments */
1774
- total_payments: number;
1775
- /** Total amount in USD */
1776
- total_amount: number;
1777
- /** Number of completed payments */
1778
- completed_payments: number;
1779
- /** Success rate percentage */
1780
- success_rate: number;
1781
- }
1782
-
1783
- /**
1784
- * Lightweight serializer for payment lists. Optimized for list views with
1785
- * minimal data.
86
+ * Payment list item (lighter than detail).
1786
87
  *
1787
88
  * Response model (includes read-only fields).
1788
89
  */
1789
90
  export interface PaymentList {
1790
91
  /** Unique identifier for this record */
1791
92
  id: string;
1792
- /** Payment amount in USD (float for performance) */
1793
- amount_usd: number;
1794
- /** Payment currency */
1795
- currency: number;
1796
- /** Payment provider
1797
-
1798
- * `nowpayments` - NowPayments */
1799
- provider: Enums.PaymentListProvider;
93
+ /** Internal payment identifier (PAY_YYYYMMDDHHMMSS_UUID) */
94
+ internal_payment_id: string;
95
+ /** Payment amount in USD */
96
+ amount_usd: string;
97
+ currency_code: string;
98
+ currency_token: string;
1800
99
  /** Current payment status
1801
100
 
1802
101
  * `pending` - Pending
1803
102
  * `confirming` - Confirming
1804
103
  * `confirmed` - Confirmed
1805
104
  * `completed` - Completed
105
+ * `partially_paid` - Partially Paid
1806
106
  * `failed` - Failed
1807
107
  * `expired` - Expired
1808
- * `cancelled` - Cancelled
1809
- * `refunded` - Refunded */
108
+ * `cancelled` - Cancelled */
1810
109
  status: Enums.PaymentListStatus;
1811
110
  status_display: string;
1812
- /** Get formatted amount display. */
1813
- amount_display: string;
1814
- /** When this record was created */
1815
- created_at: string;
1816
- /** When this payment expires */
1817
- expires_at: string | null;
1818
- }
1819
-
1820
- /**
1821
- * Lightweight subscription serializer for lists. Optimized for subscription
1822
- * lists with minimal data.
1823
- *
1824
- * Response model (includes read-only fields).
1825
- */
1826
- export interface SubscriptionList {
1827
- /** Unique identifier for this record */
1828
- id: string;
1829
- user: string;
1830
- tariff_name: string;
1831
- /** Subscription status
1832
-
1833
- * `active` - Active
1834
- * `inactive` - Inactive
1835
- * `suspended` - Suspended
1836
- * `cancelled` - Cancelled
1837
- * `expired` - Expired */
1838
- status: Enums.SubscriptionListStatus;
1839
- status_display: string;
1840
- /** Check if subscription is active and not expired. */
1841
- is_active: boolean;
1842
- /** Check if subscription is expired. */
1843
- is_expired: boolean;
1844
- /** When this subscription expires */
1845
- expires_at: string;
1846
111
  /** When this record was created */
1847
112
  created_at: string;
1848
- }
1849
-
1850
- /**
1851
- * Chart data point for payments analytics
1852
- *
1853
- * Response model (includes read-only fields).
1854
- */
1855
- export interface ChartDataPoint {
1856
- /** X-axis value (date) */
1857
- x: string;
1858
- /** Y-axis value (amount or count) */
1859
- y: number;
113
+ /** When this payment was completed */
114
+ completed_at: string | null;
1860
115
  }
1861
116