rerobe-js-orm 4.8.5 → 4.8.7
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 +23 -0
- package/lib/constants/merchant-constants.js +32 -1
- package/lib/helpers/ReRobeProductHelpers.js +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +7 -1
- package/lib/models/Merchant.d.ts +30 -0
- package/lib/models/Merchant.js +52 -0
- package/lib/models/Product.js +2 -2
- package/lib/types/merchant-types.d.ts +14 -0
- package/package.json +1 -1
|
@@ -3,6 +3,28 @@ export namespace MERCHANT_TYPES {
|
|
|
3
3
|
let business: string;
|
|
4
4
|
let enterprise: string;
|
|
5
5
|
}
|
|
6
|
+
export namespace MERCHANT_ACCOUNT_MODES {
|
|
7
|
+
let standalone: string;
|
|
8
|
+
let managed: string;
|
|
9
|
+
}
|
|
10
|
+
export namespace MERCHANT_ACCOUNT_CLASSES {
|
|
11
|
+
let standard: string;
|
|
12
|
+
let marketplaceSeller: string;
|
|
13
|
+
}
|
|
14
|
+
export namespace MERCHANT_RELATIONSHIP_TYPES {
|
|
15
|
+
let marketplaceSeller_1: string;
|
|
16
|
+
export { marketplaceSeller_1 as marketplaceSeller };
|
|
17
|
+
}
|
|
18
|
+
export namespace MARKETPLACE_SELLER_CAPABILITIES {
|
|
19
|
+
let accessAdminDashboard: string;
|
|
20
|
+
let manageOwnProducts: string;
|
|
21
|
+
let viewOwnOrders: string;
|
|
22
|
+
let viewOwnTransactions: string;
|
|
23
|
+
let manageBusinessProfile: string;
|
|
24
|
+
let manageOwnPayouts: string;
|
|
25
|
+
let upgradeToStandalone: string;
|
|
26
|
+
}
|
|
27
|
+
export const DEFAULT_MARKETPLACE_SELLER_CAPABILITIES: string[];
|
|
6
28
|
export namespace PAYMENT_TIERS {
|
|
7
29
|
export namespace starter {
|
|
8
30
|
let id: string;
|
|
@@ -40,6 +62,7 @@ export namespace INDUSTRY_TYPES {
|
|
|
40
62
|
let furniture: string;
|
|
41
63
|
let handcrafts: string;
|
|
42
64
|
let jewelry: string;
|
|
65
|
+
let services: string;
|
|
43
66
|
let sports: string;
|
|
44
67
|
let toys: string;
|
|
45
68
|
let other: string;
|
|
@@ -1,11 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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_TYPE_OPTIONS = 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_TYPE_OPTIONS = exports.INDUSTRY_TYPES = exports.PAYMENT_TIERS = exports.DEFAULT_MARKETPLACE_SELLER_CAPABILITIES = exports.MARKETPLACE_SELLER_CAPABILITIES = exports.MERCHANT_RELATIONSHIP_TYPES = exports.MERCHANT_ACCOUNT_CLASSES = exports.MERCHANT_ACCOUNT_MODES = exports.MERCHANT_TYPES = void 0;
|
|
4
4
|
exports.MERCHANT_TYPES = {
|
|
5
5
|
individual: 'INDIVIDUAL',
|
|
6
6
|
business: 'BUSINESS',
|
|
7
7
|
enterprise: 'ENTERPRISE',
|
|
8
8
|
};
|
|
9
|
+
exports.MERCHANT_ACCOUNT_MODES = {
|
|
10
|
+
standalone: 'STANDALONE',
|
|
11
|
+
managed: 'MANAGED',
|
|
12
|
+
};
|
|
13
|
+
exports.MERCHANT_ACCOUNT_CLASSES = {
|
|
14
|
+
standard: 'STANDARD',
|
|
15
|
+
marketplaceSeller: 'MARKETPLACE_SELLER',
|
|
16
|
+
};
|
|
17
|
+
exports.MERCHANT_RELATIONSHIP_TYPES = {
|
|
18
|
+
marketplaceSeller: 'MARKETPLACE_SELLER',
|
|
19
|
+
};
|
|
20
|
+
exports.MARKETPLACE_SELLER_CAPABILITIES = {
|
|
21
|
+
accessAdminDashboard: 'ACCESS_ADMIN_DASHBOARD',
|
|
22
|
+
manageOwnProducts: 'MANAGE_OWN_PRODUCTS',
|
|
23
|
+
viewOwnOrders: 'VIEW_OWN_ORDERS',
|
|
24
|
+
viewOwnTransactions: 'VIEW_OWN_TRANSACTIONS',
|
|
25
|
+
manageBusinessProfile: 'MANAGE_BUSINESS_PROFILE',
|
|
26
|
+
manageOwnPayouts: 'MANAGE_OWN_PAYOUTS',
|
|
27
|
+
upgradeToStandalone: 'UPGRADE_TO_STANDALONE',
|
|
28
|
+
};
|
|
29
|
+
exports.DEFAULT_MARKETPLACE_SELLER_CAPABILITIES = [
|
|
30
|
+
exports.MARKETPLACE_SELLER_CAPABILITIES.accessAdminDashboard,
|
|
31
|
+
exports.MARKETPLACE_SELLER_CAPABILITIES.manageOwnProducts,
|
|
32
|
+
exports.MARKETPLACE_SELLER_CAPABILITIES.viewOwnOrders,
|
|
33
|
+
exports.MARKETPLACE_SELLER_CAPABILITIES.viewOwnTransactions,
|
|
34
|
+
exports.MARKETPLACE_SELLER_CAPABILITIES.manageBusinessProfile,
|
|
35
|
+
exports.MARKETPLACE_SELLER_CAPABILITIES.manageOwnPayouts,
|
|
36
|
+
exports.MARKETPLACE_SELLER_CAPABILITIES.upgradeToStandalone,
|
|
37
|
+
];
|
|
9
38
|
exports.PAYMENT_TIERS = {
|
|
10
39
|
starter: {
|
|
11
40
|
id: 'STARTER',
|
|
@@ -33,6 +62,7 @@ exports.INDUSTRY_TYPES = {
|
|
|
33
62
|
furniture: 'FURNITURE',
|
|
34
63
|
handcrafts: 'HANDCRAFTS',
|
|
35
64
|
jewelry: 'JEWELRY',
|
|
65
|
+
services: 'SERVICES',
|
|
36
66
|
sports: 'SPORTS',
|
|
37
67
|
toys: 'TOYS',
|
|
38
68
|
other: 'OTHER',
|
|
@@ -44,6 +74,7 @@ exports.INDUSTRY_TYPE_OPTIONS = [
|
|
|
44
74
|
{ label: 'Furniture & Home', value: exports.INDUSTRY_TYPES.furniture },
|
|
45
75
|
{ label: 'Handcrafts & Artisan', value: exports.INDUSTRY_TYPES.handcrafts },
|
|
46
76
|
{ label: 'Jewelry & Watches', value: exports.INDUSTRY_TYPES.jewelry },
|
|
77
|
+
{ label: 'Services & Repairs', value: exports.INDUSTRY_TYPES.services },
|
|
47
78
|
{ label: 'Sports & Outdoors', value: exports.INDUSTRY_TYPES.sports },
|
|
48
79
|
{ label: 'Toys & Games', value: exports.INDUSTRY_TYPES.toys },
|
|
49
80
|
{ label: 'Other', value: exports.INDUSTRY_TYPES.other },
|
|
@@ -196,7 +196,7 @@ class ReRobeProductHelpers {
|
|
|
196
196
|
return descriptionArr.filter((d) => d);
|
|
197
197
|
}
|
|
198
198
|
static autoCreateFullDescriptionHTML(productObj, customHeading) {
|
|
199
|
-
const productStyle = productObj.productStyle.join(', ');
|
|
199
|
+
const productStyle = (productObj.productStyle || []).join(', ');
|
|
200
200
|
const size = this.getSizeLabel(productObj.clothingSize, productObj.shoeSize, productObj.jeanSize);
|
|
201
201
|
const sizeComment = productObj.sizeComment;
|
|
202
202
|
const color = productObj.color;
|
package/lib/index.d.ts
CHANGED
|
@@ -40,4 +40,5 @@ import MerchantConfigAutomatedPayoutsFormState from './form-states/Merchant/Merc
|
|
|
40
40
|
import ReRobeProductHelpers from './helpers/ReRobeProductHelpers';
|
|
41
41
|
import AnalyticsHelpers from './helpers/AnalyticsHelpers';
|
|
42
42
|
import OrderHelpers from './helpers/OrderHelpers';
|
|
43
|
-
|
|
43
|
+
import { DEFAULT_MARKETPLACE_SELLER_CAPABILITIES, MARKETPLACE_SELLER_CAPABILITIES, MERCHANT_ACCOUNT_CLASSES, MERCHANT_ACCOUNT_MODES, MERCHANT_RELATIONSHIP_TYPES } from './constants/merchant-constants';
|
|
44
|
+
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, OrderFromTraderaEmail, OrderFormStateFactory, RefundFormStateFactory, PayoutAccount, PayoutAccountFormState, Merchant, MERCHANT_ACCOUNT_MODES, MERCHANT_ACCOUNT_CLASSES, MERCHANT_RELATIONSHIP_TYPES, MARKETPLACE_SELLER_CAPABILITIES, DEFAULT_MARKETPLACE_SELLER_CAPABILITIES, 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.MerchantConfigAutomatedPayoutsFormState = exports.MerchantConfigAutomatedPayouts = exports.MerchantFormStateFactory = exports.MerchantFormState = exports.Merchant = exports.PayoutAccountFormState = exports.PayoutAccount = exports.RefundFormStateFactory = exports.OrderFormStateFactory = exports.OrderFromTraderaEmail = 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.DEFAULT_MARKETPLACE_SELLER_CAPABILITIES = exports.MARKETPLACE_SELLER_CAPABILITIES = exports.MERCHANT_RELATIONSHIP_TYPES = exports.MERCHANT_ACCOUNT_CLASSES = exports.MERCHANT_ACCOUNT_MODES = exports.Merchant = exports.PayoutAccountFormState = exports.PayoutAccount = exports.RefundFormStateFactory = exports.OrderFormStateFactory = exports.OrderFromTraderaEmail = 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");
|
|
@@ -85,3 +85,9 @@ const AnalyticsHelpers_1 = require("./helpers/AnalyticsHelpers");
|
|
|
85
85
|
exports.AnalyticsHelpers = AnalyticsHelpers_1.default;
|
|
86
86
|
const OrderHelpers_1 = require("./helpers/OrderHelpers");
|
|
87
87
|
exports.OrderHelpers = OrderHelpers_1.default;
|
|
88
|
+
const merchant_constants_1 = require("./constants/merchant-constants");
|
|
89
|
+
Object.defineProperty(exports, "DEFAULT_MARKETPLACE_SELLER_CAPABILITIES", { enumerable: true, get: function () { return merchant_constants_1.DEFAULT_MARKETPLACE_SELLER_CAPABILITIES; } });
|
|
90
|
+
Object.defineProperty(exports, "MARKETPLACE_SELLER_CAPABILITIES", { enumerable: true, get: function () { return merchant_constants_1.MARKETPLACE_SELLER_CAPABILITIES; } });
|
|
91
|
+
Object.defineProperty(exports, "MERCHANT_ACCOUNT_CLASSES", { enumerable: true, get: function () { return merchant_constants_1.MERCHANT_ACCOUNT_CLASSES; } });
|
|
92
|
+
Object.defineProperty(exports, "MERCHANT_ACCOUNT_MODES", { enumerable: true, get: function () { return merchant_constants_1.MERCHANT_ACCOUNT_MODES; } });
|
|
93
|
+
Object.defineProperty(exports, "MERCHANT_RELATIONSHIP_TYPES", { enumerable: true, get: function () { return merchant_constants_1.MERCHANT_RELATIONSHIP_TYPES; } });
|
package/lib/models/Merchant.d.ts
CHANGED
|
@@ -25,6 +25,27 @@ export default class Merchant extends Base {
|
|
|
25
25
|
currency: string;
|
|
26
26
|
};
|
|
27
27
|
};
|
|
28
|
+
static MERCHANT_ACCOUNT_MODES: {
|
|
29
|
+
standalone: string;
|
|
30
|
+
managed: string;
|
|
31
|
+
};
|
|
32
|
+
static MERCHANT_ACCOUNT_CLASSES: {
|
|
33
|
+
standard: string;
|
|
34
|
+
marketplaceSeller: string;
|
|
35
|
+
};
|
|
36
|
+
static MERCHANT_RELATIONSHIP_TYPES: {
|
|
37
|
+
marketplaceSeller: string;
|
|
38
|
+
};
|
|
39
|
+
static MARKETPLACE_SELLER_CAPABILITIES: {
|
|
40
|
+
accessAdminDashboard: string;
|
|
41
|
+
manageOwnProducts: string;
|
|
42
|
+
viewOwnOrders: string;
|
|
43
|
+
viewOwnTransactions: string;
|
|
44
|
+
manageBusinessProfile: string;
|
|
45
|
+
manageOwnPayouts: string;
|
|
46
|
+
upgradeToStandalone: string;
|
|
47
|
+
};
|
|
48
|
+
static DEFAULT_MARKETPLACE_SELLER_CAPABILITIES: string[];
|
|
28
49
|
static INDUSTRY_TYPES: {
|
|
29
50
|
beauty: string;
|
|
30
51
|
clothing: string;
|
|
@@ -32,6 +53,7 @@ export default class Merchant extends Base {
|
|
|
32
53
|
furniture: string;
|
|
33
54
|
handcrafts: string;
|
|
34
55
|
jewelry: string;
|
|
56
|
+
services: string;
|
|
35
57
|
sports: string;
|
|
36
58
|
toys: string;
|
|
37
59
|
other: string;
|
|
@@ -94,7 +116,15 @@ export default class Merchant extends Base {
|
|
|
94
116
|
stripeSubscription?: StripeSubscription;
|
|
95
117
|
subscriptionStatus?: string;
|
|
96
118
|
channelPartners?: string[];
|
|
119
|
+
accountMode?: MerchantAccountMode | string;
|
|
120
|
+
accountClass?: MerchantAccountClass | string;
|
|
121
|
+
sellerBusinessType?: string;
|
|
122
|
+
managedByMerchantId?: string;
|
|
123
|
+
canUpgradeToStandalone?: boolean;
|
|
124
|
+
featureAccess?: MerchantFeatureAccess | null;
|
|
125
|
+
isMarketplaceSeller?: boolean;
|
|
97
126
|
constructor(props?: any);
|
|
98
127
|
toObj(): MerchantObj;
|
|
99
128
|
toMerchantMutableData(): MerchantMutableData;
|
|
129
|
+
isManagedMarketplaceMerchant(): boolean;
|
|
100
130
|
}
|
package/lib/models/Merchant.js
CHANGED
|
@@ -55,9 +55,20 @@ class Merchant extends Base_1.default {
|
|
|
55
55
|
this.returnPolicy = (props === null || props === void 0 ? void 0 : props.returnPolicy) || '';
|
|
56
56
|
this.subscriptionStatus = (props === null || props === void 0 ? void 0 : props.subscriptionStatus) || merchant_constants_1.SUBSCRIPTION_STATUSES.trialing;
|
|
57
57
|
this.hasActiveWebshop = (props === null || props === void 0 ? void 0 : props.hasActiveWebshop) || false;
|
|
58
|
+
this.accountMode = (props === null || props === void 0 ? void 0 : props.accountMode) || Merchant.MERCHANT_ACCOUNT_MODES.standalone;
|
|
59
|
+
this.accountClass = (props === null || props === void 0 ? void 0 : props.accountClass) || Merchant.MERCHANT_ACCOUNT_CLASSES.standard;
|
|
60
|
+
this.sellerBusinessType = (props === null || props === void 0 ? void 0 : props.sellerBusinessType) || '';
|
|
61
|
+
this.managedByMerchantId = (props === null || props === void 0 ? void 0 : props.managedByMerchantId) || '';
|
|
62
|
+
if (typeof (props === null || props === void 0 ? void 0 : props.canUpgradeToStandalone) === 'boolean') {
|
|
63
|
+
this.canUpgradeToStandalone = props.canUpgradeToStandalone;
|
|
64
|
+
}
|
|
65
|
+
this.featureAccess = (props === null || props === void 0 ? void 0 : props.featureAccess) || null;
|
|
58
66
|
if ((props === null || props === void 0 ? void 0 : props.channelPartners) && Array.isArray(props.channelPartners)) {
|
|
59
67
|
this.channelPartners = props.channelPartners;
|
|
60
68
|
}
|
|
69
|
+
if (typeof (props === null || props === void 0 ? void 0 : props.isMarketplaceSeller) === 'boolean') {
|
|
70
|
+
this.isMarketplaceSeller = props.isMarketplaceSeller;
|
|
71
|
+
}
|
|
61
72
|
if (props === null || props === void 0 ? void 0 : props.isChannelPartner) {
|
|
62
73
|
this.isChannelPartner = props.isChannelPartner;
|
|
63
74
|
}
|
|
@@ -113,10 +124,27 @@ class Merchant extends Base_1.default {
|
|
|
113
124
|
returnPolicy: this.returnPolicy,
|
|
114
125
|
subscriptionStatus: this.subscriptionStatus,
|
|
115
126
|
hasActiveWebshop: this.hasActiveWebshop,
|
|
127
|
+
accountMode: this.accountMode,
|
|
128
|
+
accountClass: this.accountClass,
|
|
116
129
|
};
|
|
130
|
+
if (this.sellerBusinessType) {
|
|
131
|
+
mObj.sellerBusinessType = this.sellerBusinessType;
|
|
132
|
+
}
|
|
133
|
+
if (this.managedByMerchantId) {
|
|
134
|
+
mObj.managedByMerchantId = this.managedByMerchantId;
|
|
135
|
+
}
|
|
136
|
+
if (typeof this.canUpgradeToStandalone === 'boolean') {
|
|
137
|
+
mObj.canUpgradeToStandalone = this.canUpgradeToStandalone;
|
|
138
|
+
}
|
|
139
|
+
if (this.featureAccess) {
|
|
140
|
+
mObj.featureAccess = this.featureAccess;
|
|
141
|
+
}
|
|
117
142
|
if (this.channelPartners && Array.isArray(this.channelPartners)) {
|
|
118
143
|
mObj.channelPartners = this.channelPartners;
|
|
119
144
|
}
|
|
145
|
+
if (typeof this.isMarketplaceSeller === 'boolean') {
|
|
146
|
+
mObj.isMarketplaceSeller = this.isMarketplaceSeller;
|
|
147
|
+
}
|
|
120
148
|
if (this.isChannelPartner) {
|
|
121
149
|
mObj.isChannelPartner = this.isChannelPartner;
|
|
122
150
|
}
|
|
@@ -161,15 +189,39 @@ class Merchant extends Base_1.default {
|
|
|
161
189
|
primaryDomain: this.primaryDomain,
|
|
162
190
|
webhooks: this.webhooks,
|
|
163
191
|
socialLinks: this.socialLinks,
|
|
192
|
+
accountMode: this.accountMode,
|
|
193
|
+
accountClass: this.accountClass,
|
|
164
194
|
};
|
|
195
|
+
if (this.sellerBusinessType) {
|
|
196
|
+
data.sellerBusinessType = this.sellerBusinessType;
|
|
197
|
+
}
|
|
198
|
+
if (this.managedByMerchantId) {
|
|
199
|
+
data.managedByMerchantId = this.managedByMerchantId;
|
|
200
|
+
}
|
|
201
|
+
if (typeof this.canUpgradeToStandalone === 'boolean') {
|
|
202
|
+
data.canUpgradeToStandalone = this.canUpgradeToStandalone;
|
|
203
|
+
}
|
|
204
|
+
if (this.featureAccess) {
|
|
205
|
+
data.featureAccess = this.featureAccess;
|
|
206
|
+
}
|
|
165
207
|
if (this.organizationNumbers && Object.keys(this.organizationNumbers).length > 0) {
|
|
166
208
|
data.organizationNumbers = this.organizationNumbers;
|
|
167
209
|
}
|
|
168
210
|
return data;
|
|
169
211
|
}
|
|
212
|
+
isManagedMarketplaceMerchant() {
|
|
213
|
+
return (this.accountMode === Merchant.MERCHANT_ACCOUNT_MODES.managed ||
|
|
214
|
+
this.accountClass === Merchant.MERCHANT_ACCOUNT_CLASSES.marketplaceSeller ||
|
|
215
|
+
this.isMarketplaceSeller === true);
|
|
216
|
+
}
|
|
170
217
|
}
|
|
171
218
|
Merchant.MERCHANT_TYPES = merchant_constants_1.MERCHANT_TYPES;
|
|
172
219
|
Merchant.PAYMENT_TIERS = merchant_constants_1.PAYMENT_TIERS;
|
|
220
|
+
Merchant.MERCHANT_ACCOUNT_MODES = merchant_constants_1.MERCHANT_ACCOUNT_MODES;
|
|
221
|
+
Merchant.MERCHANT_ACCOUNT_CLASSES = merchant_constants_1.MERCHANT_ACCOUNT_CLASSES;
|
|
222
|
+
Merchant.MERCHANT_RELATIONSHIP_TYPES = merchant_constants_1.MERCHANT_RELATIONSHIP_TYPES;
|
|
223
|
+
Merchant.MARKETPLACE_SELLER_CAPABILITIES = merchant_constants_1.MARKETPLACE_SELLER_CAPABILITIES;
|
|
224
|
+
Merchant.DEFAULT_MARKETPLACE_SELLER_CAPABILITIES = merchant_constants_1.DEFAULT_MARKETPLACE_SELLER_CAPABILITIES;
|
|
173
225
|
Merchant.INDUSTRY_TYPES = merchant_constants_1.INDUSTRY_TYPES;
|
|
174
226
|
Merchant.UNIT_SYSTEM_TYPES = merchant_constants_1.UNIT_SYSTEM_TYPES;
|
|
175
227
|
Merchant.METRIC_WEIGHT_TYPES = merchant_constants_1.METRIC_WEIGHT_TYPES;
|
package/lib/models/Product.js
CHANGED
|
@@ -218,7 +218,7 @@ class Product extends Base_1.default {
|
|
|
218
218
|
: null,
|
|
219
219
|
]
|
|
220
220
|
.concat(this.filterAttributes.clothingSize.map((s) => `clothingsize_attribute:${s}`))
|
|
221
|
-
.concat(this.filterAttributes.productStyle.map((s) => `productstyle_attribute:${s}`))
|
|
221
|
+
.concat((this.filterAttributes.productStyle || []).map((s) => `productstyle_attribute:${s}`))
|
|
222
222
|
.concat(this.materialCompTagsArrayForShopify().map((mc) => `materialcomposition_attribute:${mc}`))
|
|
223
223
|
.concat(this.consignmentAttributes.salesChannel.map((s) => `salesChannel:${s}`))
|
|
224
224
|
.filter((t) => t),
|
|
@@ -495,7 +495,7 @@ class Product extends Base_1.default {
|
|
|
495
495
|
gender: this.filterAttributes.gender || this.FIELD_NOT_TRANSLATABLE_KEY,
|
|
496
496
|
productCategory: this.filterAttributes.productCategory || this.FIELD_NOT_TRANSLATABLE_KEY,
|
|
497
497
|
productType: this.filterAttributes.productType || this.FIELD_NOT_TRANSLATABLE_KEY,
|
|
498
|
-
productStyle: this.filterAttributes.productStyle.join(', ') || this.FIELD_NOT_TRANSLATABLE_KEY,
|
|
498
|
+
productStyle: (this.filterAttributes.productStyle || []).join(', ') || this.FIELD_NOT_TRANSLATABLE_KEY,
|
|
499
499
|
materialComposition: this.materialCompJoinedString() || this.FIELD_NOT_TRANSLATABLE_KEY,
|
|
500
500
|
condition: this.filterAttributes.condition || this.FIELD_NOT_TRANSLATABLE_KEY,
|
|
501
501
|
};
|
|
@@ -22,6 +22,12 @@ type MerchantMutableData = {
|
|
|
22
22
|
primaryDomain: string;
|
|
23
23
|
webhooks: MerchantWebHook[];
|
|
24
24
|
socialLinks: SocialLinksType | null;
|
|
25
|
+
accountMode?: MerchantAccountMode | string;
|
|
26
|
+
accountClass?: MerchantAccountClass | string;
|
|
27
|
+
sellerBusinessType?: string;
|
|
28
|
+
managedByMerchantId?: string;
|
|
29
|
+
canUpgradeToStandalone?: boolean;
|
|
30
|
+
featureAccess?: MerchantFeatureAccess | null;
|
|
25
31
|
organizationNumber?: string;
|
|
26
32
|
organizationNumbers?: Record<string, string>;
|
|
27
33
|
returnPolicy?: string;
|
|
@@ -49,9 +55,17 @@ type MerchantSystemOnlyMutableData = {
|
|
|
49
55
|
hasActiveWebshop?: boolean;
|
|
50
56
|
subscriptionStatus?: string;
|
|
51
57
|
channelPartners?: string[];
|
|
58
|
+
isMarketplaceSeller?: boolean;
|
|
52
59
|
};
|
|
53
60
|
type MerchantObj = MerchantMutableData & MerchantSystemOnlyMutableData;
|
|
54
61
|
type MerchantTypes = 'INDIVIDUAL' | 'BUSINESS';
|
|
62
|
+
type MerchantAccountMode = 'STANDALONE' | 'MANAGED';
|
|
63
|
+
type MerchantAccountClass = 'STANDARD' | 'MARKETPLACE_SELLER';
|
|
64
|
+
type MarketplaceSellerCapability = 'ACCESS_ADMIN_DASHBOARD' | 'MANAGE_OWN_PRODUCTS' | 'VIEW_OWN_ORDERS' | 'VIEW_OWN_TRANSACTIONS' | 'MANAGE_BUSINESS_PROFILE' | 'MANAGE_OWN_PAYOUTS' | 'UPGRADE_TO_STANDALONE';
|
|
65
|
+
type MerchantFeatureAccess = {
|
|
66
|
+
authExperience?: string;
|
|
67
|
+
capabilities?: MarketplaceSellerCapability[];
|
|
68
|
+
};
|
|
55
69
|
type RibbnPaymentTiers = 'FREE' | 'TIER_ONE';
|
|
56
70
|
type TransactionFees = {
|
|
57
71
|
online: number;
|