@gofynd/fdk-client-javascript 1.4.2-beta.1 → 1.4.2-beta.3

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 (106) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationModel.d.ts +1742 -1726
  4. package/sdk/application/Cart/CartApplicationModel.js +1497 -1481
  5. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
  6. package/sdk/application/Catalog/CatalogApplicationModel.js +1611 -1611
  7. package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
  8. package/sdk/application/Common/CommonApplicationModel.js +172 -172
  9. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
  10. package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
  11. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1614 -1614
  12. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1151 -1151
  13. package/sdk/application/Content/ContentApplicationModel.d.ts +797 -797
  14. package/sdk/application/Content/ContentApplicationModel.js +757 -757
  15. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
  16. package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
  17. package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
  18. package/sdk/application/Lead/LeadApplicationModel.js +301 -301
  19. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +666 -666
  20. package/sdk/application/Logistic/LogisticApplicationModel.js +601 -601
  21. package/sdk/application/Order/OrderApplicationModel.d.ts +846 -846
  22. package/sdk/application/Order/OrderApplicationModel.js +822 -822
  23. package/sdk/application/Payment/PaymentApplicationClient.d.ts +5 -5
  24. package/sdk/application/Payment/PaymentApplicationClient.js +10 -10
  25. package/sdk/application/Payment/PaymentApplicationModel.d.ts +2155 -2150
  26. package/sdk/application/Payment/PaymentApplicationModel.js +1460 -1458
  27. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +5 -5
  28. package/sdk/application/Payment/PaymentApplicationValidator.js +3 -3
  29. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1462 -1462
  30. package/sdk/application/PosCart/PosCartApplicationModel.js +1260 -1260
  31. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
  32. package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
  33. package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
  34. package/sdk/application/Share/ShareApplicationModel.js +121 -121
  35. package/sdk/application/Theme/ThemeApplicationModel.d.ts +895 -895
  36. package/sdk/application/Theme/ThemeApplicationModel.js +684 -684
  37. package/sdk/application/User/UserApplicationModel.d.ts +762 -762
  38. package/sdk/application/User/UserApplicationModel.js +738 -738
  39. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +63 -63
  40. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +65 -65
  41. package/sdk/partner/Lead/LeadPartnerModel.d.ts +661 -661
  42. package/sdk/partner/Lead/LeadPartnerModel.js +491 -491
  43. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +223 -223
  44. package/sdk/partner/Logistics/LogisticsPartnerModel.js +235 -235
  45. package/sdk/partner/Theme/ThemePartnerModel.d.ts +1087 -1087
  46. package/sdk/partner/Theme/ThemePartnerModel.js +819 -819
  47. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +386 -386
  48. package/sdk/partner/Webhook/WebhookPartnerModel.js +342 -342
  49. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
  50. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
  51. package/sdk/platform/Billing/BillingPlatformModel.d.ts +801 -801
  52. package/sdk/platform/Billing/BillingPlatformModel.js +783 -783
  53. package/sdk/platform/Cart/CartPlatformModel.d.ts +3333 -3317
  54. package/sdk/platform/Cart/CartPlatformModel.js +2936 -2920
  55. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1013 -1013
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +923 -923
  57. package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
  58. package/sdk/platform/Common/CommonPlatformModel.js +187 -187
  59. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1238 -1238
  60. package/sdk/platform/Communication/CommunicationPlatformModel.js +1273 -1273
  61. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +661 -661
  62. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +692 -692
  63. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +3198 -3198
  64. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2247 -2247
  65. package/sdk/platform/Content/ContentPlatformModel.d.ts +1833 -1833
  66. package/sdk/platform/Content/ContentPlatformModel.js +1837 -1837
  67. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +245 -245
  68. package/sdk/platform/Discount/DiscountPlatformModel.js +248 -248
  69. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +865 -865
  70. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +877 -877
  71. package/sdk/platform/Finance/FinancePlatformModel.d.ts +1044 -1044
  72. package/sdk/platform/Finance/FinancePlatformModel.js +974 -974
  73. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
  74. package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
  75. package/sdk/platform/Lead/LeadPlatformModel.d.ts +608 -608
  76. package/sdk/platform/Lead/LeadPlatformModel.js +465 -465
  77. package/sdk/platform/Order/OrderPlatformModel.d.ts +5180 -5176
  78. package/sdk/platform/Order/OrderPlatformModel.js +4740 -4736
  79. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
  80. package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
  81. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2670 -2660
  82. package/sdk/platform/Payment/PaymentPlatformModel.js +1831 -1827
  83. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
  84. package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
  85. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1505 -1507
  86. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1532 -1536
  87. package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
  88. package/sdk/platform/Share/SharePlatformModel.js +139 -139
  89. package/sdk/platform/Theme/ThemePlatformModel.d.ts +1046 -1046
  90. package/sdk/platform/Theme/ThemePlatformModel.js +789 -789
  91. package/sdk/platform/User/UserPlatformModel.d.ts +758 -758
  92. package/sdk/platform/User/UserPlatformModel.js +643 -643
  93. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +439 -439
  94. package/sdk/platform/Webhook/WebhookPlatformModel.js +364 -364
  95. package/sdk/public/Billing/BillingPublicModel.d.ts +55 -55
  96. package/sdk/public/Billing/BillingPublicModel.js +51 -51
  97. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
  98. package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
  99. package/sdk/public/Content/ContentPublicModel.d.ts +26 -26
  100. package/sdk/public/Content/ContentPublicModel.js +28 -28
  101. package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
  102. package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
  103. package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
  104. package/sdk/public/Partner/PartnerPublicModel.js +113 -113
  105. package/sdk/public/Webhook/WebhookPublicModel.d.ts +87 -87
  106. package/sdk/public/Webhook/WebhookPublicModel.js +93 -93
@@ -6,587 +6,587 @@ const Joi = require("joi");
6
6
  */
7
7
 
8
8
  /**
9
- * @typedef CancelSubscriptionReq
10
- * @property {string} [product_suite]
11
- * @property {string} [subscription_id]
12
- * @property {string} [type]
13
- * @property {string} [unique_id]
9
+ * @typedef ResourceNotFound
10
+ * @property {string} [message] - Resource not found with {id}
14
11
  */
15
12
 
16
13
  /**
17
- * @typedef CancelSubscriptionRes
18
- * @property {Subscription} [data]
19
- * @property {boolean} [success]
14
+ * @typedef InternalServerError
15
+ * @property {string} [message] - Internal server Server error
16
+ * @property {string} [code] - Error code
20
17
  */
21
18
 
22
19
  /**
23
- * @typedef ChargeLineItem
24
- * @property {number} [capped_amount]
25
- * @property {boolean} [is_test]
26
- * @property {Object} [metadata]
27
- * @property {string} name
28
- * @property {EntityChargePrice} price
29
- * @property {string} pricing_type
30
- * @property {EntityChargeRecurring} [recurring]
31
- * @property {string} term
32
- * @property {number} [trial_days]
20
+ * @typedef CheckValidityResponse
21
+ * @property {boolean} [is_valid]
22
+ * @property {number} [discount_amount]
33
23
  */
34
24
 
35
25
  /**
36
- * @typedef CheckValidityResponse
37
- * @property {number} [discount_amount]
38
- * @property {boolean} [is_valid]
26
+ * @typedef PlanRecurring
27
+ * @property {string} [interval]
28
+ * @property {number} [interval_count]
39
29
  */
40
30
 
41
31
  /**
42
- * @typedef CreateOneTimeCharge
43
- * @property {OneTimeChargeItem} charge
44
- * @property {boolean} [is_test]
45
- * @property {string} name
46
- * @property {string} return_url
32
+ * @typedef Plan
33
+ * @property {PlanRecurring} [recurring]
34
+ * @property {boolean} [is_trial_plan]
35
+ * @property {string} [plan_group]
36
+ * @property {string[]} [tag_lines]
37
+ * @property {string} [currency]
38
+ * @property {boolean} [is_active]
39
+ * @property {boolean} [is_visible]
40
+ * @property {number} [trial_period]
41
+ * @property {string[]} [addons]
42
+ * @property {string[]} [tags]
43
+ * @property {string} [type]
44
+ * @property {string} [country]
45
+ * @property {string} [_id]
46
+ * @property {string} [name]
47
+ * @property {string} [description]
48
+ * @property {number} [amount]
49
+ * @property {string} [product_suite_id]
50
+ * @property {string} [created_at]
51
+ * @property {string} [modified_at]
47
52
  */
48
53
 
49
54
  /**
50
- * @typedef CreateOneTimeChargeResponse
51
- * @property {OneTimeChargeEntity} [charge]
52
- * @property {string} [confirm_url]
55
+ * @typedef SubscriptionTrialPeriod
56
+ * @property {string} [start_date]
57
+ * @property {string} [end_date]
53
58
  */
54
59
 
55
60
  /**
56
- * @typedef CreateSubscriptionCharge
57
- * @property {boolean} [is_test]
58
- * @property {ChargeLineItem[]} line_items
59
- * @property {string} name
60
- * @property {string} return_url
61
- * @property {number} [trial_days]
61
+ * @typedef EntityChargePrice
62
+ * @property {number} amount - Amount for price. Minimum value 1
63
+ * @property {string} currency_code
62
64
  */
63
65
 
64
66
  /**
65
- * @typedef CreateSubscriptionResponse
66
- * @property {string} [confirm_url]
67
- * @property {EntitySubscription} [subscription]
67
+ * @typedef EntityChargeRecurring
68
+ * @property {string} interval
68
69
  */
69
70
 
70
71
  /**
71
- * @typedef CurrentPeriod
72
- * @property {string} [end_date]
73
- * @property {string} [start_date]
72
+ * @typedef ChargeLineItem
73
+ * @property {string} name
74
+ * @property {string} term
75
+ * @property {string} pricing_type
76
+ * @property {EntityChargePrice} price
77
+ * @property {EntityChargeRecurring} [recurring]
78
+ * @property {number} [capped_amount]
79
+ * @property {number} [trial_days]
80
+ * @property {boolean} [is_test]
81
+ * @property {Object} [metadata]
74
82
  */
75
83
 
76
84
  /**
77
- * @typedef Details
78
- * @property {Features[]} [features]
79
- * @property {FeeComponents[]} [fee_components]
85
+ * @typedef CreateSubscriptionCharge
86
+ * @property {string} name
87
+ * @property {number} [trial_days]
88
+ * @property {ChargeLineItem[]} line_items
89
+ * @property {boolean} [is_test]
90
+ * @property {string} return_url
80
91
  */
81
92
 
82
93
  /**
83
- * @typedef EntityChargePrice
84
- * @property {number} amount - Amount for price. Minimum value 1
85
- * @property {string} currency_code
94
+ * @typedef OneTimeChargeItem
95
+ * @property {string} name
96
+ * @property {string} [term]
97
+ * @property {string} pricing_type
98
+ * @property {EntityChargePrice} price
99
+ * @property {number} [capped_amount]
100
+ * @property {boolean} [is_test]
101
+ * @property {Object} [metadata]
86
102
  */
87
103
 
88
104
  /**
89
- * @typedef EntityChargeRecurring
90
- * @property {string} interval
105
+ * @typedef CreateOneTimeCharge
106
+ * @property {string} name
107
+ * @property {OneTimeChargeItem} charge
108
+ * @property {boolean} [is_test]
109
+ * @property {string} return_url
91
110
  */
92
111
 
93
112
  /**
94
- * @typedef EntityResponse
95
- * @property {Details[]} [items]
96
- * @property {number} [page]
97
- * @property {number} [page_size]
98
- * @property {boolean} [success]
113
+ * @typedef CurrentPeriod
114
+ * @property {string} [start_date]
115
+ * @property {string} [end_date]
99
116
  */
100
117
 
101
118
  /**
102
- * @typedef EntitySubscription
119
+ * @typedef SubscriptionCharge
103
120
  * @property {string} [_id]
121
+ * @property {string} [name]
122
+ * @property {string} [term] - Brief description for a charge
123
+ * @property {string} [pricing_type]
124
+ * @property {EntityChargePrice} [price]
125
+ * @property {EntityChargeRecurring} [recurring]
126
+ * @property {number} [capped_amount]
104
127
  * @property {string} [activated_on]
105
128
  * @property {string} [cancelled_on]
106
- * @property {number} [company_id]
107
- * @property {SubscriptionCharge[]} [line_items]
129
+ * @property {string} [billing_date]
130
+ * @property {CurrentPeriod} [current_period]
131
+ * @property {string} [status]
132
+ * @property {boolean} [is_test]
108
133
  * @property {Object} [metadata]
134
+ */
135
+
136
+ /**
137
+ * @typedef EntitySubscription
138
+ * @property {string} [_id]
109
139
  * @property {string} [name]
110
140
  * @property {string} [status]
141
+ * @property {number} [company_id]
142
+ * @property {string} [activated_on]
143
+ * @property {string} [cancelled_on]
111
144
  * @property {number} [trial_days]
112
145
  * @property {SubscriptionTrialPeriod} [trial_period]
146
+ * @property {Object} [metadata]
147
+ * @property {SubscriptionCharge[]} [line_items]
113
148
  */
114
149
 
115
150
  /**
116
- * @typedef Features
117
- * @property {string} [description]
118
- * @property {string} [display_text]
119
- * @property {boolean} [enabled]
120
- * @property {string} [group]
151
+ * @typedef OneTimeChargeEntity
152
+ * @property {string} [_id]
121
153
  * @property {string} [name]
122
- * @property {string} [slug]
154
+ * @property {string} [status]
155
+ * @property {string} [activated_on]
156
+ * @property {string} [cancelled_on]
157
+ * @property {Object} [metadata]
158
+ * @property {string} [return_url]
159
+ * @property {boolean} [is_test]
160
+ * @property {string} [pricing_type]
161
+ * @property {string} [subscriber_id]
162
+ * @property {string} [entity_type]
163
+ * @property {string} [entity_id]
164
+ * @property {Object} [meta]
165
+ * @property {EntityChargePrice} [price]
123
166
  */
124
167
 
125
168
  /**
126
- * @typedef FeeComponents
127
- * @property {string[]} [brand]
128
- * @property {string} [business_lead]
129
- * @property {Object[]} [channel]
130
- * @property {Object[]} [components]
131
- * @property {string[]} [location]
132
- * @property {Object} [settle_cycle_period]
133
- * @property {string} [settlement_type]
169
+ * @typedef CreateOneTimeChargeResponse
170
+ * @property {OneTimeChargeEntity} [charge]
171
+ * @property {string} [confirm_url]
134
172
  */
135
173
 
136
174
  /**
137
- * @typedef InternalServerError
138
- * @property {string} [code] - Error code
139
- * @property {string} [message] - Internal server Server error
175
+ * @typedef CreateSubscriptionResponse
176
+ * @property {EntitySubscription} [subscription]
177
+ * @property {string} [confirm_url]
140
178
  */
141
179
 
142
180
  /**
143
- * @typedef Invoice
144
- * @property {InvoiceDetails} [invoice]
145
- * @property {InvoiceItems[]} [invoice_items]
181
+ * @typedef InvoiceDetailsPeriod
182
+ * @property {string} [start]
183
+ * @property {string} [end]
146
184
  */
147
185
 
148
186
  /**
149
- * @typedef InvoiceDetails
187
+ * @typedef InvoiceDetailsClient
188
+ * @property {string[]} [address_lines]
189
+ * @property {string} [name]
190
+ * @property {string} [email]
191
+ * @property {string} [phone]
192
+ */
193
+
194
+ /**
195
+ * @typedef InvoiceDetailsStatusTrail
150
196
  * @property {string} [_id]
151
- * @property {number} [attemp]
152
- * @property {boolean} [auto_advance]
197
+ * @property {string} [value]
198
+ * @property {string} [timestamp]
199
+ */
200
+
201
+ /**
202
+ * @typedef InvoicePaymentMethod
203
+ * @property {string} [pg_payment_method_id]
204
+ */
205
+
206
+ /**
207
+ * @typedef InvoiceDetails
208
+ * @property {InvoiceDetailsPeriod} [period]
153
209
  * @property {InvoiceDetailsClient} [client]
154
- * @property {string} [collection_method]
155
- * @property {string} [created_at]
210
+ * @property {boolean} [auto_advance]
156
211
  * @property {string} [currency]
157
- * @property {string} [current_status]
158
- * @property {string} [hash_identifier]
212
+ * @property {boolean} [paid]
213
+ * @property {number} [attemp]
214
+ * @property {string} [_id]
215
+ * @property {string} [collection_method]
216
+ * @property {string} [subscriber_id]
159
217
  * @property {string} [invoice_url]
160
- * @property {string} [modified_at]
161
- * @property {string} [next_action_time]
162
218
  * @property {string} [number]
163
- * @property {boolean} [paid]
164
- * @property {InvoicePaymentMethod} [payment_method]
165
- * @property {InvoiceDetailsPeriod} [period]
166
219
  * @property {Object} [pg_data]
167
220
  * @property {string} [receipt_number]
168
221
  * @property {string} [statement_descriptor]
222
+ * @property {string} [current_status]
169
223
  * @property {InvoiceDetailsStatusTrail[]} [status_trail]
170
- * @property {string} [subscriber_id]
171
- * @property {string} [subscription]
172
224
  * @property {number} [subtotal]
173
225
  * @property {number} [total]
226
+ * @property {string} [subscription]
227
+ * @property {string} [next_action_time]
228
+ * @property {string} [created_at]
229
+ * @property {string} [modified_at]
230
+ * @property {string} [hash_identifier]
231
+ * @property {InvoicePaymentMethod} [payment_method]
174
232
  */
175
233
 
176
234
  /**
177
- * @typedef InvoiceDetailsClient
178
- * @property {string[]} [address_lines]
179
- * @property {string} [email]
180
- * @property {string} [name]
181
- * @property {string} [phone]
182
- */
183
-
184
- /**
185
- * @typedef InvoiceDetailsPeriod
186
- * @property {string} [end]
187
- * @property {string} [start]
188
- */
189
-
190
- /**
191
- * @typedef InvoiceDetailsStatusTrail
192
- * @property {string} [_id]
193
- * @property {string} [timestamp]
194
- * @property {string} [value]
235
+ * @typedef InvoiceItemsPlanRecurring
236
+ * @property {string} [interval]
237
+ * @property {number} [interval_count]
195
238
  */
196
239
 
197
240
  /**
198
- * @typedef InvoiceItems
199
- * @property {string} [_id]
200
- * @property {number} [amount]
201
- * @property {string} [created_at]
241
+ * @typedef InvoiceItemsPlan
242
+ * @property {InvoiceItemsPlanRecurring} [recurring]
243
+ * @property {boolean} [is_trial_plan]
244
+ * @property {string} [plan_group]
245
+ * @property {string[]} [tag_lines]
202
246
  * @property {string} [currency]
203
- * @property {string} [description]
204
- * @property {string} [invoice_id]
205
- * @property {string} [modified_at]
206
- * @property {string} [name]
207
- * @property {InvoiceItemsPeriod} [period]
208
- * @property {InvoiceItemsPlan} [plan]
209
- * @property {number} [quantity]
247
+ * @property {boolean} [is_active]
248
+ * @property {boolean} [is_visible]
249
+ * @property {number} [trial_period]
250
+ * @property {string[]} [addons]
251
+ * @property {string[]} [tags]
210
252
  * @property {string} [type]
211
- * @property {number} [unit_amount]
253
+ * @property {string} [country]
254
+ * @property {string} [_id]
255
+ * @property {string} [name]
256
+ * @property {string} [description]
257
+ * @property {number} [amount]
258
+ * @property {string} [product_suite_id]
259
+ * @property {string} [created_at]
260
+ * @property {string} [modified_at]
212
261
  */
213
262
 
214
263
  /**
215
264
  * @typedef InvoiceItemsPeriod
216
- * @property {string} [end]
217
265
  * @property {string} [start]
266
+ * @property {string} [end]
218
267
  */
219
268
 
220
269
  /**
221
- * @typedef InvoiceItemsPlan
270
+ * @typedef InvoiceItems
222
271
  * @property {string} [_id]
223
- * @property {string[]} [addons]
224
- * @property {number} [amount]
225
- * @property {string} [country]
226
- * @property {string} [created_at]
227
272
  * @property {string} [currency]
228
- * @property {string} [description]
229
- * @property {boolean} [is_active]
230
- * @property {boolean} [is_trial_plan]
231
- * @property {boolean} [is_visible]
232
- * @property {string} [modified_at]
273
+ * @property {InvoiceItemsPlan} [plan]
233
274
  * @property {string} [name]
234
- * @property {string} [plan_group]
235
- * @property {string} [product_suite_id]
236
- * @property {InvoiceItemsPlanRecurring} [recurring]
237
- * @property {string[]} [tag_lines]
238
- * @property {string[]} [tags]
239
- * @property {number} [trial_period]
275
+ * @property {number} [quantity]
276
+ * @property {string} [description]
277
+ * @property {InvoiceItemsPeriod} [period]
278
+ * @property {number} [unit_amount]
279
+ * @property {number} [amount]
240
280
  * @property {string} [type]
281
+ * @property {string} [invoice_id]
282
+ * @property {string} [created_at]
283
+ * @property {string} [modified_at]
241
284
  */
242
285
 
243
286
  /**
244
- * @typedef InvoiceItemsPlanRecurring
245
- * @property {string} [interval]
246
- * @property {number} [interval_count]
287
+ * @typedef Invoice
288
+ * @property {InvoiceDetails} [invoice]
289
+ * @property {InvoiceItems[]} [invoice_items]
247
290
  */
248
291
 
249
292
  /**
250
- * @typedef InvoicePaymentMethod
251
- * @property {string} [pg_payment_method_id]
293
+ * @typedef InvoicesDataClient
294
+ * @property {string} [name]
295
+ * @property {string} [email]
296
+ * @property {string} [phone]
297
+ * @property {string[]} [address_lines]
252
298
  */
253
299
 
254
300
  /**
255
- * @typedef Invoices
256
- * @property {InvoicesData[]} [data]
257
- * @property {number} [end]
258
- * @property {number} [limit]
259
- * @property {number} [page]
260
- * @property {number} [start]
261
- * @property {number} [total]
301
+ * @typedef InvoicesDataPeriod
302
+ * @property {string} [start]
303
+ * @property {string} [end]
304
+ */
305
+
306
+ /**
307
+ * @typedef InvoicesDataPaymentMethod
308
+ * @property {string} [pg_payment_method_id]
262
309
  */
263
310
 
264
311
  /**
265
312
  * @typedef InvoicesData
266
313
  * @property {string} [_id]
267
- * @property {number} [attemp]
268
- * @property {boolean} [auto_advance]
269
314
  * @property {InvoicesDataClient} [client]
270
- * @property {string} [collection_method]
271
- * @property {string} [created_at]
315
+ * @property {boolean} [auto_advance]
272
316
  * @property {string} [currency]
273
- * @property {string} [current_status]
274
- * @property {string} [hash_identifier]
275
- * @property {InvoiceItems[]} [invoice_items]
317
+ * @property {boolean} [paid]
318
+ * @property {number} [attemp]
319
+ * @property {string} [collection_method]
320
+ * @property {string} [subscriber_id]
276
321
  * @property {string} [invoice_url]
277
- * @property {string} [modified_at]
278
- * @property {string} [next_action_time]
279
322
  * @property {string} [number]
280
- * @property {boolean} [paid]
281
- * @property {InvoicesDataPaymentMethod} [payment_method]
282
- * @property {InvoicesDataPeriod} [period]
283
323
  * @property {Object} [pg_data]
324
+ * @property {InvoicesDataPeriod} [period]
284
325
  * @property {string} [receipt_number]
285
326
  * @property {string} [statement_descriptor]
327
+ * @property {string} [current_status]
286
328
  * @property {InvoiceDetailsStatusTrail[]} [status_trail]
287
- * @property {string} [subscriber_id]
288
- * @property {string} [subscription]
289
329
  * @property {number} [subtotal]
290
330
  * @property {number} [total]
331
+ * @property {string} [subscription]
332
+ * @property {string} [next_action_time]
333
+ * @property {string} [created_at]
334
+ * @property {string} [modified_at]
335
+ * @property {string} [hash_identifier]
336
+ * @property {InvoicesDataPaymentMethod} [payment_method]
337
+ * @property {InvoiceItems[]} [invoice_items]
291
338
  */
292
339
 
293
340
  /**
294
- * @typedef InvoicesDataClient
295
- * @property {string[]} [address_lines]
296
- * @property {string} [email]
297
- * @property {string} [name]
298
- * @property {string} [phone]
299
- */
300
-
301
- /**
302
- * @typedef InvoicesDataPaymentMethod
303
- * @property {string} [pg_payment_method_id]
341
+ * @typedef Invoices
342
+ * @property {InvoicesData[]} [data]
343
+ * @property {number} [start]
344
+ * @property {number} [end]
345
+ * @property {number} [limit]
346
+ * @property {number} [page]
347
+ * @property {number} [total]
304
348
  */
305
349
 
306
350
  /**
307
- * @typedef InvoicesDataPeriod
308
- * @property {string} [end]
309
- * @property {string} [start]
351
+ * @typedef Phone
352
+ * @property {string} [phone_number]
353
+ * @property {string} [phone_country_code]
310
354
  */
311
355
 
312
356
  /**
313
- * @typedef Meta
314
- * @property {boolean} [is_custom_plan]
315
- * @property {boolean} [is_plan_upgrade]
316
- * @property {boolean} [subscribe]
357
+ * @typedef SubscriptionBillingAddress
358
+ * @property {string} [country]
359
+ * @property {string} [state]
360
+ * @property {string} [city]
361
+ * @property {string} [line1]
362
+ * @property {string} [line2]
363
+ * @property {string} [postal_code]
317
364
  */
318
365
 
319
366
  /**
320
- * @typedef OneTimeChargeEntity
367
+ * @typedef SubscriptionCustomer
368
+ * @property {Phone} [phone]
369
+ * @property {SubscriptionBillingAddress} [billing_address]
321
370
  * @property {string} [_id]
322
- * @property {string} [activated_on]
323
- * @property {string} [cancelled_on]
324
- * @property {string} [entity_id]
325
- * @property {string} [entity_type]
326
- * @property {boolean} [is_test]
327
- * @property {Object} [meta]
328
- * @property {Object} [metadata]
371
+ * @property {string} [unique_id]
372
+ * @property {string} [type]
329
373
  * @property {string} [name]
330
- * @property {EntityChargePrice} [price]
331
- * @property {string} [pricing_type]
332
- * @property {string} [return_url]
333
- * @property {string} [status]
334
- * @property {string} [subscriber_id]
335
- */
336
-
337
- /**
338
- * @typedef OneTimeChargeItem
339
- * @property {number} [capped_amount]
340
- * @property {boolean} [is_test]
341
- * @property {Object} [metadata]
342
- * @property {string} name
343
- * @property {EntityChargePrice} price
344
- * @property {string} pricing_type
345
- * @property {string} [term]
346
- */
347
-
348
- /**
349
- * @typedef Phone
350
- * @property {string} [phone_country_code]
351
- * @property {string} [phone_number]
374
+ * @property {string} [email]
375
+ * @property {string} [created_at]
376
+ * @property {string} [modified_at]
377
+ * @property {Object} [data]
352
378
  */
353
379
 
354
380
  /**
355
- * @typedef Plan
356
- * @property {string} [_id]
357
- * @property {string[]} [addons]
358
- * @property {number} [amount]
359
- * @property {string} [country]
360
- * @property {string} [created_at]
361
- * @property {string} [currency]
362
- * @property {string} [description]
363
- * @property {boolean} [is_active]
364
- * @property {boolean} [is_trial_plan]
365
- * @property {boolean} [is_visible]
366
- * @property {string} [modified_at]
367
- * @property {string} [name]
368
- * @property {string} [plan_group]
369
- * @property {string} [product_suite_id]
370
- * @property {PlanRecurring} [recurring]
371
- * @property {string[]} [tag_lines]
372
- * @property {string[]} [tags]
373
- * @property {number} [trial_period]
381
+ * @typedef SubscriptionCustomerCreate
382
+ * @property {Phone} [phone]
383
+ * @property {SubscriptionBillingAddress} [billing_address]
384
+ * @property {string} [unique_id]
374
385
  * @property {string} [type]
386
+ * @property {string} [name]
387
+ * @property {string} [email]
375
388
  */
376
389
 
377
390
  /**
378
- * @typedef PlanRecurring
379
- * @property {string} [interval]
380
- * @property {number} [interval_count]
391
+ * @typedef SubscriptionCurrentPeriod
392
+ * @property {string} [start]
393
+ * @property {string} [end]
381
394
  */
382
395
 
383
396
  /**
384
- * @typedef PlanStatusUpdateReq
385
- * @property {string} [plan_id]
386
- * @property {string} [reason]
387
- * @property {string} [seller_status]
397
+ * @typedef SubscriptionPauseCollection
398
+ * @property {string} [behavior]
399
+ * @property {string} [resume_at]
388
400
  */
389
401
 
390
402
  /**
391
- * @typedef ResourceNotFound
392
- * @property {string} [message] - Resource not found with {id}
403
+ * @typedef SubscriptionTrial
404
+ * @property {string} [start]
405
+ * @property {string} [end]
393
406
  */
394
407
 
395
408
  /**
396
- * @typedef SubscribePlanRes
397
- * @property {string} [current_status]
398
- * @property {Meta} [meta]
399
- * @property {string} [redirect_url]
400
- * @property {string} [transaction_id]
409
+ * @typedef SubscriptionInvoiceSettings
410
+ * @property {boolean} [generation]
411
+ * @property {boolean} [charging]
401
412
  */
402
413
 
403
414
  /**
404
415
  * @typedef Subscription
405
- * @property {string} [_id]
406
- * @property {boolean} [cancel_at_period_end]
407
- * @property {string} [channel_type]
408
- * @property {string} [collection_method]
409
- * @property {string} [created_at]
410
416
  * @property {SubscriptionCurrentPeriod} [current_period]
411
- * @property {string} [current_status]
417
+ * @property {SubscriptionPauseCollection} [pause_collection]
418
+ * @property {SubscriptionTrial} [trial]
412
419
  * @property {SubscriptionInvoiceSettings} [invoice_settings]
413
420
  * @property {boolean} [is_active]
414
- * @property {string} [latest_invoice]
415
- * @property {string} [modified_at]
416
- * @property {SubscriptionPauseCollection} [pause_collection]
417
- * @property {Plan} [plan_data]
421
+ * @property {boolean} [cancel_at_period_end]
422
+ * @property {string} [_id]
423
+ * @property {string} [subscriber_id]
418
424
  * @property {string} [plan_id]
419
425
  * @property {string} [product_suite_id]
420
- * @property {string} [subscriber_id]
421
- * @property {SubscriptionTrial} [trial]
426
+ * @property {Plan} [plan_data]
427
+ * @property {string} [current_status]
428
+ * @property {string} [collection_method]
429
+ * @property {string} [created_at]
430
+ * @property {string} [modified_at]
431
+ * @property {string} [latest_invoice]
432
+ * @property {string} [channel_type]
422
433
  */
423
434
 
424
435
  /**
425
- * @typedef SubscriptionActivateReq
426
- * @property {string} [payment_method]
427
- * @property {string} [plan_id]
428
- * @property {string} [product_suite]
429
- * @property {string} [type]
430
- * @property {string} [unique_id]
436
+ * @typedef SubscriptionStatus
437
+ * @property {boolean} [is_enabled]
438
+ * @property {Subscription} [subscription]
439
+ * @property {InvoicesData} [latest_invoice]
440
+ * @property {Plan} [next_plan]
441
+ * @property {Subscription[]} [current_subscriptions]
442
+ * @property {string} [mandate_amount]
431
443
  */
432
444
 
433
445
  /**
434
- * @typedef SubscriptionActivateRes
435
- * @property {Subscription} [data]
436
- * @property {boolean} [success]
446
+ * @typedef SubscriptionLimitApplication
447
+ * @property {boolean} [enabled]
448
+ * @property {number} [hard_limit]
449
+ * @property {number} [soft_limit]
437
450
  */
438
451
 
439
452
  /**
440
- * @typedef SubscriptionBillingAddress
441
- * @property {string} [city]
442
- * @property {string} [country]
443
- * @property {string} [line1]
444
- * @property {string} [line2]
445
- * @property {string} [postal_code]
446
- * @property {string} [state]
453
+ * @typedef SubscriptionLimitMarketplace
454
+ * @property {boolean} [enabled]
447
455
  */
448
456
 
449
457
  /**
450
- * @typedef SubscriptionCharge
451
- * @property {string} [_id]
452
- * @property {string} [activated_on]
453
- * @property {string} [billing_date]
454
- * @property {string} [cancelled_on]
455
- * @property {number} [capped_amount]
456
- * @property {CurrentPeriod} [current_period]
457
- * @property {boolean} [is_test]
458
- * @property {Object} [metadata]
459
- * @property {string} [name]
460
- * @property {EntityChargePrice} [price]
461
- * @property {string} [pricing_type]
462
- * @property {EntityChargeRecurring} [recurring]
463
- * @property {string} [status]
464
- * @property {string} [term] - Brief description for a charge
458
+ * @typedef SubscriptionLimitOtherPlatform
459
+ * @property {boolean} [enabled]
465
460
  */
466
461
 
467
462
  /**
468
- * @typedef SubscriptionCurrentPeriod
469
- * @property {string} [end]
470
- * @property {string} [start]
463
+ * @typedef SubscriptionLimitTeam
464
+ * @property {number} [limit]
471
465
  */
472
466
 
473
467
  /**
474
- * @typedef SubscriptionCustomer
475
- * @property {string} [_id]
476
- * @property {SubscriptionBillingAddress} [billing_address]
477
- * @property {string} [created_at]
478
- * @property {Object} [data]
479
- * @property {string} [email]
480
- * @property {string} [modified_at]
481
- * @property {string} [name]
482
- * @property {Phone} [phone]
483
- * @property {string} [type]
484
- * @property {string} [unique_id]
468
+ * @typedef SubscriptionLimitProducts
469
+ * @property {boolean} [bulk]
470
+ * @property {number} [limit]
485
471
  */
486
472
 
487
473
  /**
488
- * @typedef SubscriptionCustomerCreate
489
- * @property {SubscriptionBillingAddress} [billing_address]
490
- * @property {string} [email]
491
- * @property {string} [name]
492
- * @property {Phone} [phone]
493
- * @property {string} [type]
494
- * @property {string} [unique_id]
474
+ * @typedef SubscriptionLimitExtensions
475
+ * @property {boolean} [enabled]
476
+ * @property {number} [limit]
495
477
  */
496
478
 
497
479
  /**
498
- * @typedef SubscriptionInvoiceSettings
499
- * @property {boolean} [charging]
500
- * @property {boolean} [generation]
480
+ * @typedef SubscriptionLimitIntegrations
481
+ * @property {boolean} [enabled]
482
+ * @property {number} [limit]
501
483
  */
502
484
 
503
485
  /**
504
486
  * @typedef SubscriptionLimit
505
487
  * @property {SubscriptionLimitApplication} [application]
506
- * @property {SubscriptionLimitExtensions} [extensions]
507
- * @property {SubscriptionLimitIntegrations} [integrations]
508
- * @property {boolean} [is_trial_plan]
509
488
  * @property {SubscriptionLimitMarketplace} [marketplace]
510
489
  * @property {SubscriptionLimitOtherPlatform} [other_platform]
511
- * @property {SubscriptionLimitProducts} [products]
512
490
  * @property {SubscriptionLimitTeam} [team]
491
+ * @property {SubscriptionLimitProducts} [products]
492
+ * @property {SubscriptionLimitExtensions} [extensions]
493
+ * @property {SubscriptionLimitIntegrations} [integrations]
494
+ * @property {boolean} [is_trial_plan]
513
495
  */
514
496
 
515
497
  /**
516
- * @typedef SubscriptionLimitApplication
517
- * @property {boolean} [enabled]
518
- * @property {number} [hard_limit]
519
- * @property {number} [soft_limit]
498
+ * @typedef SubscriptionActivateReq
499
+ * @property {string} [unique_id]
500
+ * @property {string} [type]
501
+ * @property {string} [product_suite]
502
+ * @property {string} [plan_id]
503
+ * @property {string} [payment_method]
520
504
  */
521
505
 
522
506
  /**
523
- * @typedef SubscriptionLimitExtensions
524
- * @property {boolean} [enabled]
525
- * @property {number} [limit]
507
+ * @typedef SubscriptionActivateRes
508
+ * @property {boolean} [success]
509
+ * @property {Subscription} [data]
526
510
  */
527
511
 
528
512
  /**
529
- * @typedef SubscriptionLimitIntegrations
530
- * @property {boolean} [enabled]
531
- * @property {number} [limit]
513
+ * @typedef CancelSubscriptionReq
514
+ * @property {string} [unique_id]
515
+ * @property {string} [type]
516
+ * @property {string} [product_suite]
517
+ * @property {string} [subscription_id]
532
518
  */
533
519
 
534
520
  /**
535
- * @typedef SubscriptionLimitMarketplace
536
- * @property {boolean} [enabled]
521
+ * @typedef CancelSubscriptionRes
522
+ * @property {boolean} [success]
523
+ * @property {Subscription} [data]
537
524
  */
538
525
 
539
526
  /**
540
- * @typedef SubscriptionLimitOtherPlatform
541
- * @property {boolean} [enabled]
527
+ * @typedef PlanStatusUpdateReq
528
+ * @property {string} [plan_id]
529
+ * @property {string} [reason]
530
+ * @property {string} [seller_status]
542
531
  */
543
532
 
544
533
  /**
545
- * @typedef SubscriptionLimitProducts
546
- * @property {boolean} [bulk]
547
- * @property {number} [limit]
534
+ * @typedef SunscribePlan
535
+ * @property {string} [entity_type]
536
+ * @property {string} [collection_type]
537
+ * @property {string} [plan_id]
538
+ * @property {string} [callback_url]
539
+ * @property {Meta} [meta]
548
540
  */
549
541
 
550
542
  /**
551
- * @typedef SubscriptionLimitTeam
552
- * @property {number} [limit]
543
+ * @typedef Meta
544
+ * @property {boolean} [subscribe]
545
+ * @property {boolean} [is_custom_plan]
546
+ * @property {boolean} [is_plan_upgrade]
553
547
  */
554
548
 
555
549
  /**
556
- * @typedef SubscriptionPauseCollection
557
- * @property {string} [behavior]
558
- * @property {string} [resume_at]
550
+ * @typedef SubscribePlanRes
551
+ * @property {string} [redirect_url]
552
+ * @property {string} [transaction_id]
553
+ * @property {string} [current_status]
554
+ * @property {Meta} [meta]
559
555
  */
560
556
 
561
557
  /**
562
- * @typedef SubscriptionStatus
563
- * @property {Subscription[]} [current_subscriptions]
564
- * @property {boolean} [is_enabled]
565
- * @property {InvoicesData} [latest_invoice]
566
- * @property {string} [mandate_amount]
567
- * @property {Plan} [next_plan]
568
- * @property {Subscription} [subscription]
558
+ * @typedef Features
559
+ * @property {string} [name]
560
+ * @property {string} [slug]
561
+ * @property {string} [description]
562
+ * @property {string} [group]
563
+ * @property {boolean} [enabled]
564
+ * @property {string} [display_text]
569
565
  */
570
566
 
571
567
  /**
572
- * @typedef SubscriptionTrial
573
- * @property {string} [end]
574
- * @property {string} [start]
568
+ * @typedef FeeComponents
569
+ * @property {string[]} [brand]
570
+ * @property {string[]} [location]
571
+ * @property {Object[]} [channel]
572
+ * @property {string} [business_lead]
573
+ * @property {string} [settlement_type]
574
+ * @property {Object} [settle_cycle_period]
575
+ * @property {Object[]} [components]
575
576
  */
576
577
 
577
578
  /**
578
- * @typedef SubscriptionTrialPeriod
579
- * @property {string} [end_date]
580
- * @property {string} [start_date]
579
+ * @typedef Details
580
+ * @property {FeeComponents[]} [fee_components]
581
+ * @property {Features[]} [features]
581
582
  */
582
583
 
583
584
  /**
584
- * @typedef SunscribePlan
585
- * @property {string} [callback_url]
586
- * @property {string} [collection_type]
587
- * @property {string} [entity_type]
588
- * @property {Meta} [meta]
589
- * @property {string} [plan_id]
585
+ * @typedef EntityResponse
586
+ * @property {boolean} [success]
587
+ * @property {number} [page]
588
+ * @property {number} [page_size]
589
+ * @property {Details[]} [items]
590
590
  */
591
591
 
592
592
  class BillingPlatformModel {
@@ -597,319 +597,372 @@ class BillingPlatformModel {
597
597
  });
598
598
  }
599
599
 
600
- /** @returns {CancelSubscriptionReq} */
601
- static CancelSubscriptionReq() {
600
+ /** @returns {ResourceNotFound} */
601
+ static ResourceNotFound() {
602
602
  return Joi.object({
603
- product_suite: Joi.string().allow(""),
604
- subscription_id: Joi.string().allow(""),
605
- type: Joi.string().allow(""),
606
- unique_id: Joi.string().allow(""),
603
+ message: Joi.string().allow(""),
607
604
  });
608
605
  }
609
606
 
610
- /** @returns {CancelSubscriptionRes} */
611
- static CancelSubscriptionRes() {
607
+ /** @returns {InternalServerError} */
608
+ static InternalServerError() {
612
609
  return Joi.object({
613
- data: BillingPlatformModel.Subscription(),
614
- success: Joi.boolean(),
610
+ message: Joi.string().allow(""),
611
+ code: Joi.string().allow(""),
615
612
  });
616
613
  }
617
614
 
618
- /** @returns {ChargeLineItem} */
619
- static ChargeLineItem() {
615
+ /** @returns {CheckValidityResponse} */
616
+ static CheckValidityResponse() {
620
617
  return Joi.object({
621
- capped_amount: Joi.number(),
622
- is_test: Joi.boolean(),
623
- metadata: Joi.any(),
624
- name: Joi.string().allow("").required(),
625
- price: BillingPlatformModel.EntityChargePrice().required(),
626
- pricing_type: Joi.string().allow("").required(),
627
- recurring: BillingPlatformModel.EntityChargeRecurring(),
628
- term: Joi.string().allow("").required(),
629
- trial_days: Joi.number(),
618
+ is_valid: Joi.boolean(),
619
+ discount_amount: Joi.number(),
630
620
  });
631
621
  }
632
622
 
633
- /** @returns {CheckValidityResponse} */
634
- static CheckValidityResponse() {
623
+ /** @returns {PlanRecurring} */
624
+ static PlanRecurring() {
635
625
  return Joi.object({
636
- discount_amount: Joi.number(),
637
- is_valid: Joi.boolean(),
626
+ interval: Joi.string().allow(""),
627
+ interval_count: Joi.number(),
638
628
  });
639
629
  }
640
630
 
641
- /** @returns {CreateOneTimeCharge} */
642
- static CreateOneTimeCharge() {
631
+ /** @returns {Plan} */
632
+ static Plan() {
643
633
  return Joi.object({
644
- charge: BillingPlatformModel.OneTimeChargeItem().required(),
645
- is_test: Joi.boolean(),
646
- name: Joi.string().allow("").required(),
647
- return_url: Joi.string().allow("").required(),
634
+ recurring: BillingPlatformModel.PlanRecurring(),
635
+ is_trial_plan: Joi.boolean(),
636
+ plan_group: Joi.string().allow(""),
637
+ tag_lines: Joi.array().items(Joi.string().allow("")),
638
+ currency: Joi.string().allow(""),
639
+ is_active: Joi.boolean(),
640
+ is_visible: Joi.boolean(),
641
+ trial_period: Joi.number(),
642
+ addons: Joi.array().items(Joi.string().allow("")),
643
+ tags: Joi.array().items(Joi.string().allow("")),
644
+ type: Joi.string().allow(""),
645
+ country: Joi.string().allow(""),
646
+ _id: Joi.string().allow(""),
647
+ name: Joi.string().allow(""),
648
+ description: Joi.string().allow(""),
649
+ amount: Joi.number(),
650
+ product_suite_id: Joi.string().allow(""),
651
+ created_at: Joi.string().allow(""),
652
+ modified_at: Joi.string().allow(""),
653
+ });
654
+ }
655
+
656
+ /** @returns {SubscriptionTrialPeriod} */
657
+ static SubscriptionTrialPeriod() {
658
+ return Joi.object({
659
+ start_date: Joi.string().allow(""),
660
+ end_date: Joi.string().allow(""),
661
+ });
662
+ }
663
+
664
+ /** @returns {EntityChargePrice} */
665
+ static EntityChargePrice() {
666
+ return Joi.object({
667
+ amount: Joi.number().required(),
668
+ currency_code: Joi.string().allow("").required(),
669
+ });
670
+ }
671
+
672
+ /** @returns {EntityChargeRecurring} */
673
+ static EntityChargeRecurring() {
674
+ return Joi.object({
675
+ interval: Joi.string().allow("").required(),
648
676
  });
649
677
  }
650
678
 
651
- /** @returns {CreateOneTimeChargeResponse} */
652
- static CreateOneTimeChargeResponse() {
679
+ /** @returns {ChargeLineItem} */
680
+ static ChargeLineItem() {
653
681
  return Joi.object({
654
- charge: BillingPlatformModel.OneTimeChargeEntity(),
655
- confirm_url: Joi.string().allow(""),
682
+ name: Joi.string().allow("").required(),
683
+ term: Joi.string().allow("").required(),
684
+ pricing_type: Joi.string().allow("").required(),
685
+ price: BillingPlatformModel.EntityChargePrice().required(),
686
+ recurring: BillingPlatformModel.EntityChargeRecurring(),
687
+ capped_amount: Joi.number(),
688
+ trial_days: Joi.number(),
689
+ is_test: Joi.boolean(),
690
+ metadata: Joi.any(),
656
691
  });
657
692
  }
658
693
 
659
694
  /** @returns {CreateSubscriptionCharge} */
660
695
  static CreateSubscriptionCharge() {
661
696
  return Joi.object({
662
- is_test: Joi.boolean(),
697
+ name: Joi.string().allow("").required(),
698
+ trial_days: Joi.number(),
663
699
  line_items: Joi.array()
664
700
  .items(BillingPlatformModel.ChargeLineItem())
665
701
  .required(),
666
- name: Joi.string().allow("").required(),
702
+ is_test: Joi.boolean(),
667
703
  return_url: Joi.string().allow("").required(),
668
- trial_days: Joi.number(),
669
704
  });
670
705
  }
671
706
 
672
- /** @returns {CreateSubscriptionResponse} */
673
- static CreateSubscriptionResponse() {
707
+ /** @returns {OneTimeChargeItem} */
708
+ static OneTimeChargeItem() {
674
709
  return Joi.object({
675
- confirm_url: Joi.string().allow(""),
676
- subscription: BillingPlatformModel.EntitySubscription(),
710
+ name: Joi.string().allow("").required(),
711
+ term: Joi.string().allow(""),
712
+ pricing_type: Joi.string().allow("").required(),
713
+ price: BillingPlatformModel.EntityChargePrice().required(),
714
+ capped_amount: Joi.number(),
715
+ is_test: Joi.boolean(),
716
+ metadata: Joi.any(),
717
+ });
718
+ }
719
+
720
+ /** @returns {CreateOneTimeCharge} */
721
+ static CreateOneTimeCharge() {
722
+ return Joi.object({
723
+ name: Joi.string().allow("").required(),
724
+ charge: BillingPlatformModel.OneTimeChargeItem().required(),
725
+ is_test: Joi.boolean(),
726
+ return_url: Joi.string().allow("").required(),
677
727
  });
678
728
  }
679
729
 
680
730
  /** @returns {CurrentPeriod} */
681
731
  static CurrentPeriod() {
682
732
  return Joi.object({
683
- end_date: Joi.string().allow(""),
684
733
  start_date: Joi.string().allow(""),
734
+ end_date: Joi.string().allow(""),
685
735
  });
686
736
  }
687
737
 
688
- /** @returns {Details} */
689
- static Details() {
738
+ /** @returns {SubscriptionCharge} */
739
+ static SubscriptionCharge() {
690
740
  return Joi.object({
691
- features: Joi.array().items(BillingPlatformModel.Features()),
692
- fee_components: Joi.array().items(BillingPlatformModel.FeeComponents()),
741
+ _id: Joi.string().allow(""),
742
+ name: Joi.string().allow(""),
743
+ term: Joi.string().allow(""),
744
+ pricing_type: Joi.string().allow(""),
745
+ price: BillingPlatformModel.EntityChargePrice(),
746
+ recurring: BillingPlatformModel.EntityChargeRecurring(),
747
+ capped_amount: Joi.number(),
748
+ activated_on: Joi.string().allow(""),
749
+ cancelled_on: Joi.string().allow(""),
750
+ billing_date: Joi.string().allow(""),
751
+ current_period: BillingPlatformModel.CurrentPeriod(),
752
+ status: Joi.string().allow(""),
753
+ is_test: Joi.boolean(),
754
+ metadata: Joi.any(),
693
755
  });
694
756
  }
695
757
 
696
- /** @returns {EntityChargePrice} */
697
- static EntityChargePrice() {
758
+ /** @returns {EntitySubscription} */
759
+ static EntitySubscription() {
698
760
  return Joi.object({
699
- amount: Joi.number().required(),
700
- currency_code: Joi.string().allow("").required(),
761
+ _id: Joi.string().allow(""),
762
+ name: Joi.string().allow(""),
763
+ status: Joi.string().allow(""),
764
+ company_id: Joi.number(),
765
+ activated_on: Joi.string().allow(""),
766
+ cancelled_on: Joi.string().allow(""),
767
+ trial_days: Joi.number(),
768
+ trial_period: BillingPlatformModel.SubscriptionTrialPeriod(),
769
+ metadata: Joi.any(),
770
+ line_items: Joi.array().items(BillingPlatformModel.SubscriptionCharge()),
701
771
  });
702
772
  }
703
773
 
704
- /** @returns {EntityChargeRecurring} */
705
- static EntityChargeRecurring() {
774
+ /** @returns {OneTimeChargeEntity} */
775
+ static OneTimeChargeEntity() {
706
776
  return Joi.object({
707
- interval: Joi.string().allow("").required(),
777
+ _id: Joi.string().allow(""),
778
+ name: Joi.string().allow(""),
779
+ status: Joi.string().allow(""),
780
+ activated_on: Joi.string().allow(""),
781
+ cancelled_on: Joi.string().allow(""),
782
+ metadata: Joi.any(),
783
+ return_url: Joi.string().allow(""),
784
+ is_test: Joi.boolean(),
785
+ pricing_type: Joi.string().allow(""),
786
+ subscriber_id: Joi.string().allow(""),
787
+ entity_type: Joi.string().allow(""),
788
+ entity_id: Joi.string().allow(""),
789
+ meta: Joi.any(),
790
+ price: BillingPlatformModel.EntityChargePrice(),
708
791
  });
709
792
  }
710
793
 
711
- /** @returns {EntityResponse} */
712
- static EntityResponse() {
794
+ /** @returns {CreateOneTimeChargeResponse} */
795
+ static CreateOneTimeChargeResponse() {
713
796
  return Joi.object({
714
- items: Joi.array().items(BillingPlatformModel.Details()),
715
- page: Joi.number(),
716
- page_size: Joi.number(),
717
- success: Joi.boolean(),
797
+ charge: BillingPlatformModel.OneTimeChargeEntity(),
798
+ confirm_url: Joi.string().allow(""),
718
799
  });
719
800
  }
720
801
 
721
- /** @returns {EntitySubscription} */
722
- static EntitySubscription() {
802
+ /** @returns {CreateSubscriptionResponse} */
803
+ static CreateSubscriptionResponse() {
723
804
  return Joi.object({
724
- _id: Joi.string().allow(""),
725
- activated_on: Joi.string().allow(""),
726
- cancelled_on: Joi.string().allow(""),
727
- company_id: Joi.number(),
728
- line_items: Joi.array().items(BillingPlatformModel.SubscriptionCharge()),
729
- metadata: Joi.any(),
730
- name: Joi.string().allow(""),
731
- status: Joi.string().allow(""),
732
- trial_days: Joi.number(),
733
- trial_period: BillingPlatformModel.SubscriptionTrialPeriod(),
805
+ subscription: BillingPlatformModel.EntitySubscription(),
806
+ confirm_url: Joi.string().allow(""),
734
807
  });
735
808
  }
736
809
 
737
- /** @returns {Features} */
738
- static Features() {
810
+ /** @returns {InvoiceDetailsPeriod} */
811
+ static InvoiceDetailsPeriod() {
739
812
  return Joi.object({
740
- description: Joi.string().allow(""),
741
- display_text: Joi.string().allow(""),
742
- enabled: Joi.boolean(),
743
- group: Joi.string().allow(""),
744
- name: Joi.string().allow(""),
745
- slug: Joi.string().allow(""),
813
+ start: Joi.string().allow(""),
814
+ end: Joi.string().allow(""),
746
815
  });
747
816
  }
748
817
 
749
- /** @returns {FeeComponents} */
750
- static FeeComponents() {
818
+ /** @returns {InvoiceDetailsClient} */
819
+ static InvoiceDetailsClient() {
751
820
  return Joi.object({
752
- brand: Joi.array().items(Joi.string().allow("")),
753
- business_lead: Joi.string().allow(""),
754
- channel: Joi.array().items(Joi.any()),
755
- components: Joi.array().items(Joi.any()),
756
- location: Joi.array().items(Joi.string().allow("")),
757
- settle_cycle_period: Joi.any(),
758
- settlement_type: Joi.string().allow(""),
821
+ address_lines: Joi.array().items(Joi.string().allow("")),
822
+ name: Joi.string().allow(""),
823
+ email: Joi.string().allow(""),
824
+ phone: Joi.string().allow(""),
759
825
  });
760
826
  }
761
827
 
762
- /** @returns {InternalServerError} */
763
- static InternalServerError() {
828
+ /** @returns {InvoiceDetailsStatusTrail} */
829
+ static InvoiceDetailsStatusTrail() {
764
830
  return Joi.object({
765
- code: Joi.string().allow(""),
766
- message: Joi.string().allow(""),
831
+ _id: Joi.string().allow(""),
832
+ value: Joi.string().allow(""),
833
+ timestamp: Joi.string().allow(""),
767
834
  });
768
835
  }
769
836
 
770
- /** @returns {Invoice} */
771
- static Invoice() {
837
+ /** @returns {InvoicePaymentMethod} */
838
+ static InvoicePaymentMethod() {
772
839
  return Joi.object({
773
- invoice: BillingPlatformModel.InvoiceDetails(),
774
- invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
840
+ pg_payment_method_id: Joi.string().allow(""),
775
841
  });
776
842
  }
777
843
 
778
844
  /** @returns {InvoiceDetails} */
779
845
  static InvoiceDetails() {
780
846
  return Joi.object({
781
- _id: Joi.string().allow(""),
782
- attemp: Joi.number(),
783
- auto_advance: Joi.boolean(),
847
+ period: BillingPlatformModel.InvoiceDetailsPeriod(),
784
848
  client: BillingPlatformModel.InvoiceDetailsClient(),
785
- collection_method: Joi.string().allow(""),
786
- created_at: Joi.string().allow(""),
849
+ auto_advance: Joi.boolean(),
787
850
  currency: Joi.string().allow(""),
788
- current_status: Joi.string().allow(""),
789
- hash_identifier: Joi.string().allow(""),
851
+ paid: Joi.boolean(),
852
+ attemp: Joi.number(),
853
+ _id: Joi.string().allow(""),
854
+ collection_method: Joi.string().allow(""),
855
+ subscriber_id: Joi.string().allow(""),
790
856
  invoice_url: Joi.string().allow(""),
791
- modified_at: Joi.string().allow(""),
792
- next_action_time: Joi.string().allow(""),
793
857
  number: Joi.string().allow(""),
794
- paid: Joi.boolean(),
795
- payment_method: BillingPlatformModel.InvoicePaymentMethod(),
796
- period: BillingPlatformModel.InvoiceDetailsPeriod(),
797
858
  pg_data: Joi.any(),
798
859
  receipt_number: Joi.string().allow(""),
799
860
  statement_descriptor: Joi.string().allow(""),
861
+ current_status: Joi.string().allow(""),
800
862
  status_trail: Joi.array().items(
801
863
  BillingPlatformModel.InvoiceDetailsStatusTrail()
802
864
  ),
803
- subscriber_id: Joi.string().allow(""),
804
- subscription: Joi.string().allow(""),
805
865
  subtotal: Joi.number(),
806
866
  total: Joi.number(),
867
+ subscription: Joi.string().allow(""),
868
+ next_action_time: Joi.string().allow(""),
869
+ created_at: Joi.string().allow(""),
870
+ modified_at: Joi.string().allow(""),
871
+ hash_identifier: Joi.string().allow(""),
872
+ payment_method: BillingPlatformModel.InvoicePaymentMethod(),
807
873
  });
808
874
  }
809
875
 
810
- /** @returns {InvoiceDetailsClient} */
811
- static InvoiceDetailsClient() {
812
- return Joi.object({
813
- address_lines: Joi.array().items(Joi.string().allow("")),
814
- email: Joi.string().allow(""),
815
- name: Joi.string().allow(""),
816
- phone: Joi.string().allow(""),
817
- });
818
- }
819
-
820
- /** @returns {InvoiceDetailsPeriod} */
821
- static InvoiceDetailsPeriod() {
822
- return Joi.object({
823
- end: Joi.string().allow(""),
824
- start: Joi.string().allow(""),
825
- });
826
- }
827
-
828
- /** @returns {InvoiceDetailsStatusTrail} */
829
- static InvoiceDetailsStatusTrail() {
876
+ /** @returns {InvoiceItemsPlanRecurring} */
877
+ static InvoiceItemsPlanRecurring() {
830
878
  return Joi.object({
831
- _id: Joi.string().allow(""),
832
- timestamp: Joi.string().allow(""),
833
- value: Joi.string().allow(""),
879
+ interval: Joi.string().allow(""),
880
+ interval_count: Joi.number(),
834
881
  });
835
882
  }
836
883
 
837
- /** @returns {InvoiceItems} */
838
- static InvoiceItems() {
884
+ /** @returns {InvoiceItemsPlan} */
885
+ static InvoiceItemsPlan() {
839
886
  return Joi.object({
840
- _id: Joi.string().allow(""),
841
- amount: Joi.number(),
842
- created_at: Joi.string().allow(""),
887
+ recurring: BillingPlatformModel.InvoiceItemsPlanRecurring(),
888
+ is_trial_plan: Joi.boolean(),
889
+ plan_group: Joi.string().allow(""),
890
+ tag_lines: Joi.array().items(Joi.string().allow("")),
843
891
  currency: Joi.string().allow(""),
844
- description: Joi.string().allow(""),
845
- invoice_id: Joi.string().allow(""),
846
- modified_at: Joi.string().allow(""),
847
- name: Joi.string().allow(""),
848
- period: BillingPlatformModel.InvoiceItemsPeriod(),
849
- plan: BillingPlatformModel.InvoiceItemsPlan(),
850
- quantity: Joi.number(),
892
+ is_active: Joi.boolean(),
893
+ is_visible: Joi.boolean(),
894
+ trial_period: Joi.number(),
895
+ addons: Joi.array().items(Joi.string().allow("")),
896
+ tags: Joi.array().items(Joi.string().allow("")),
851
897
  type: Joi.string().allow(""),
852
- unit_amount: Joi.number(),
898
+ country: Joi.string().allow(""),
899
+ _id: Joi.string().allow(""),
900
+ name: Joi.string().allow(""),
901
+ description: Joi.string().allow(""),
902
+ amount: Joi.number(),
903
+ product_suite_id: Joi.string().allow(""),
904
+ created_at: Joi.string().allow(""),
905
+ modified_at: Joi.string().allow(""),
853
906
  });
854
907
  }
855
908
 
856
909
  /** @returns {InvoiceItemsPeriod} */
857
910
  static InvoiceItemsPeriod() {
858
911
  return Joi.object({
859
- end: Joi.string().allow(""),
860
912
  start: Joi.string().allow(""),
913
+ end: Joi.string().allow(""),
861
914
  });
862
915
  }
863
916
 
864
- /** @returns {InvoiceItemsPlan} */
865
- static InvoiceItemsPlan() {
917
+ /** @returns {InvoiceItems} */
918
+ static InvoiceItems() {
866
919
  return Joi.object({
867
920
  _id: Joi.string().allow(""),
868
- addons: Joi.array().items(Joi.string().allow("")),
869
- amount: Joi.number(),
870
- country: Joi.string().allow(""),
871
- created_at: Joi.string().allow(""),
872
921
  currency: Joi.string().allow(""),
873
- description: Joi.string().allow(""),
874
- is_active: Joi.boolean(),
875
- is_trial_plan: Joi.boolean(),
876
- is_visible: Joi.boolean(),
877
- modified_at: Joi.string().allow(""),
922
+ plan: BillingPlatformModel.InvoiceItemsPlan(),
878
923
  name: Joi.string().allow(""),
879
- plan_group: Joi.string().allow(""),
880
- product_suite_id: Joi.string().allow(""),
881
- recurring: BillingPlatformModel.InvoiceItemsPlanRecurring(),
882
- tag_lines: Joi.array().items(Joi.string().allow("")),
883
- tags: Joi.array().items(Joi.string().allow("")),
884
- trial_period: Joi.number(),
924
+ quantity: Joi.number(),
925
+ description: Joi.string().allow(""),
926
+ period: BillingPlatformModel.InvoiceItemsPeriod(),
927
+ unit_amount: Joi.number(),
928
+ amount: Joi.number(),
885
929
  type: Joi.string().allow(""),
930
+ invoice_id: Joi.string().allow(""),
931
+ created_at: Joi.string().allow(""),
932
+ modified_at: Joi.string().allow(""),
886
933
  });
887
934
  }
888
935
 
889
- /** @returns {InvoiceItemsPlanRecurring} */
890
- static InvoiceItemsPlanRecurring() {
936
+ /** @returns {Invoice} */
937
+ static Invoice() {
891
938
  return Joi.object({
892
- interval: Joi.string().allow(""),
893
- interval_count: Joi.number(),
939
+ invoice: BillingPlatformModel.InvoiceDetails(),
940
+ invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
894
941
  });
895
942
  }
896
943
 
897
- /** @returns {InvoicePaymentMethod} */
898
- static InvoicePaymentMethod() {
944
+ /** @returns {InvoicesDataClient} */
945
+ static InvoicesDataClient() {
899
946
  return Joi.object({
900
- pg_payment_method_id: Joi.string().allow(""),
947
+ name: Joi.string().allow(""),
948
+ email: Joi.string().allow(""),
949
+ phone: Joi.string().allow(""),
950
+ address_lines: Joi.array().items(Joi.string().allow("")),
901
951
  });
902
952
  }
903
953
 
904
- /** @returns {Invoices} */
905
- static Invoices() {
954
+ /** @returns {InvoicesDataPeriod} */
955
+ static InvoicesDataPeriod() {
906
956
  return Joi.object({
907
- data: Joi.array().items(BillingPlatformModel.InvoicesData()),
908
- end: Joi.number(),
909
- limit: Joi.number(),
910
- page: Joi.number(),
911
- start: Joi.number(),
912
- total: Joi.number(),
957
+ start: Joi.string().allow(""),
958
+ end: Joi.string().allow(""),
959
+ });
960
+ }
961
+
962
+ /** @returns {InvoicesDataPaymentMethod} */
963
+ static InvoicesDataPaymentMethod() {
964
+ return Joi.object({
965
+ pg_payment_method_id: Joi.string().allow(""),
913
966
  });
914
967
  }
915
968
 
@@ -917,284 +970,215 @@ class BillingPlatformModel {
917
970
  static InvoicesData() {
918
971
  return Joi.object({
919
972
  _id: Joi.string().allow(""),
920
- attemp: Joi.number(),
921
- auto_advance: Joi.boolean(),
922
973
  client: BillingPlatformModel.InvoicesDataClient(),
923
- collection_method: Joi.string().allow(""),
924
- created_at: Joi.string().allow(""),
974
+ auto_advance: Joi.boolean(),
925
975
  currency: Joi.string().allow(""),
926
- current_status: Joi.string().allow(""),
927
- hash_identifier: Joi.string().allow(""),
928
- invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
976
+ paid: Joi.boolean(),
977
+ attemp: Joi.number(),
978
+ collection_method: Joi.string().allow(""),
979
+ subscriber_id: Joi.string().allow(""),
929
980
  invoice_url: Joi.string().allow(""),
930
- modified_at: Joi.string().allow(""),
931
- next_action_time: Joi.string().allow(""),
932
981
  number: Joi.string().allow(""),
933
- paid: Joi.boolean(),
934
- payment_method: BillingPlatformModel.InvoicesDataPaymentMethod(),
935
- period: BillingPlatformModel.InvoicesDataPeriod(),
936
982
  pg_data: Joi.any(),
983
+ period: BillingPlatformModel.InvoicesDataPeriod(),
937
984
  receipt_number: Joi.string().allow(""),
938
985
  statement_descriptor: Joi.string().allow(""),
986
+ current_status: Joi.string().allow(""),
939
987
  status_trail: Joi.array().items(
940
988
  BillingPlatformModel.InvoiceDetailsStatusTrail()
941
989
  ),
942
- subscriber_id: Joi.string().allow(""),
943
- subscription: Joi.string().allow(""),
944
990
  subtotal: Joi.number(),
945
991
  total: Joi.number(),
992
+ subscription: Joi.string().allow(""),
993
+ next_action_time: Joi.string().allow(""),
994
+ created_at: Joi.string().allow(""),
995
+ modified_at: Joi.string().allow(""),
996
+ hash_identifier: Joi.string().allow(""),
997
+ payment_method: BillingPlatformModel.InvoicesDataPaymentMethod(),
998
+ invoice_items: Joi.array().items(BillingPlatformModel.InvoiceItems()),
946
999
  });
947
1000
  }
948
1001
 
949
- /** @returns {InvoicesDataClient} */
950
- static InvoicesDataClient() {
951
- return Joi.object({
952
- address_lines: Joi.array().items(Joi.string().allow("")),
953
- email: Joi.string().allow(""),
954
- name: Joi.string().allow(""),
955
- phone: Joi.string().allow(""),
956
- });
957
- }
958
-
959
- /** @returns {InvoicesDataPaymentMethod} */
960
- static InvoicesDataPaymentMethod() {
1002
+ /** @returns {Invoices} */
1003
+ static Invoices() {
961
1004
  return Joi.object({
962
- pg_payment_method_id: Joi.string().allow(""),
1005
+ data: Joi.array().items(BillingPlatformModel.InvoicesData()),
1006
+ start: Joi.number(),
1007
+ end: Joi.number(),
1008
+ limit: Joi.number(),
1009
+ page: Joi.number(),
1010
+ total: Joi.number(),
963
1011
  });
964
1012
  }
965
1013
 
966
- /** @returns {InvoicesDataPeriod} */
967
- static InvoicesDataPeriod() {
1014
+ /** @returns {Phone} */
1015
+ static Phone() {
968
1016
  return Joi.object({
969
- end: Joi.string().allow(""),
970
- start: Joi.string().allow(""),
1017
+ phone_number: Joi.string().allow(""),
1018
+ phone_country_code: Joi.string().allow(""),
971
1019
  });
972
1020
  }
973
1021
 
974
- /** @returns {Meta} */
975
- static Meta() {
1022
+ /** @returns {SubscriptionBillingAddress} */
1023
+ static SubscriptionBillingAddress() {
976
1024
  return Joi.object({
977
- is_custom_plan: Joi.boolean(),
978
- is_plan_upgrade: Joi.boolean(),
979
- subscribe: Joi.boolean(),
1025
+ country: Joi.string().allow(""),
1026
+ state: Joi.string().allow(""),
1027
+ city: Joi.string().allow(""),
1028
+ line1: Joi.string().allow(""),
1029
+ line2: Joi.string().allow(""),
1030
+ postal_code: Joi.string().allow(""),
980
1031
  });
981
1032
  }
982
1033
 
983
- /** @returns {OneTimeChargeEntity} */
984
- static OneTimeChargeEntity() {
1034
+ /** @returns {SubscriptionCustomer} */
1035
+ static SubscriptionCustomer() {
985
1036
  return Joi.object({
1037
+ phone: BillingPlatformModel.Phone(),
1038
+ billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
986
1039
  _id: Joi.string().allow(""),
987
- activated_on: Joi.string().allow(""),
988
- cancelled_on: Joi.string().allow(""),
989
- entity_id: Joi.string().allow(""),
990
- entity_type: Joi.string().allow(""),
991
- is_test: Joi.boolean(),
992
- meta: Joi.any(),
993
- metadata: Joi.any(),
1040
+ unique_id: Joi.string().allow(""),
1041
+ type: Joi.string().allow(""),
994
1042
  name: Joi.string().allow(""),
995
- price: BillingPlatformModel.EntityChargePrice(),
996
- pricing_type: Joi.string().allow(""),
997
- return_url: Joi.string().allow(""),
998
- status: Joi.string().allow(""),
999
- subscriber_id: Joi.string().allow(""),
1000
- });
1001
- }
1002
-
1003
- /** @returns {OneTimeChargeItem} */
1004
- static OneTimeChargeItem() {
1005
- return Joi.object({
1006
- capped_amount: Joi.number(),
1007
- is_test: Joi.boolean(),
1008
- metadata: Joi.any(),
1009
- name: Joi.string().allow("").required(),
1010
- price: BillingPlatformModel.EntityChargePrice().required(),
1011
- pricing_type: Joi.string().allow("").required(),
1012
- term: Joi.string().allow(""),
1013
- });
1014
- }
1015
-
1016
- /** @returns {Phone} */
1017
- static Phone() {
1018
- return Joi.object({
1019
- phone_country_code: Joi.string().allow(""),
1020
- phone_number: Joi.string().allow(""),
1043
+ email: Joi.string().allow(""),
1044
+ created_at: Joi.string().allow(""),
1045
+ modified_at: Joi.string().allow(""),
1046
+ data: Joi.any(),
1021
1047
  });
1022
1048
  }
1023
1049
 
1024
- /** @returns {Plan} */
1025
- static Plan() {
1050
+ /** @returns {SubscriptionCustomerCreate} */
1051
+ static SubscriptionCustomerCreate() {
1026
1052
  return Joi.object({
1027
- _id: Joi.string().allow(""),
1028
- addons: Joi.array().items(Joi.string().allow("")),
1029
- amount: Joi.number(),
1030
- country: Joi.string().allow(""),
1031
- created_at: Joi.string().allow(""),
1032
- currency: Joi.string().allow(""),
1033
- description: Joi.string().allow(""),
1034
- is_active: Joi.boolean(),
1035
- is_trial_plan: Joi.boolean(),
1036
- is_visible: Joi.boolean(),
1037
- modified_at: Joi.string().allow(""),
1038
- name: Joi.string().allow(""),
1039
- plan_group: Joi.string().allow(""),
1040
- product_suite_id: Joi.string().allow(""),
1041
- recurring: BillingPlatformModel.PlanRecurring(),
1042
- tag_lines: Joi.array().items(Joi.string().allow("")),
1043
- tags: Joi.array().items(Joi.string().allow("")),
1044
- trial_period: Joi.number(),
1053
+ phone: BillingPlatformModel.Phone(),
1054
+ billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
1055
+ unique_id: Joi.string().allow(""),
1045
1056
  type: Joi.string().allow(""),
1057
+ name: Joi.string().allow(""),
1058
+ email: Joi.string().allow(""),
1046
1059
  });
1047
1060
  }
1048
1061
 
1049
- /** @returns {PlanRecurring} */
1050
- static PlanRecurring() {
1062
+ /** @returns {SubscriptionCurrentPeriod} */
1063
+ static SubscriptionCurrentPeriod() {
1051
1064
  return Joi.object({
1052
- interval: Joi.string().allow(""),
1053
- interval_count: Joi.number(),
1065
+ start: Joi.string().allow(""),
1066
+ end: Joi.string().allow(""),
1054
1067
  });
1055
1068
  }
1056
1069
 
1057
- /** @returns {PlanStatusUpdateReq} */
1058
- static PlanStatusUpdateReq() {
1070
+ /** @returns {SubscriptionPauseCollection} */
1071
+ static SubscriptionPauseCollection() {
1059
1072
  return Joi.object({
1060
- plan_id: Joi.string().allow(""),
1061
- reason: Joi.string().allow(""),
1062
- seller_status: Joi.string().allow(""),
1073
+ behavior: Joi.string().allow(""),
1074
+ resume_at: Joi.string().allow(""),
1063
1075
  });
1064
1076
  }
1065
1077
 
1066
- /** @returns {ResourceNotFound} */
1067
- static ResourceNotFound() {
1078
+ /** @returns {SubscriptionTrial} */
1079
+ static SubscriptionTrial() {
1068
1080
  return Joi.object({
1069
- message: Joi.string().allow(""),
1081
+ start: Joi.string().allow(""),
1082
+ end: Joi.string().allow(""),
1070
1083
  });
1071
1084
  }
1072
1085
 
1073
- /** @returns {SubscribePlanRes} */
1074
- static SubscribePlanRes() {
1086
+ /** @returns {SubscriptionInvoiceSettings} */
1087
+ static SubscriptionInvoiceSettings() {
1075
1088
  return Joi.object({
1076
- current_status: Joi.string().allow(""),
1077
- meta: BillingPlatformModel.Meta(),
1078
- redirect_url: Joi.string().allow(""),
1079
- transaction_id: Joi.string().allow(""),
1089
+ generation: Joi.boolean(),
1090
+ charging: Joi.boolean(),
1080
1091
  });
1081
1092
  }
1082
-
1083
- /** @returns {Subscription} */
1084
- static Subscription() {
1085
- return Joi.object({
1086
- _id: Joi.string().allow(""),
1087
- cancel_at_period_end: Joi.boolean(),
1088
- channel_type: Joi.string().allow(""),
1089
- collection_method: Joi.string().allow(""),
1090
- created_at: Joi.string().allow(""),
1093
+
1094
+ /** @returns {Subscription} */
1095
+ static Subscription() {
1096
+ return Joi.object({
1091
1097
  current_period: BillingPlatformModel.SubscriptionCurrentPeriod(),
1092
- current_status: Joi.string().allow(""),
1098
+ pause_collection: BillingPlatformModel.SubscriptionPauseCollection(),
1099
+ trial: BillingPlatformModel.SubscriptionTrial(),
1093
1100
  invoice_settings: BillingPlatformModel.SubscriptionInvoiceSettings(),
1094
1101
  is_active: Joi.boolean(),
1095
- latest_invoice: Joi.string().allow(""),
1096
- modified_at: Joi.string().allow(""),
1097
- pause_collection: BillingPlatformModel.SubscriptionPauseCollection(),
1098
- plan_data: BillingPlatformModel.Plan(),
1102
+ cancel_at_period_end: Joi.boolean(),
1103
+ _id: Joi.string().allow(""),
1104
+ subscriber_id: Joi.string().allow(""),
1099
1105
  plan_id: Joi.string().allow(""),
1100
1106
  product_suite_id: Joi.string().allow(""),
1101
- subscriber_id: Joi.string().allow(""),
1102
- trial: BillingPlatformModel.SubscriptionTrial(),
1107
+ plan_data: BillingPlatformModel.Plan(),
1108
+ current_status: Joi.string().allow(""),
1109
+ collection_method: Joi.string().allow(""),
1110
+ created_at: Joi.string().allow(""),
1111
+ modified_at: Joi.string().allow(""),
1112
+ latest_invoice: Joi.string().allow(""),
1113
+ channel_type: Joi.string().allow(""),
1103
1114
  });
1104
1115
  }
1105
1116
 
1106
- /** @returns {SubscriptionActivateReq} */
1107
- static SubscriptionActivateReq() {
1117
+ /** @returns {SubscriptionStatus} */
1118
+ static SubscriptionStatus() {
1108
1119
  return Joi.object({
1109
- payment_method: Joi.string().allow(""),
1110
- plan_id: Joi.string().allow(""),
1111
- product_suite: Joi.string().allow(""),
1112
- type: Joi.string().allow(""),
1113
- unique_id: Joi.string().allow(""),
1120
+ is_enabled: Joi.boolean(),
1121
+ subscription: BillingPlatformModel.Subscription(),
1122
+ latest_invoice: BillingPlatformModel.InvoicesData(),
1123
+ next_plan: BillingPlatformModel.Plan(),
1124
+ current_subscriptions: Joi.array().items(
1125
+ BillingPlatformModel.Subscription()
1126
+ ),
1127
+ mandate_amount: Joi.string().allow(""),
1114
1128
  });
1115
1129
  }
1116
1130
 
1117
- /** @returns {SubscriptionActivateRes} */
1118
- static SubscriptionActivateRes() {
1131
+ /** @returns {SubscriptionLimitApplication} */
1132
+ static SubscriptionLimitApplication() {
1119
1133
  return Joi.object({
1120
- data: BillingPlatformModel.Subscription(),
1121
- success: Joi.boolean(),
1134
+ enabled: Joi.boolean(),
1135
+ hard_limit: Joi.number(),
1136
+ soft_limit: Joi.number(),
1122
1137
  });
1123
1138
  }
1124
1139
 
1125
- /** @returns {SubscriptionBillingAddress} */
1126
- static SubscriptionBillingAddress() {
1140
+ /** @returns {SubscriptionLimitMarketplace} */
1141
+ static SubscriptionLimitMarketplace() {
1127
1142
  return Joi.object({
1128
- city: Joi.string().allow(""),
1129
- country: Joi.string().allow(""),
1130
- line1: Joi.string().allow(""),
1131
- line2: Joi.string().allow(""),
1132
- postal_code: Joi.string().allow(""),
1133
- state: Joi.string().allow(""),
1143
+ enabled: Joi.boolean(),
1134
1144
  });
1135
1145
  }
1136
1146
 
1137
- /** @returns {SubscriptionCharge} */
1138
- static SubscriptionCharge() {
1147
+ /** @returns {SubscriptionLimitOtherPlatform} */
1148
+ static SubscriptionLimitOtherPlatform() {
1139
1149
  return Joi.object({
1140
- _id: Joi.string().allow(""),
1141
- activated_on: Joi.string().allow(""),
1142
- billing_date: Joi.string().allow(""),
1143
- cancelled_on: Joi.string().allow(""),
1144
- capped_amount: Joi.number(),
1145
- current_period: BillingPlatformModel.CurrentPeriod(),
1146
- is_test: Joi.boolean(),
1147
- metadata: Joi.any(),
1148
- name: Joi.string().allow(""),
1149
- price: BillingPlatformModel.EntityChargePrice(),
1150
- pricing_type: Joi.string().allow(""),
1151
- recurring: BillingPlatformModel.EntityChargeRecurring(),
1152
- status: Joi.string().allow(""),
1153
- term: Joi.string().allow(""),
1150
+ enabled: Joi.boolean(),
1154
1151
  });
1155
1152
  }
1156
1153
 
1157
- /** @returns {SubscriptionCurrentPeriod} */
1158
- static SubscriptionCurrentPeriod() {
1154
+ /** @returns {SubscriptionLimitTeam} */
1155
+ static SubscriptionLimitTeam() {
1159
1156
  return Joi.object({
1160
- end: Joi.string().allow(""),
1161
- start: Joi.string().allow(""),
1157
+ limit: Joi.number(),
1162
1158
  });
1163
1159
  }
1164
1160
 
1165
- /** @returns {SubscriptionCustomer} */
1166
- static SubscriptionCustomer() {
1161
+ /** @returns {SubscriptionLimitProducts} */
1162
+ static SubscriptionLimitProducts() {
1167
1163
  return Joi.object({
1168
- _id: Joi.string().allow(""),
1169
- billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
1170
- created_at: Joi.string().allow(""),
1171
- data: Joi.any(),
1172
- email: Joi.string().allow(""),
1173
- modified_at: Joi.string().allow(""),
1174
- name: Joi.string().allow(""),
1175
- phone: BillingPlatformModel.Phone(),
1176
- type: Joi.string().allow(""),
1177
- unique_id: Joi.string().allow(""),
1164
+ bulk: Joi.boolean(),
1165
+ limit: Joi.number(),
1178
1166
  });
1179
1167
  }
1180
1168
 
1181
- /** @returns {SubscriptionCustomerCreate} */
1182
- static SubscriptionCustomerCreate() {
1169
+ /** @returns {SubscriptionLimitExtensions} */
1170
+ static SubscriptionLimitExtensions() {
1183
1171
  return Joi.object({
1184
- billing_address: BillingPlatformModel.SubscriptionBillingAddress(),
1185
- email: Joi.string().allow(""),
1186
- name: Joi.string().allow(""),
1187
- phone: BillingPlatformModel.Phone(),
1188
- type: Joi.string().allow(""),
1189
- unique_id: Joi.string().allow(""),
1172
+ enabled: Joi.boolean(),
1173
+ limit: Joi.number(),
1190
1174
  });
1191
1175
  }
1192
1176
 
1193
- /** @returns {SubscriptionInvoiceSettings} */
1194
- static SubscriptionInvoiceSettings() {
1177
+ /** @returns {SubscriptionLimitIntegrations} */
1178
+ static SubscriptionLimitIntegrations() {
1195
1179
  return Joi.object({
1196
- charging: Joi.boolean(),
1197
- generation: Joi.boolean(),
1180
+ enabled: Joi.boolean(),
1181
+ limit: Joi.number(),
1198
1182
  });
1199
1183
  }
1200
1184
 
@@ -1202,116 +1186,132 @@ class BillingPlatformModel {
1202
1186
  static SubscriptionLimit() {
1203
1187
  return Joi.object({
1204
1188
  application: BillingPlatformModel.SubscriptionLimitApplication(),
1205
- extensions: BillingPlatformModel.SubscriptionLimitExtensions(),
1206
- integrations: BillingPlatformModel.SubscriptionLimitIntegrations(),
1207
- is_trial_plan: Joi.boolean(),
1208
1189
  marketplace: BillingPlatformModel.SubscriptionLimitMarketplace(),
1209
1190
  other_platform: BillingPlatformModel.SubscriptionLimitOtherPlatform(),
1210
- products: BillingPlatformModel.SubscriptionLimitProducts(),
1211
1191
  team: BillingPlatformModel.SubscriptionLimitTeam(),
1192
+ products: BillingPlatformModel.SubscriptionLimitProducts(),
1193
+ extensions: BillingPlatformModel.SubscriptionLimitExtensions(),
1194
+ integrations: BillingPlatformModel.SubscriptionLimitIntegrations(),
1195
+ is_trial_plan: Joi.boolean(),
1212
1196
  });
1213
1197
  }
1214
1198
 
1215
- /** @returns {SubscriptionLimitApplication} */
1216
- static SubscriptionLimitApplication() {
1199
+ /** @returns {SubscriptionActivateReq} */
1200
+ static SubscriptionActivateReq() {
1217
1201
  return Joi.object({
1218
- enabled: Joi.boolean(),
1219
- hard_limit: Joi.number(),
1220
- soft_limit: Joi.number(),
1202
+ unique_id: Joi.string().allow(""),
1203
+ type: Joi.string().allow(""),
1204
+ product_suite: Joi.string().allow(""),
1205
+ plan_id: Joi.string().allow(""),
1206
+ payment_method: Joi.string().allow(""),
1221
1207
  });
1222
1208
  }
1223
1209
 
1224
- /** @returns {SubscriptionLimitExtensions} */
1225
- static SubscriptionLimitExtensions() {
1210
+ /** @returns {SubscriptionActivateRes} */
1211
+ static SubscriptionActivateRes() {
1226
1212
  return Joi.object({
1227
- enabled: Joi.boolean(),
1228
- limit: Joi.number(),
1213
+ success: Joi.boolean(),
1214
+ data: BillingPlatformModel.Subscription(),
1229
1215
  });
1230
1216
  }
1231
1217
 
1232
- /** @returns {SubscriptionLimitIntegrations} */
1233
- static SubscriptionLimitIntegrations() {
1218
+ /** @returns {CancelSubscriptionReq} */
1219
+ static CancelSubscriptionReq() {
1234
1220
  return Joi.object({
1235
- enabled: Joi.boolean(),
1236
- limit: Joi.number(),
1221
+ unique_id: Joi.string().allow(""),
1222
+ type: Joi.string().allow(""),
1223
+ product_suite: Joi.string().allow(""),
1224
+ subscription_id: Joi.string().allow(""),
1237
1225
  });
1238
1226
  }
1239
1227
 
1240
- /** @returns {SubscriptionLimitMarketplace} */
1241
- static SubscriptionLimitMarketplace() {
1228
+ /** @returns {CancelSubscriptionRes} */
1229
+ static CancelSubscriptionRes() {
1242
1230
  return Joi.object({
1243
- enabled: Joi.boolean(),
1231
+ success: Joi.boolean(),
1232
+ data: BillingPlatformModel.Subscription(),
1244
1233
  });
1245
1234
  }
1246
1235
 
1247
- /** @returns {SubscriptionLimitOtherPlatform} */
1248
- static SubscriptionLimitOtherPlatform() {
1236
+ /** @returns {PlanStatusUpdateReq} */
1237
+ static PlanStatusUpdateReq() {
1249
1238
  return Joi.object({
1250
- enabled: Joi.boolean(),
1239
+ plan_id: Joi.string().allow(""),
1240
+ reason: Joi.string().allow(""),
1241
+ seller_status: Joi.string().allow(""),
1251
1242
  });
1252
1243
  }
1253
1244
 
1254
- /** @returns {SubscriptionLimitProducts} */
1255
- static SubscriptionLimitProducts() {
1245
+ /** @returns {SunscribePlan} */
1246
+ static SunscribePlan() {
1256
1247
  return Joi.object({
1257
- bulk: Joi.boolean(),
1258
- limit: Joi.number(),
1248
+ entity_type: Joi.string().allow(""),
1249
+ collection_type: Joi.string().allow(""),
1250
+ plan_id: Joi.string().allow(""),
1251
+ callback_url: Joi.string().allow(""),
1252
+ meta: BillingPlatformModel.Meta(),
1259
1253
  });
1260
1254
  }
1261
1255
 
1262
- /** @returns {SubscriptionLimitTeam} */
1263
- static SubscriptionLimitTeam() {
1256
+ /** @returns {Meta} */
1257
+ static Meta() {
1264
1258
  return Joi.object({
1265
- limit: Joi.number(),
1259
+ subscribe: Joi.boolean(),
1260
+ is_custom_plan: Joi.boolean(),
1261
+ is_plan_upgrade: Joi.boolean(),
1266
1262
  });
1267
1263
  }
1268
1264
 
1269
- /** @returns {SubscriptionPauseCollection} */
1270
- static SubscriptionPauseCollection() {
1265
+ /** @returns {SubscribePlanRes} */
1266
+ static SubscribePlanRes() {
1271
1267
  return Joi.object({
1272
- behavior: Joi.string().allow(""),
1273
- resume_at: Joi.string().allow(""),
1268
+ redirect_url: Joi.string().allow(""),
1269
+ transaction_id: Joi.string().allow(""),
1270
+ current_status: Joi.string().allow(""),
1271
+ meta: BillingPlatformModel.Meta(),
1274
1272
  });
1275
1273
  }
1276
1274
 
1277
- /** @returns {SubscriptionStatus} */
1278
- static SubscriptionStatus() {
1275
+ /** @returns {Features} */
1276
+ static Features() {
1279
1277
  return Joi.object({
1280
- current_subscriptions: Joi.array().items(
1281
- BillingPlatformModel.Subscription()
1282
- ),
1283
- is_enabled: Joi.boolean(),
1284
- latest_invoice: BillingPlatformModel.InvoicesData(),
1285
- mandate_amount: Joi.string().allow(""),
1286
- next_plan: BillingPlatformModel.Plan(),
1287
- subscription: BillingPlatformModel.Subscription(),
1278
+ name: Joi.string().allow(""),
1279
+ slug: Joi.string().allow(""),
1280
+ description: Joi.string().allow(""),
1281
+ group: Joi.string().allow(""),
1282
+ enabled: Joi.boolean(),
1283
+ display_text: Joi.string().allow(""),
1288
1284
  });
1289
1285
  }
1290
1286
 
1291
- /** @returns {SubscriptionTrial} */
1292
- static SubscriptionTrial() {
1287
+ /** @returns {FeeComponents} */
1288
+ static FeeComponents() {
1293
1289
  return Joi.object({
1294
- end: Joi.string().allow(""),
1295
- start: Joi.string().allow(""),
1290
+ brand: Joi.array().items(Joi.string().allow("")),
1291
+ location: Joi.array().items(Joi.string().allow("")),
1292
+ channel: Joi.array().items(Joi.any()),
1293
+ business_lead: Joi.string().allow(""),
1294
+ settlement_type: Joi.string().allow(""),
1295
+ settle_cycle_period: Joi.any(),
1296
+ components: Joi.array().items(Joi.any()),
1296
1297
  });
1297
1298
  }
1298
1299
 
1299
- /** @returns {SubscriptionTrialPeriod} */
1300
- static SubscriptionTrialPeriod() {
1300
+ /** @returns {Details} */
1301
+ static Details() {
1301
1302
  return Joi.object({
1302
- end_date: Joi.string().allow(""),
1303
- start_date: Joi.string().allow(""),
1303
+ fee_components: Joi.array().items(BillingPlatformModel.FeeComponents()),
1304
+ features: Joi.array().items(BillingPlatformModel.Features()),
1304
1305
  });
1305
1306
  }
1306
1307
 
1307
- /** @returns {SunscribePlan} */
1308
- static SunscribePlan() {
1308
+ /** @returns {EntityResponse} */
1309
+ static EntityResponse() {
1309
1310
  return Joi.object({
1310
- callback_url: Joi.string().allow(""),
1311
- collection_type: Joi.string().allow(""),
1312
- entity_type: Joi.string().allow(""),
1313
- meta: BillingPlatformModel.Meta(),
1314
- plan_id: Joi.string().allow(""),
1311
+ success: Joi.boolean(),
1312
+ page: Joi.number(),
1313
+ page_size: Joi.number(),
1314
+ items: Joi.array().items(BillingPlatformModel.Details()),
1315
1315
  });
1316
1316
  }
1317
1317
  }