@infrab4a/connect 4.9.7-beta.6 → 4.9.7-beta.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/index.cjs.js +70 -4
- package/index.esm.js +69 -5
- package/package.json +1 -1
- package/src/domain/catalog/models/types/index.d.ts +1 -0
- package/src/domain/catalog/models/types/report-stock-notification.type.d.ts +9 -0
- package/src/domain/catalog/repositories/product-stock-notification.repository.d.ts +7 -1
- package/src/domain/shopping/index.d.ts +1 -0
- package/src/domain/shopping/models/coupons/coupon.d.ts +1 -1
- package/src/domain/shopping/models/index.d.ts +1 -0
- package/src/domain/shopping/models/order-blocked.d.ts +26 -0
- package/src/domain/shopping/repositories/index.d.ts +1 -0
- package/src/domain/shopping/repositories/order-blocked.repository.d.ts +6 -0
- package/src/domain/shopping/types/index.d.ts +1 -0
- package/src/domain/shopping/types/payment-card-info.type.d.ts +4 -0
- package/src/infra/firebase/firestore/repositories/shopping/index.d.ts +1 -0
- package/src/infra/firebase/firestore/repositories/shopping/order-blocked-firestore.repository.ts.d.ts +9 -0
- package/src/infra/hasura-graphql/repositories/catalog/product-stock-notification-hasura-graphql.repository.d.ts +7 -1
package/index.cjs.js
CHANGED
|
@@ -2182,6 +2182,12 @@ tslib.__decorate([
|
|
|
2182
2182
|
tslib.__metadata("design:type", Payment)
|
|
2183
2183
|
], Order.prototype, "payment", void 0);
|
|
2184
2184
|
|
|
2185
|
+
class OrderBlocked extends BaseModel {
|
|
2186
|
+
static get identifiersFields() {
|
|
2187
|
+
return ['id'];
|
|
2188
|
+
}
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2185
2191
|
class CheckoutSubscription extends BaseModel {
|
|
2186
2192
|
static get identifiersFields() {
|
|
2187
2193
|
return ['id'];
|
|
@@ -3007,6 +3013,8 @@ const withUpdateFirestore = (MixinBase) => {
|
|
|
3007
3013
|
try {
|
|
3008
3014
|
const identifiers = getValueFromParams(data, keyField);
|
|
3009
3015
|
const docRef = this.collection(collectionName).getDoc(identifiers.toString());
|
|
3016
|
+
if (!(await docRef.get()).data())
|
|
3017
|
+
throw new NotFoundError(`Document '${collectionName}/${Object.values(identifiers.toString())}' not found`);
|
|
3010
3018
|
const plainFromData = this.model.toInstance(this.paramsToPlain(data));
|
|
3011
3019
|
const intercepted = await ((_b = (_a = this.interceptors) === null || _a === void 0 ? void 0 : _a.request) === null || _b === void 0 ? void 0 : _b.call(_a, { instance: plainFromData }));
|
|
3012
3020
|
const builded = (intercepted === null || intercepted === void 0 ? void 0 : intercepted.instance) || plainFromData;
|
|
@@ -3571,6 +3579,47 @@ class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
|
3571
3579
|
}
|
|
3572
3580
|
}
|
|
3573
3581
|
|
|
3582
|
+
class OrderBlockedFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3583
|
+
constructor({ firestore, interceptors, }) {
|
|
3584
|
+
super({
|
|
3585
|
+
firestore,
|
|
3586
|
+
collectionName: 'paymentBlockedAttempts',
|
|
3587
|
+
model: OrderBlocked,
|
|
3588
|
+
interceptors,
|
|
3589
|
+
});
|
|
3590
|
+
}
|
|
3591
|
+
async createBlockedOrderOrPayment(checkout, blockType, type, limiteRange, card = null) {
|
|
3592
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3593
|
+
return this.create(OrderBlocked.toInstance({
|
|
3594
|
+
customer: {
|
|
3595
|
+
name: ((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.displayName) || '',
|
|
3596
|
+
cpf: ((_b = checkout.user) === null || _b === void 0 ? void 0 : _b.cpf) || '',
|
|
3597
|
+
id: (_c = checkout.user) === null || _c === void 0 ? void 0 : _c.id,
|
|
3598
|
+
email: ((_d = checkout.user) === null || _d === void 0 ? void 0 : _d.email) || '',
|
|
3599
|
+
phoneNumber: '+55' + ((_e = checkout.user) === null || _e === void 0 ? void 0 : _e.phone),
|
|
3600
|
+
isSubscriber: (_f = checkout.user) === null || _f === void 0 ? void 0 : _f.isSubscriber,
|
|
3601
|
+
subscriptionPlan: ((_g = checkout.user) === null || _g === void 0 ? void 0 : _g.subscriptionPlan) || '',
|
|
3602
|
+
shippingAddress: Object.assign(Object.assign({}, checkout.shippingAddress), { zip: this.formatZip((_h = checkout.shippingAddress) === null || _h === void 0 ? void 0 : _h.zip) }),
|
|
3603
|
+
},
|
|
3604
|
+
blockType,
|
|
3605
|
+
limiteRange,
|
|
3606
|
+
type,
|
|
3607
|
+
card,
|
|
3608
|
+
checkout: {
|
|
3609
|
+
id: checkout.id,
|
|
3610
|
+
shop: checkout.shop,
|
|
3611
|
+
total: checkout.totalPrice,
|
|
3612
|
+
},
|
|
3613
|
+
date: new Date(),
|
|
3614
|
+
}));
|
|
3615
|
+
}
|
|
3616
|
+
formatZip(zip) {
|
|
3617
|
+
if (zip.length === 8)
|
|
3618
|
+
return zip.substring(0, 5) + '-' + zip.substring(5, 8);
|
|
3619
|
+
return zip;
|
|
3620
|
+
}
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3574
3623
|
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3575
3624
|
constructor({ firestore, interceptors }) {
|
|
3576
3625
|
super({
|
|
@@ -4981,7 +5030,6 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4981
5030
|
if (Array.isArray(metadata) && !metadata.length)
|
|
4982
5031
|
return [];
|
|
4983
5032
|
if (Array.isArray(metadata) && metadata.length) {
|
|
4984
|
-
const metadataUpdated = [];
|
|
4985
5033
|
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
4986
5034
|
where: {
|
|
4987
5035
|
type: 'category_metadata_bool_exp',
|
|
@@ -4989,15 +5037,14 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4989
5037
|
value: { category_id: { _eq: categoryId } },
|
|
4990
5038
|
},
|
|
4991
5039
|
});
|
|
4992
|
-
|
|
5040
|
+
await this.mutation('insert_category_metadata', ['affected_rows'], {
|
|
4993
5041
|
objects: {
|
|
4994
5042
|
type: '[category_metadata_insert_input!]',
|
|
4995
5043
|
required: true,
|
|
4996
5044
|
value: metadata.map((m) => (Object.assign({ category_id: categoryId }, m))),
|
|
4997
5045
|
},
|
|
4998
5046
|
});
|
|
4999
|
-
|
|
5000
|
-
return metadataUpdated;
|
|
5047
|
+
return metadata;
|
|
5001
5048
|
}
|
|
5002
5049
|
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
5003
5050
|
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
@@ -5842,7 +5889,24 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
5842
5889
|
email,
|
|
5843
5890
|
});
|
|
5844
5891
|
}
|
|
5892
|
+
async getNotificationsReport({ ean, sku, name, reference, }) {
|
|
5893
|
+
const query = Object.assign(Object.assign(Object.assign(Object.assign({}, (ean && { ean: { _eq: ean } })), (sku && { sku: { _eq: sku } })), (name && { name: { _eq: name } })), (reference && { category_reference: { _eq: reference } }));
|
|
5894
|
+
const { report_stock_notification } = await this.query('report_stock_notification', ['ean', 'sku', 'name', 'stock', 'category', 'category_reference', 'emails_registered'], {
|
|
5895
|
+
where: {
|
|
5896
|
+
type: 'report_stock_notification_bool_exp',
|
|
5897
|
+
value: query,
|
|
5898
|
+
required: true,
|
|
5899
|
+
},
|
|
5900
|
+
});
|
|
5901
|
+
return report_stock_notification;
|
|
5902
|
+
}
|
|
5845
5903
|
}
|
|
5904
|
+
tslib.__decorate([
|
|
5905
|
+
Log(),
|
|
5906
|
+
tslib.__metadata("design:type", Function),
|
|
5907
|
+
tslib.__metadata("design:paramtypes", [Object]),
|
|
5908
|
+
tslib.__metadata("design:returntype", Promise)
|
|
5909
|
+
], ProductStockNotificationHasuraGraphQLRepository.prototype, "getNotificationsReport", null);
|
|
5846
5910
|
|
|
5847
5911
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5848
5912
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
@@ -6396,6 +6460,8 @@ exports.Log = Log;
|
|
|
6396
6460
|
exports.Logger = Logger;
|
|
6397
6461
|
exports.NotFoundError = NotFoundError;
|
|
6398
6462
|
exports.Order = Order;
|
|
6463
|
+
exports.OrderBlocked = OrderBlocked;
|
|
6464
|
+
exports.OrderBlockedFirestoreRepository = OrderBlockedFirestoreRepository;
|
|
6399
6465
|
exports.OrderFirestoreRepository = OrderFirestoreRepository;
|
|
6400
6466
|
exports.Payment = Payment;
|
|
6401
6467
|
exports.PaymentFirestoreRepository = PaymentFirestoreRepository;
|
package/index.esm.js
CHANGED
|
@@ -2176,6 +2176,12 @@ __decorate([
|
|
|
2176
2176
|
__metadata("design:type", Payment)
|
|
2177
2177
|
], Order.prototype, "payment", void 0);
|
|
2178
2178
|
|
|
2179
|
+
class OrderBlocked extends BaseModel {
|
|
2180
|
+
static get identifiersFields() {
|
|
2181
|
+
return ['id'];
|
|
2182
|
+
}
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2179
2185
|
class CheckoutSubscription extends BaseModel {
|
|
2180
2186
|
static get identifiersFields() {
|
|
2181
2187
|
return ['id'];
|
|
@@ -3001,6 +3007,8 @@ const withUpdateFirestore = (MixinBase) => {
|
|
|
3001
3007
|
try {
|
|
3002
3008
|
const identifiers = getValueFromParams(data, keyField);
|
|
3003
3009
|
const docRef = this.collection(collectionName).getDoc(identifiers.toString());
|
|
3010
|
+
if (!(await docRef.get()).data())
|
|
3011
|
+
throw new NotFoundError(`Document '${collectionName}/${Object.values(identifiers.toString())}' not found`);
|
|
3004
3012
|
const plainFromData = this.model.toInstance(this.paramsToPlain(data));
|
|
3005
3013
|
const intercepted = await ((_b = (_a = this.interceptors) === null || _a === void 0 ? void 0 : _a.request) === null || _b === void 0 ? void 0 : _b.call(_a, { instance: plainFromData }));
|
|
3006
3014
|
const builded = (intercepted === null || intercepted === void 0 ? void 0 : intercepted.instance) || plainFromData;
|
|
@@ -3565,6 +3573,47 @@ class LegacyOrderFirestoreRepository extends OrderFirestoreRepository {
|
|
|
3565
3573
|
}
|
|
3566
3574
|
}
|
|
3567
3575
|
|
|
3576
|
+
class OrderBlockedFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3577
|
+
constructor({ firestore, interceptors, }) {
|
|
3578
|
+
super({
|
|
3579
|
+
firestore,
|
|
3580
|
+
collectionName: 'paymentBlockedAttempts',
|
|
3581
|
+
model: OrderBlocked,
|
|
3582
|
+
interceptors,
|
|
3583
|
+
});
|
|
3584
|
+
}
|
|
3585
|
+
async createBlockedOrderOrPayment(checkout, blockType, type, limiteRange, card = null) {
|
|
3586
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3587
|
+
return this.create(OrderBlocked.toInstance({
|
|
3588
|
+
customer: {
|
|
3589
|
+
name: ((_a = checkout.user) === null || _a === void 0 ? void 0 : _a.displayName) || '',
|
|
3590
|
+
cpf: ((_b = checkout.user) === null || _b === void 0 ? void 0 : _b.cpf) || '',
|
|
3591
|
+
id: (_c = checkout.user) === null || _c === void 0 ? void 0 : _c.id,
|
|
3592
|
+
email: ((_d = checkout.user) === null || _d === void 0 ? void 0 : _d.email) || '',
|
|
3593
|
+
phoneNumber: '+55' + ((_e = checkout.user) === null || _e === void 0 ? void 0 : _e.phone),
|
|
3594
|
+
isSubscriber: (_f = checkout.user) === null || _f === void 0 ? void 0 : _f.isSubscriber,
|
|
3595
|
+
subscriptionPlan: ((_g = checkout.user) === null || _g === void 0 ? void 0 : _g.subscriptionPlan) || '',
|
|
3596
|
+
shippingAddress: Object.assign(Object.assign({}, checkout.shippingAddress), { zip: this.formatZip((_h = checkout.shippingAddress) === null || _h === void 0 ? void 0 : _h.zip) }),
|
|
3597
|
+
},
|
|
3598
|
+
blockType,
|
|
3599
|
+
limiteRange,
|
|
3600
|
+
type,
|
|
3601
|
+
card,
|
|
3602
|
+
checkout: {
|
|
3603
|
+
id: checkout.id,
|
|
3604
|
+
shop: checkout.shop,
|
|
3605
|
+
total: checkout.totalPrice,
|
|
3606
|
+
},
|
|
3607
|
+
date: new Date(),
|
|
3608
|
+
}));
|
|
3609
|
+
}
|
|
3610
|
+
formatZip(zip) {
|
|
3611
|
+
if (zip.length === 8)
|
|
3612
|
+
return zip.substring(0, 5) + '-' + zip.substring(5, 8);
|
|
3613
|
+
return zip;
|
|
3614
|
+
}
|
|
3615
|
+
}
|
|
3616
|
+
|
|
3568
3617
|
class PaymentFirestoreRepository extends withCrudFirestore(withHelpers(withFirestore(Base))) {
|
|
3569
3618
|
constructor({ firestore, interceptors }) {
|
|
3570
3619
|
super({
|
|
@@ -4975,7 +5024,6 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4975
5024
|
if (Array.isArray(metadata) && !metadata.length)
|
|
4976
5025
|
return [];
|
|
4977
5026
|
if (Array.isArray(metadata) && metadata.length) {
|
|
4978
|
-
const metadataUpdated = [];
|
|
4979
5027
|
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
4980
5028
|
where: {
|
|
4981
5029
|
type: 'category_metadata_bool_exp',
|
|
@@ -4983,15 +5031,14 @@ class CategoryHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
4983
5031
|
value: { category_id: { _eq: categoryId } },
|
|
4984
5032
|
},
|
|
4985
5033
|
});
|
|
4986
|
-
|
|
5034
|
+
await this.mutation('insert_category_metadata', ['affected_rows'], {
|
|
4987
5035
|
objects: {
|
|
4988
5036
|
type: '[category_metadata_insert_input!]',
|
|
4989
5037
|
required: true,
|
|
4990
5038
|
value: metadata.map((m) => (Object.assign({ category_id: categoryId }, m))),
|
|
4991
5039
|
},
|
|
4992
5040
|
});
|
|
4993
|
-
|
|
4994
|
-
return metadataUpdated;
|
|
5041
|
+
return metadata;
|
|
4995
5042
|
}
|
|
4996
5043
|
if ('action' in metadata && metadata.action === 'remove' && metadata.value.length) {
|
|
4997
5044
|
await this.mutation('delete_category_metadata', ['affected_rows'], {
|
|
@@ -5836,7 +5883,24 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
5836
5883
|
email,
|
|
5837
5884
|
});
|
|
5838
5885
|
}
|
|
5886
|
+
async getNotificationsReport({ ean, sku, name, reference, }) {
|
|
5887
|
+
const query = Object.assign(Object.assign(Object.assign(Object.assign({}, (ean && { ean: { _eq: ean } })), (sku && { sku: { _eq: sku } })), (name && { name: { _eq: name } })), (reference && { category_reference: { _eq: reference } }));
|
|
5888
|
+
const { report_stock_notification } = await this.query('report_stock_notification', ['ean', 'sku', 'name', 'stock', 'category', 'category_reference', 'emails_registered'], {
|
|
5889
|
+
where: {
|
|
5890
|
+
type: 'report_stock_notification_bool_exp',
|
|
5891
|
+
value: query,
|
|
5892
|
+
required: true,
|
|
5893
|
+
},
|
|
5894
|
+
});
|
|
5895
|
+
return report_stock_notification;
|
|
5896
|
+
}
|
|
5839
5897
|
}
|
|
5898
|
+
__decorate([
|
|
5899
|
+
Log(),
|
|
5900
|
+
__metadata("design:type", Function),
|
|
5901
|
+
__metadata("design:paramtypes", [Object]),
|
|
5902
|
+
__metadata("design:returntype", Promise)
|
|
5903
|
+
], ProductStockNotificationHasuraGraphQLRepository.prototype, "getNotificationsReport", null);
|
|
5840
5904
|
|
|
5841
5905
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5842
5906
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
@@ -6216,4 +6280,4 @@ __decorate([
|
|
|
6216
6280
|
__metadata("design:returntype", Promise)
|
|
6217
6281
|
], WishlistHasuraGraphQLRepository.prototype, "getCategoryByShop", null);
|
|
6218
6282
|
|
|
6219
|
-
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, Logger, NotFoundError, OfficePosition, Order, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Plans, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RoundProductPricesHelper, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
|
6283
|
+
export { AccessoryImportances, Address, Area, Authentication, AuthenticationFirebaseAuthService, AxiosAdapter, Base, BaseModel, BeardProblems, BeardSizes, BeautyProductImportances, BeautyProfile, BeautyQuestionsHelper, BillingStatus, BodyProblems, BodyShapes, BodyTattoos, Buy2Win, Buy2WinFirestoreRepository, Campaign, CampaignBanner, CampaignDashboard, CampaignDashboardFirestoreRepository, CampaignHashtag, CampaignHashtagFirestoreRepository, Category, CategoryCollectionChildren, CategoryCollectionChildrenHasuraGraphQLRepository, CategoryFilter, CategoryFilterHasuraGraphQLRepository, CategoryFirestoreRepository, CategoryHasuraGraphQL, CategoryHasuraGraphQLRepository, Checkout, CheckoutFirestoreRepository, CheckoutSubscription, CheckoutSubscriptionFirestoreRepository, CheckoutTypes, ClassNameHelper, ConnectBaseDocumentSnapshot, ConnectCollectionService, ConnectDocumentService, ConnectFirestoreService, Coupon, CouponFirestoreRepository, CouponSubtypes, CouponTypes, Debug, DebugDecoratorHelper, DebugHelper, DebugNamespaces, DuplicatedResultsError, Edition, EditionStatus, Exclusivities, FaceSkinOilinesses, FaceSkinProblems, FaceSkinTones, FamilyIncomes, Filter, FilterHasuraGraphQLRepository, FilterOption, FilterOptionHasuraGraphQLRepository, FilterType, FirebaseFileUploaderService, FragranceImportances, GenderDestination, HairColors, HairProblems, HairStrands, HairTypes, Home, HomeFirestoreRepository, InvalidArgumentError, KitProduct, KitProductHasuraGraphQL, Lead, LeadFirestoreRepository, LegacyOrderFirestoreRepository, LineItem, Log, Logger, NotFoundError, OfficePosition, Order, OrderBlocked, OrderBlockedFirestoreRepository, OrderFirestoreRepository, OrderStatus, Payment, PaymentFirestoreRepository, PaymentType, Plans, Product, ProductFirestoreRepository, ProductHasuraGraphQL, ProductHasuraGraphQLRepository, ProductReviews, ProductReviewsHasuraGraphQLRepository, ProductSpents, ProductStockNotification, ProductStockNotificationHasuraGraphQLRepository, ProductVariantFirestoreRepository, ProductsIndex, QuestionsFilters, RecoveryPassword, ReflectHelper, Register, RegisterFirebaseAuthService, RequiredArgumentError, RoundProductPricesHelper, ShippingMethod, ShopMenu, ShopMenuFirestoreRepository, ShopPageName, ShopSettings, ShopSettingsFirestoreRepository, Shops, SignInMethods, SignOut, Status, Subscription, SubscriptionEditionFirestoreRepository, SubscriptionFirestoreRepository, SubscriptionMaterialization, SubscriptionMaterializationFirestoreRepository, SubscriptionPayment, SubscriptionPaymentFirestoreRepository, SubscriptionPlan, SubscriptionPlanFirestoreRepository, SubscriptionProductFirestoreRepository, SubscriptionSummary, SubscriptionSummaryFirestoreRepository, Trace, UnauthorizedError, UpdateOptionActions, UpdateUserImage, User, UserAddress, UserAddressFirestoreRepository, UserAlreadyRegisteredError, UserBeautyProfileFirestoreRepository, UserFirestoreRepository, UserPaymentMethod, UserPaymentMethodFirestoreRepository, UserType, Variant, VariantHasuraGraphQL, VariantHasuraGraphQLRepository, WeakPasswordError, Where, Wishlist, WishlistHasuraGraphQLRepository, is, isDebuggable, isUUID, parseDateTime, withCreateFirestore, withCreateHasuraGraphQL, withCrudFirestore, withCrudHasuraGraphQL, withDeleteFirestore, withDeleteHasuraGraphQL, withFindFirestore, withFindHasuraGraphQL, withFirestore, withGetFirestore, withGetHasuraGraphQL, withHasuraGraphQL, withHelpers, withSubCollection, withUpdateFirestore, withUpdateHasuraGraphQL };
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ export * from './product-evaluation.type';
|
|
|
7
7
|
export * from './product-gender.type';
|
|
8
8
|
export * from './product-metadata.type';
|
|
9
9
|
export * from './product-review.type';
|
|
10
|
+
export * from './report-stock-notification.type';
|
|
10
11
|
export * from './shop-description.type';
|
|
11
12
|
export * from './shop-price.type';
|
|
12
13
|
export * from './stock.type';
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
2
|
-
import { ProductStockNotification, Shops } from '../models';
|
|
2
|
+
import { ProductStockNotification, ReportStockNotification, Shops } from '../models';
|
|
3
3
|
export interface ProductStockNotificationRepository extends CrudRepository<ProductStockNotification> {
|
|
4
4
|
addCustomerEmail(shop: Shops, productId: string, name: string, email: string): Promise<void>;
|
|
5
|
+
getNotificationsReport({ ean, sku, name, reference, }: {
|
|
6
|
+
ean?: string;
|
|
7
|
+
sku?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
reference?: string;
|
|
10
|
+
}): Promise<ReportStockNotification[]>;
|
|
5
11
|
}
|
|
@@ -56,7 +56,7 @@ export declare class Coupon extends BaseModel<Coupon> {
|
|
|
56
56
|
createdAt: Date;
|
|
57
57
|
updatedAt?: Date;
|
|
58
58
|
checkoutType: CheckoutTypes;
|
|
59
|
-
exclusivityType?: [
|
|
59
|
+
exclusivityType?: Exclusivities[];
|
|
60
60
|
get isInfluencer(): boolean;
|
|
61
61
|
static get identifiersFields(): GenericIdentifier[];
|
|
62
62
|
static createCoupon(userId: string): Coupon;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { BaseModel, GenericIdentifier } from '../../generic';
|
|
2
|
+
import { UserAddress } from '../../users';
|
|
3
|
+
export declare class OrderBlocked extends BaseModel<OrderBlocked> {
|
|
4
|
+
id?: string;
|
|
5
|
+
customer: {
|
|
6
|
+
name: string;
|
|
7
|
+
cpf: string;
|
|
8
|
+
id: string;
|
|
9
|
+
email: string;
|
|
10
|
+
phoneNumber: string;
|
|
11
|
+
isSubscriber: boolean;
|
|
12
|
+
subscriptionPlan: string;
|
|
13
|
+
shippingAddress: UserAddress;
|
|
14
|
+
};
|
|
15
|
+
blockType: string;
|
|
16
|
+
limiteRange: string;
|
|
17
|
+
type: string;
|
|
18
|
+
card?: any;
|
|
19
|
+
checkout: {
|
|
20
|
+
id: string;
|
|
21
|
+
shop: string;
|
|
22
|
+
total: number;
|
|
23
|
+
};
|
|
24
|
+
date: Date;
|
|
25
|
+
static get identifiersFields(): GenericIdentifier[];
|
|
26
|
+
}
|
|
@@ -4,6 +4,7 @@ export * from './campaign-hashtag.repository';
|
|
|
4
4
|
export * from './checkout.repository';
|
|
5
5
|
export * from './coupon.repository';
|
|
6
6
|
export * from './legacy-order.repository';
|
|
7
|
+
export * from './order-blocked.repository';
|
|
7
8
|
export * from './order.repository';
|
|
8
9
|
export * from './payment.repository';
|
|
9
10
|
export * from './subscription';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CrudRepository } from '../../generic/repository/crud.repository';
|
|
2
|
+
import { Checkout, OrderBlocked } from '../models';
|
|
3
|
+
import { PaymentCardInfo } from '../types';
|
|
4
|
+
export interface OrderBlockedRepository extends CrudRepository<OrderBlocked> {
|
|
5
|
+
createBlockedOrderOrPayment(checkout: Checkout, blockType: string, type: string, limiteRange: string, card?: PaymentCardInfo): Promise<OrderBlocked>;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './payment-card-info.type';
|
|
@@ -5,6 +5,7 @@ export * from './checkout-firestore.repository';
|
|
|
5
5
|
export * from './checkout-subscription-firestore.repository';
|
|
6
6
|
export * from './coupon-firestore.repository';
|
|
7
7
|
export * from './legacy-order-firestore.repository';
|
|
8
|
+
export * from './order-blocked-firestore.repository.ts';
|
|
8
9
|
export * from './order-firestore.repository';
|
|
9
10
|
export * from './payment-firestore.repository';
|
|
10
11
|
export * from './subscription-plan-firestore.repository';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Checkout, OrderBlocked, OrderBlockedRepository, PaymentCardInfo } from '../../../../../domain';
|
|
2
|
+
import { FirestoreConstructorParams } from '../../mixins';
|
|
3
|
+
declare const OrderBlockedFirestoreRepository_base: import("../../../../../utils").MixinCtor<import("../..").FirestoreRepository<OrderBlocked> & import("../../../../../domain").CrudRepository<OrderBlocked, import("../../../../../domain").CrudParams<OrderBlocked>> & import("../..").FirestoreHelpers, [FirestoreConstructorParams<OrderBlocked>, ...any[]]>;
|
|
4
|
+
export declare class OrderBlockedFirestoreRepository extends OrderBlockedFirestoreRepository_base implements OrderBlockedRepository {
|
|
5
|
+
constructor({ firestore, interceptors, }: Pick<FirestoreConstructorParams<OrderBlocked>, 'firestore' | 'interceptors'>);
|
|
6
|
+
createBlockedOrderOrPayment(checkout: Checkout, blockType: string, type: string, limiteRange: string, card?: PaymentCardInfo): Promise<OrderBlocked>;
|
|
7
|
+
private formatZip;
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Filter, ProductStockNotification, Shops } from '../../../../domain';
|
|
1
|
+
import { Filter, ProductStockNotification, ReportStockNotification, Shops } from '../../../../domain';
|
|
2
2
|
import { ProductStockNotificationRepository } from '../../../../domain/catalog/repositories';
|
|
3
3
|
import { HasuraConstructorParams } from '../../mixins';
|
|
4
4
|
declare const ProductStockNotificationHasuraGraphQLRepository_base: import("../../../../utils").MixinCtor<import("../..").GraphQLRepository<ProductStockNotification> & import("../../../../domain").CrudRepository<ProductStockNotification, import("../../../../domain").CrudParams<ProductStockNotification>> & import("../../../../domain").UpdateRepository<ProductStockNotification, import("../../../../domain").RepositoryUpdateParams<ProductStockNotification>> & {
|
|
@@ -7,5 +7,11 @@ declare const ProductStockNotificationHasuraGraphQLRepository_base: import("../.
|
|
|
7
7
|
export declare class ProductStockNotificationHasuraGraphQLRepository extends ProductStockNotificationHasuraGraphQLRepository_base implements ProductStockNotificationRepository {
|
|
8
8
|
constructor({ endpoint, authOptions, interceptors, }: Pick<HasuraConstructorParams<Filter>, 'endpoint' | 'authOptions' | 'interceptors'>);
|
|
9
9
|
addCustomerEmail(shop: Shops, productId: string, name: string, email: string): Promise<void>;
|
|
10
|
+
getNotificationsReport({ ean, sku, name, reference, }: {
|
|
11
|
+
ean?: string;
|
|
12
|
+
sku?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
reference?: string;
|
|
15
|
+
}): Promise<ReportStockNotification[]>;
|
|
10
16
|
}
|
|
11
17
|
export {};
|