rerobe-js-orm 4.4.7 → 4.4.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constants/merchant-constants.d.ts +41 -0
- package/lib/constants/merchant-constants.js +43 -1
- package/lib/form-states/Merchant/MerchantConfigAutomatedPayoutsFormState.d.ts +10 -0
- package/lib/form-states/Merchant/MerchantConfigAutomatedPayoutsFormState.js +174 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.js +5 -1
- package/lib/models/MerchantConfigAutomatedPayouts.d.ts +13 -0
- package/lib/models/MerchantConfigAutomatedPayouts.js +44 -0
- package/lib/types/merchant-config-types.d.ts +24 -0
- package/lib/types/merchant-config-types.js +1 -0
- package/package.json +1 -1
|
@@ -73,3 +73,44 @@ export namespace SUBSCRIPTION_STATUSES {
|
|
|
73
73
|
let paused: string;
|
|
74
74
|
let special: string;
|
|
75
75
|
}
|
|
76
|
+
export namespace AUTOMATED_PAYOUT_SCHEDULE {
|
|
77
|
+
let daily: string;
|
|
78
|
+
let afterBusinessDays: string;
|
|
79
|
+
}
|
|
80
|
+
export namespace AUTOMATED_PAYOUT_BUSINESS_DAYS {
|
|
81
|
+
let monday: string;
|
|
82
|
+
let tuesday: string;
|
|
83
|
+
let wednesday: string;
|
|
84
|
+
let thursday: string;
|
|
85
|
+
let friday: string;
|
|
86
|
+
}
|
|
87
|
+
export namespace AUTOMATED_PAYOUT_MONTH_DAYS {
|
|
88
|
+
let d1: string;
|
|
89
|
+
let d2: string;
|
|
90
|
+
let d3: string;
|
|
91
|
+
let d4: string;
|
|
92
|
+
let d5: string;
|
|
93
|
+
let d6: string;
|
|
94
|
+
let d7: string;
|
|
95
|
+
let d8: string;
|
|
96
|
+
let d9: string;
|
|
97
|
+
let d10: string;
|
|
98
|
+
let d11: string;
|
|
99
|
+
let d12: string;
|
|
100
|
+
let d13: string;
|
|
101
|
+
let d14: string;
|
|
102
|
+
let d15: string;
|
|
103
|
+
let d16: string;
|
|
104
|
+
let d17: string;
|
|
105
|
+
let d18: string;
|
|
106
|
+
let d19: string;
|
|
107
|
+
let d20: string;
|
|
108
|
+
let d21: string;
|
|
109
|
+
let d22: string;
|
|
110
|
+
let d23: string;
|
|
111
|
+
let d24: string;
|
|
112
|
+
let d25: string;
|
|
113
|
+
let d26: string;
|
|
114
|
+
let d27: string;
|
|
115
|
+
let d28: string;
|
|
116
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SUBSCRIPTION_STATUSES = exports.RIBBN_WEBHOOK_EVENT_DICT = exports.IMPERIAL_WEIGHT_TYPES = exports.METRIC_WEIGHT_TYPES = exports.UNIT_SYSTEM_TYPES = exports.INDUSTRY_TYPES = exports.PAYMENT_TIERS = exports.MERCHANT_TYPES = void 0;
|
|
3
|
+
exports.AUTOMATED_PAYOUT_MONTH_DAYS = exports.AUTOMATED_PAYOUT_BUSINESS_DAYS = exports.AUTOMATED_PAYOUT_SCHEDULE = exports.SUBSCRIPTION_STATUSES = exports.RIBBN_WEBHOOK_EVENT_DICT = exports.IMPERIAL_WEIGHT_TYPES = exports.METRIC_WEIGHT_TYPES = exports.UNIT_SYSTEM_TYPES = exports.INDUSTRY_TYPES = exports.PAYMENT_TIERS = exports.MERCHANT_TYPES = void 0;
|
|
4
4
|
exports.MERCHANT_TYPES = {
|
|
5
5
|
individual: 'INDIVIDUAL',
|
|
6
6
|
business: 'BUSINESS',
|
|
@@ -67,3 +67,45 @@ exports.SUBSCRIPTION_STATUSES = {
|
|
|
67
67
|
paused: 'PAUSED',
|
|
68
68
|
special: 'SPECIAL',
|
|
69
69
|
};
|
|
70
|
+
// Automated Payouts
|
|
71
|
+
exports.AUTOMATED_PAYOUT_SCHEDULE = {
|
|
72
|
+
daily: 'DAILY',
|
|
73
|
+
afterBusinessDays: 'AFTER_BUSINESS_DAYS',
|
|
74
|
+
};
|
|
75
|
+
exports.AUTOMATED_PAYOUT_BUSINESS_DAYS = {
|
|
76
|
+
monday: '1',
|
|
77
|
+
tuesday: '2',
|
|
78
|
+
wednesday: '3',
|
|
79
|
+
thursday: '4',
|
|
80
|
+
friday: '5',
|
|
81
|
+
};
|
|
82
|
+
exports.AUTOMATED_PAYOUT_MONTH_DAYS = {
|
|
83
|
+
d1: '1',
|
|
84
|
+
d2: '2',
|
|
85
|
+
d3: '3',
|
|
86
|
+
d4: '4',
|
|
87
|
+
d5: '5',
|
|
88
|
+
d6: '6',
|
|
89
|
+
d7: '7',
|
|
90
|
+
d8: '8',
|
|
91
|
+
d9: '9',
|
|
92
|
+
d10: '10',
|
|
93
|
+
d11: '11',
|
|
94
|
+
d12: '12',
|
|
95
|
+
d13: '13',
|
|
96
|
+
d14: '14',
|
|
97
|
+
d15: '15',
|
|
98
|
+
d16: '16',
|
|
99
|
+
d17: '17',
|
|
100
|
+
d18: '18',
|
|
101
|
+
d19: '19',
|
|
102
|
+
d20: '20',
|
|
103
|
+
d21: '21',
|
|
104
|
+
d22: '22',
|
|
105
|
+
d23: '23',
|
|
106
|
+
d24: '24',
|
|
107
|
+
d25: '25',
|
|
108
|
+
d26: '26',
|
|
109
|
+
d27: '27',
|
|
110
|
+
d28: '28',
|
|
111
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import FormState from '../FormState';
|
|
2
|
+
export default class MerchantConfigAutomatedPayoutsFormState extends FormState {
|
|
3
|
+
fields: MerchantConfigAutomatedPayoutsFormFields;
|
|
4
|
+
props: MerchantConfigAutomatedPayoutsObj;
|
|
5
|
+
constructor(props?: any);
|
|
6
|
+
createMerchantConfigAutomatedPayoutsObj(): MerchantConfigAutomatedPayoutsObj;
|
|
7
|
+
private fieldFactory;
|
|
8
|
+
private scheduleSelectHandler;
|
|
9
|
+
private enabledSelectHandler;
|
|
10
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const FormState_1 = require("../FormState");
|
|
4
|
+
const MerchantConfigAutomatedPayouts_1 = require("../../models/MerchantConfigAutomatedPayouts");
|
|
5
|
+
const merchant_constants_1 = require("../../constants/merchant-constants");
|
|
6
|
+
const enabledOptions = [
|
|
7
|
+
{ label: 'Yes', value: 'yes' },
|
|
8
|
+
{ label: 'No', value: 'no' },
|
|
9
|
+
];
|
|
10
|
+
const scheduleOptions = [
|
|
11
|
+
{
|
|
12
|
+
label: 'Payout daily',
|
|
13
|
+
value: merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.daily,
|
|
14
|
+
description: 'Payouts will automatically be processed daily.',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
label: 'Payout after X business days',
|
|
18
|
+
value: merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.afterBusinessDays,
|
|
19
|
+
description: 'Enter how many business days Ribbn should wait before processing payouts.',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
// legacy options removed
|
|
23
|
+
class MerchantConfigAutomatedPayoutsFormState extends FormState_1.default {
|
|
24
|
+
constructor(props) {
|
|
25
|
+
super();
|
|
26
|
+
this.props = new MerchantConfigAutomatedPayouts_1.default(props).toObj();
|
|
27
|
+
this.fields.enabled = this.fieldFactory('singleSelect', 'enabled', enabledOptions);
|
|
28
|
+
this.fields.schedule = this.fieldFactory('singleSelect', 'schedule', scheduleOptions);
|
|
29
|
+
// legacy day fields removed
|
|
30
|
+
this.fields.businessDaysAfter = this.fieldFactory('textInput', 'businessDaysAfter');
|
|
31
|
+
this.fields.excludedSellers = this.fieldFactory('multiSelect', 'excludedSellers');
|
|
32
|
+
}
|
|
33
|
+
createMerchantConfigAutomatedPayoutsObj() {
|
|
34
|
+
var _a;
|
|
35
|
+
return Object.assign(Object.assign({}, this.props), { enabled: this.fields.enabled.selectedValue, schedule: this.fields.schedule.selectedValue, businessDaysAfter: this.fields.businessDaysAfter.inputValue
|
|
36
|
+
? Number(this.fields.businessDaysAfter.inputValue)
|
|
37
|
+
: null, excludedSellers: ((_a = this.fields.excludedSellers) === null || _a === void 0 ? void 0 : _a.selectedValues) || [] });
|
|
38
|
+
}
|
|
39
|
+
fieldFactory(fieldType, fieldKey, fieldOptions) {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
const options = fieldOptions || [];
|
|
42
|
+
if (fieldType === 'singleSelect') {
|
|
43
|
+
const selectedValue = (_a = this.props[fieldKey]) !== null && _a !== void 0 ? _a : '';
|
|
44
|
+
let valid = selectedValue !== undefined && selectedValue !== null;
|
|
45
|
+
let hidden = false;
|
|
46
|
+
let onChangeHandler = (val) => this.singleSelectChangeHandler(fieldKey, val);
|
|
47
|
+
// no legacy day fields
|
|
48
|
+
if (fieldKey === 'schedule') {
|
|
49
|
+
onChangeHandler = (val) => this.scheduleSelectHandler(val);
|
|
50
|
+
// Schedule is optional until enabled='yes' and a schedule chosen
|
|
51
|
+
valid =
|
|
52
|
+
selectedValue === '' ||
|
|
53
|
+
selectedValue === merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.daily ||
|
|
54
|
+
selectedValue === merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.afterBusinessDays;
|
|
55
|
+
hidden = this.props.enabled !== 'yes';
|
|
56
|
+
}
|
|
57
|
+
if (fieldKey === 'enabled') {
|
|
58
|
+
onChangeHandler = (val) => this.enabledSelectHandler(val);
|
|
59
|
+
valid = selectedValue === 'yes' || selectedValue === 'no';
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
options,
|
|
63
|
+
hidden,
|
|
64
|
+
selectedValue,
|
|
65
|
+
valid,
|
|
66
|
+
onChangeHandler,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
if (fieldType === 'textInput') {
|
|
70
|
+
const inputValue = (_b = this.props[fieldKey]) !== null && _b !== void 0 ? _b : '';
|
|
71
|
+
let valid = inputValue !== '';
|
|
72
|
+
let hidden = false;
|
|
73
|
+
let onChangeHandler = (val) => this.textInputChangeHandler(fieldKey, String(val));
|
|
74
|
+
if (fieldKey === 'businessDaysAfter') {
|
|
75
|
+
// Only visible if AFTER_BUSINESS_DAYS
|
|
76
|
+
hidden = this.props.schedule !== merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.afterBusinessDays;
|
|
77
|
+
// Required only when AFTER_BUSINESS_DAYS; otherwise treat as valid
|
|
78
|
+
if (!hidden) {
|
|
79
|
+
const num = Number(inputValue);
|
|
80
|
+
valid = !isNaN(num) && num > 0 && Number.isInteger(num);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
valid = true;
|
|
84
|
+
}
|
|
85
|
+
onChangeHandler = (val) => {
|
|
86
|
+
this.fields.businessDaysAfter.inputValue = val;
|
|
87
|
+
const num = Number(val);
|
|
88
|
+
this.fields.businessDaysAfter.valid = !isNaN(num) && num > 0 && Number.isInteger(num);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
inputValue,
|
|
93
|
+
valid,
|
|
94
|
+
hidden,
|
|
95
|
+
onChangeHandler,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
if (fieldType === 'multiSelect') {
|
|
99
|
+
const selectedValues = this.props[fieldKey] || [];
|
|
100
|
+
const valid = true; // optional field
|
|
101
|
+
const hidden = this.props.enabled !== 'yes';
|
|
102
|
+
const onChangeHandler = (val) => this.multiSelectChangeHandler(fieldKey, val);
|
|
103
|
+
return {
|
|
104
|
+
options,
|
|
105
|
+
selectedValues,
|
|
106
|
+
valid,
|
|
107
|
+
hidden,
|
|
108
|
+
onChangeHandler,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
return { valid: false };
|
|
112
|
+
}
|
|
113
|
+
scheduleSelectHandler(value) {
|
|
114
|
+
const selectedValue = value;
|
|
115
|
+
const valid = value === '' ||
|
|
116
|
+
[merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.daily, merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.afterBusinessDays].includes(value);
|
|
117
|
+
this.fields.schedule.selectedValue = selectedValue;
|
|
118
|
+
this.fields.schedule.valid = valid;
|
|
119
|
+
// Toggle visibility based on schedule
|
|
120
|
+
// legacy day fields removed
|
|
121
|
+
if (this.fields.businessDaysAfter) {
|
|
122
|
+
this.fields.businessDaysAfter.hidden = value !== merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.afterBusinessDays;
|
|
123
|
+
if (value === '' || value === merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.daily) {
|
|
124
|
+
this.fields.businessDaysAfter.inputValue = '';
|
|
125
|
+
// Not required when daily; keep valid true to avoid blocking save
|
|
126
|
+
this.fields.businessDaysAfter.valid = true;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (this.fields.excludedSellers) {
|
|
130
|
+
this.fields.excludedSellers.hidden = this.fields.enabled.selectedValue !== 'yes';
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
enabledSelectHandler(value) {
|
|
134
|
+
this.fields.enabled.selectedValue = value;
|
|
135
|
+
this.fields.enabled.valid = value === 'yes' || value === 'no';
|
|
136
|
+
// If 'no', reset and hide other fields
|
|
137
|
+
if (value === 'no') {
|
|
138
|
+
this.fields.schedule.selectedValue = '';
|
|
139
|
+
this.fields.schedule.valid = true;
|
|
140
|
+
this.fields.schedule.hidden = true;
|
|
141
|
+
if (this.fields.businessDaysAfter) {
|
|
142
|
+
this.fields.businessDaysAfter.inputValue = '';
|
|
143
|
+
this.fields.businessDaysAfter.valid = true;
|
|
144
|
+
this.fields.businessDaysAfter.hidden = true;
|
|
145
|
+
}
|
|
146
|
+
if (this.fields.excludedSellers) {
|
|
147
|
+
this.fields.excludedSellers.selectedValues = [];
|
|
148
|
+
this.fields.excludedSellers.hidden = true;
|
|
149
|
+
this.fields.excludedSellers.valid = true;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
this.fields.schedule.hidden = false;
|
|
154
|
+
// If schedule is clean/empty, default it to DAILY
|
|
155
|
+
if (!this.fields.schedule.selectedValue) {
|
|
156
|
+
this.fields.schedule.selectedValue = merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.daily;
|
|
157
|
+
this.fields.schedule.valid = true;
|
|
158
|
+
if (this.fields.businessDaysAfter) {
|
|
159
|
+
this.fields.businessDaysAfter.inputValue = '';
|
|
160
|
+
this.fields.businessDaysAfter.valid = true;
|
|
161
|
+
this.fields.businessDaysAfter.hidden = true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (this.fields.businessDaysAfter) {
|
|
165
|
+
this.fields.businessDaysAfter.hidden =
|
|
166
|
+
this.fields.schedule.selectedValue !== merchant_constants_1.AUTOMATED_PAYOUT_SCHEDULE.afterBusinessDays;
|
|
167
|
+
}
|
|
168
|
+
if (this.fields.excludedSellers) {
|
|
169
|
+
this.fields.excludedSellers.hidden = false;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
exports.default = MerchantConfigAutomatedPayoutsFormState;
|
package/lib/index.d.ts
CHANGED
|
@@ -34,7 +34,9 @@ import PayoutAccount from './models/PayoutAccount';
|
|
|
34
34
|
import PayoutAccountFormState from './form-states/PayoutAccount/PayoutAccountFormState';
|
|
35
35
|
import MerchantFormState from './form-states/Merchant/MerchantFormState';
|
|
36
36
|
import WebhookFormState from './form-states/Merchant/WebhookFormState';
|
|
37
|
+
import MerchantConfigAutomatedPayouts from './models/MerchantConfigAutomatedPayouts';
|
|
38
|
+
import MerchantConfigAutomatedPayoutsFormState from './form-states/Merchant/MerchantConfigAutomatedPayoutsFormState';
|
|
37
39
|
import ReRobeProductHelpers from './helpers/ReRobeProductHelpers';
|
|
38
40
|
import AnalyticsHelpers from './helpers/AnalyticsHelpers';
|
|
39
41
|
import OrderHelpers from './helpers/OrderHelpers';
|
|
40
|
-
export { RibbnFile, ProductFromAlgoliaJSONDoc, ProductFromShopifyWebhookJSONDoc, ProductFromShopifyJSClientJSONDoc, ProductFormStateFactory, ProductCollectionFormStateFactory, ProductCollectionHelpers, SellRequestFormStateFactory, PickUpFormStateFactory, AddressFormStateFactory, UserFormStateFactory, UserFromShopifyWebhookJSONDoc, UserFromAuthTemplateMethod, DraftOrderFromMirakl, DraftOrderFromApp, ChatRoomFromNewUserSignUp, KlarnaSessionFactory, Product, ProductStateManager, Order, OrderFromShopifyWebhook, OrderFromShopifyAdminApi, OrderFromShopifyStorefrontApi, OrderFromApp, OrderFormStateFactory, RefundFormStateFactory, PayoutAccount, PayoutAccountFormState, Merchant, MerchantFormState, MerchantFormStateFactory, ReRobeProductHelpers, User, AnalyticsHelpers, OrderHelpers, WebhookFormState, MerchantWebPage, ShopifyMerchantAccount, CustomerNotification, };
|
|
42
|
+
export { RibbnFile, ProductFromAlgoliaJSONDoc, ProductFromShopifyWebhookJSONDoc, ProductFromShopifyJSClientJSONDoc, ProductFormStateFactory, ProductCollectionFormStateFactory, ProductCollectionHelpers, SellRequestFormStateFactory, PickUpFormStateFactory, AddressFormStateFactory, UserFormStateFactory, UserFromShopifyWebhookJSONDoc, UserFromAuthTemplateMethod, DraftOrderFromMirakl, DraftOrderFromApp, ChatRoomFromNewUserSignUp, KlarnaSessionFactory, Product, ProductStateManager, Order, OrderFromShopifyWebhook, OrderFromShopifyAdminApi, OrderFromShopifyStorefrontApi, OrderFromApp, OrderFormStateFactory, RefundFormStateFactory, PayoutAccount, PayoutAccountFormState, Merchant, MerchantFormState, MerchantFormStateFactory, MerchantConfigAutomatedPayouts, MerchantConfigAutomatedPayoutsFormState, ReRobeProductHelpers, User, AnalyticsHelpers, OrderHelpers, WebhookFormState, MerchantWebPage, ShopifyMerchantAccount, CustomerNotification, };
|
package/lib/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomerNotification = exports.ShopifyMerchantAccount = exports.MerchantWebPage = exports.WebhookFormState = exports.OrderHelpers = exports.AnalyticsHelpers = exports.User = exports.ReRobeProductHelpers = exports.MerchantFormStateFactory = exports.MerchantFormState = exports.Merchant = exports.PayoutAccountFormState = exports.PayoutAccount = exports.RefundFormStateFactory = exports.OrderFormStateFactory = exports.OrderFromApp = exports.OrderFromShopifyStorefrontApi = exports.OrderFromShopifyAdminApi = exports.OrderFromShopifyWebhook = exports.Order = exports.ProductStateManager = exports.Product = exports.KlarnaSessionFactory = exports.ChatRoomFromNewUserSignUp = exports.DraftOrderFromApp = exports.DraftOrderFromMirakl = exports.UserFromAuthTemplateMethod = exports.UserFromShopifyWebhookJSONDoc = exports.UserFormStateFactory = exports.AddressFormStateFactory = exports.PickUpFormStateFactory = exports.SellRequestFormStateFactory = exports.ProductCollectionHelpers = exports.ProductCollectionFormStateFactory = exports.ProductFormStateFactory = exports.ProductFromShopifyJSClientJSONDoc = exports.ProductFromShopifyWebhookJSONDoc = exports.ProductFromAlgoliaJSONDoc = exports.RibbnFile = void 0;
|
|
3
|
+
exports.CustomerNotification = exports.ShopifyMerchantAccount = exports.MerchantWebPage = exports.WebhookFormState = exports.OrderHelpers = exports.AnalyticsHelpers = exports.User = exports.ReRobeProductHelpers = exports.MerchantConfigAutomatedPayoutsFormState = exports.MerchantConfigAutomatedPayouts = exports.MerchantFormStateFactory = exports.MerchantFormState = exports.Merchant = exports.PayoutAccountFormState = exports.PayoutAccount = exports.RefundFormStateFactory = exports.OrderFormStateFactory = exports.OrderFromApp = exports.OrderFromShopifyStorefrontApi = exports.OrderFromShopifyAdminApi = exports.OrderFromShopifyWebhook = exports.Order = exports.ProductStateManager = exports.Product = exports.KlarnaSessionFactory = exports.ChatRoomFromNewUserSignUp = exports.DraftOrderFromApp = exports.DraftOrderFromMirakl = exports.UserFromAuthTemplateMethod = exports.UserFromShopifyWebhookJSONDoc = exports.UserFormStateFactory = exports.AddressFormStateFactory = exports.PickUpFormStateFactory = exports.SellRequestFormStateFactory = exports.ProductCollectionHelpers = exports.ProductCollectionFormStateFactory = exports.ProductFormStateFactory = exports.ProductFromShopifyJSClientJSONDoc = exports.ProductFromShopifyWebhookJSONDoc = exports.ProductFromAlgoliaJSONDoc = exports.RibbnFile = void 0;
|
|
4
4
|
const ProductFromShopifyJSClientJSONDoc_1 = require("./factories/Product/ProductFromShopifyJSClientJSONDoc");
|
|
5
5
|
exports.ProductFromShopifyJSClientJSONDoc = ProductFromShopifyJSClientJSONDoc_1.default;
|
|
6
6
|
const ProductFromAlgoliaJSONDoc_1 = require("./factories/Product/ProductFromAlgoliaJSONDoc");
|
|
@@ -73,6 +73,10 @@ const MerchantFormState_1 = require("./form-states/Merchant/MerchantFormState");
|
|
|
73
73
|
exports.MerchantFormState = MerchantFormState_1.default;
|
|
74
74
|
const WebhookFormState_1 = require("./form-states/Merchant/WebhookFormState");
|
|
75
75
|
exports.WebhookFormState = WebhookFormState_1.default;
|
|
76
|
+
const MerchantConfigAutomatedPayouts_1 = require("./models/MerchantConfigAutomatedPayouts");
|
|
77
|
+
exports.MerchantConfigAutomatedPayouts = MerchantConfigAutomatedPayouts_1.default;
|
|
78
|
+
const MerchantConfigAutomatedPayoutsFormState_1 = require("./form-states/Merchant/MerchantConfigAutomatedPayoutsFormState");
|
|
79
|
+
exports.MerchantConfigAutomatedPayoutsFormState = MerchantConfigAutomatedPayoutsFormState_1.default;
|
|
76
80
|
const ReRobeProductHelpers_1 = require("./helpers/ReRobeProductHelpers");
|
|
77
81
|
exports.ReRobeProductHelpers = ReRobeProductHelpers_1.default;
|
|
78
82
|
const AnalyticsHelpers_1 = require("./helpers/AnalyticsHelpers");
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Base from '../Base';
|
|
2
|
+
export default class MerchantConfigAutomatedPayouts extends Base {
|
|
3
|
+
enabled: EnabledChoice;
|
|
4
|
+
schedule: AutomatedPayoutSchedule | '';
|
|
5
|
+
businessDaysAfter?: number | null;
|
|
6
|
+
excludedSellers?: ExcludedSeller[];
|
|
7
|
+
createdAt?: string;
|
|
8
|
+
updatedAt?: string;
|
|
9
|
+
createdAtTimestamp?: number | null;
|
|
10
|
+
updatedAtTimestamp?: number | null;
|
|
11
|
+
constructor(props?: any);
|
|
12
|
+
toObj(): MerchantConfigAutomatedPayoutsObj;
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const Base_1 = require("../Base");
|
|
4
|
+
class MerchantConfigAutomatedPayouts extends Base_1.default {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super();
|
|
7
|
+
this.enabled = (props === null || props === void 0 ? void 0 : props.enabled) || 'no';
|
|
8
|
+
this.schedule = (props === null || props === void 0 ? void 0 : props.schedule) || '';
|
|
9
|
+
this.businessDaysAfter = (props === null || props === void 0 ? void 0 : props.businessDaysAfter) != null ? Number(props === null || props === void 0 ? void 0 : props.businessDaysAfter) : null;
|
|
10
|
+
this.excludedSellers = Array.isArray(props === null || props === void 0 ? void 0 : props.excludedSellers)
|
|
11
|
+
? props.excludedSellers.map((s) => ({
|
|
12
|
+
vendorId: String((s === null || s === void 0 ? void 0 : s.vendorId) || ''),
|
|
13
|
+
firstName: (s === null || s === void 0 ? void 0 : s.firstName) || (s === null || s === void 0 ? void 0 : s.sellerFirstName) || undefined,
|
|
14
|
+
lastName: (s === null || s === void 0 ? void 0 : s.lastName) || (s === null || s === void 0 ? void 0 : s.sellerLastName) || undefined,
|
|
15
|
+
email: (s === null || s === void 0 ? void 0 : s.email) || (s === null || s === void 0 ? void 0 : s.sellerEmail) || undefined,
|
|
16
|
+
}))
|
|
17
|
+
: [];
|
|
18
|
+
this.createdAt = (props === null || props === void 0 ? void 0 : props.createdAt) || '';
|
|
19
|
+
this.updatedAt = (props === null || props === void 0 ? void 0 : props.updatedAt) || '';
|
|
20
|
+
this.createdAtTimestamp = (props === null || props === void 0 ? void 0 : props.createdAtTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.createdAtTimestamp) : null;
|
|
21
|
+
this.updatedAtTimestamp = (props === null || props === void 0 ? void 0 : props.updatedAtTimestamp) ? Number(props === null || props === void 0 ? void 0 : props.updatedAtTimestamp) : null;
|
|
22
|
+
}
|
|
23
|
+
toObj() {
|
|
24
|
+
var _a, _b;
|
|
25
|
+
return {
|
|
26
|
+
enabled: this.enabled,
|
|
27
|
+
schedule: this.schedule,
|
|
28
|
+
businessDaysAfter: this.businessDaysAfter != null ? Number(this.businessDaysAfter) : null,
|
|
29
|
+
excludedSellers: Array.isArray(this.excludedSellers)
|
|
30
|
+
? this.excludedSellers.map((s) => ({
|
|
31
|
+
vendorId: s.vendorId,
|
|
32
|
+
firstName: s.firstName,
|
|
33
|
+
lastName: s.lastName,
|
|
34
|
+
email: s.email,
|
|
35
|
+
}))
|
|
36
|
+
: [],
|
|
37
|
+
createdAt: this.createdAt,
|
|
38
|
+
updatedAt: this.updatedAt,
|
|
39
|
+
createdAtTimestamp: (_a = this.createdAtTimestamp) !== null && _a !== void 0 ? _a : null,
|
|
40
|
+
updatedAtTimestamp: (_b = this.updatedAtTimestamp) !== null && _b !== void 0 ? _b : null,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = MerchantConfigAutomatedPayouts;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type AutomatedPayoutSchedule = 'DAILY' | 'AFTER_BUSINESS_DAYS';
|
|
2
|
+
type EnabledChoice = 'yes' | 'no';
|
|
3
|
+
type ExcludedSeller = {
|
|
4
|
+
vendorId: string;
|
|
5
|
+
firstName?: string;
|
|
6
|
+
lastName?: string;
|
|
7
|
+
email?: string;
|
|
8
|
+
};
|
|
9
|
+
type MerchantConfigAutomatedPayoutsObj = {
|
|
10
|
+
enabled: EnabledChoice;
|
|
11
|
+
schedule: AutomatedPayoutSchedule | '';
|
|
12
|
+
businessDaysAfter?: number | null;
|
|
13
|
+
excludedSellers?: ExcludedSeller[];
|
|
14
|
+
createdAt?: string;
|
|
15
|
+
updatedAt?: string;
|
|
16
|
+
createdAtTimestamp?: number | null;
|
|
17
|
+
updatedAtTimestamp?: number | null;
|
|
18
|
+
};
|
|
19
|
+
type MerchantConfigAutomatedPayoutsFormFields = {
|
|
20
|
+
enabled: SingleSelectFormField<EnabledChoice>;
|
|
21
|
+
schedule: SingleSelectFormField<AutomatedPayoutSchedule | ''>;
|
|
22
|
+
businessDaysAfter: TextInputFormField<string>;
|
|
23
|
+
excludedSellers: MultiSelectFormField<ExcludedSeller>;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|