@infrab4a/connect 4.9.7-beta.7 → 4.9.7-beta.9
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 +68 -0
- package/index.esm.js +67 -1
- 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 +9 -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({
|
|
@@ -5840,7 +5889,24 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
5840
5889
|
email,
|
|
5841
5890
|
});
|
|
5842
5891
|
}
|
|
5892
|
+
async getNotificationsReport({ ean, sku, name, category, reference, emailsCount, }) {
|
|
5893
|
+
const query = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (ean && { ean: { _eq: ean } })), (sku && { sku: { _eq: sku } })), (name && { name: { _iregex: name } })), (category && { category: { _iregex: category } })), (reference && { category_reference: { _eq: reference } })), (emailsCount && { emails_registered: { _eq: emailsCount } }));
|
|
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
|
+
}
|
|
5843
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);
|
|
5844
5910
|
|
|
5845
5911
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5846
5912
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
@@ -6394,6 +6460,8 @@ exports.Log = Log;
|
|
|
6394
6460
|
exports.Logger = Logger;
|
|
6395
6461
|
exports.NotFoundError = NotFoundError;
|
|
6396
6462
|
exports.Order = Order;
|
|
6463
|
+
exports.OrderBlocked = OrderBlocked;
|
|
6464
|
+
exports.OrderBlockedFirestoreRepository = OrderBlockedFirestoreRepository;
|
|
6397
6465
|
exports.OrderFirestoreRepository = OrderFirestoreRepository;
|
|
6398
6466
|
exports.Payment = Payment;
|
|
6399
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({
|
|
@@ -5834,7 +5883,24 @@ class ProductStockNotificationHasuraGraphQLRepository extends withCrudHasuraGrap
|
|
|
5834
5883
|
email,
|
|
5835
5884
|
});
|
|
5836
5885
|
}
|
|
5886
|
+
async getNotificationsReport({ ean, sku, name, category, reference, emailsCount, }) {
|
|
5887
|
+
const query = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (ean && { ean: { _eq: ean } })), (sku && { sku: { _eq: sku } })), (name && { name: { _iregex: name } })), (category && { category: { _iregex: category } })), (reference && { category_reference: { _eq: reference } })), (emailsCount && { emails_registered: { _eq: emailsCount } }));
|
|
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
|
+
}
|
|
5837
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);
|
|
5838
5904
|
|
|
5839
5905
|
class VariantHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGraphQL(Base)) {
|
|
5840
5906
|
constructor({ endpoint, authOptions, interceptors, }) {
|
|
@@ -6214,4 +6280,4 @@ __decorate([
|
|
|
6214
6280
|
__metadata("design:returntype", Promise)
|
|
6215
6281
|
], WishlistHasuraGraphQLRepository.prototype, "getCategoryByShop", null);
|
|
6216
6282
|
|
|
6217
|
-
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,13 @@ 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, category, reference, emailsCount, }: {
|
|
11
|
+
ean?: string;
|
|
12
|
+
sku?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
category?: string;
|
|
15
|
+
reference?: string;
|
|
16
|
+
emailsCount?: number;
|
|
17
|
+
}): Promise<ReportStockNotification[]>;
|
|
10
18
|
}
|
|
11
19
|
export {};
|