@infrab4a/connect 5.8.8 → 5.8.10-beta.0
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 +60 -33
- package/index.esm.js +60 -33
- package/infrab4a-connect-5.8.10-beta.0.tgz +0 -0
- package/package.json +1 -1
- package/src/domain/catalog/repositories/wishlist.repository.d.ts +4 -2
- package/src/domain/shopping/models/checkout.d.ts +4 -0
- package/src/domain/shopping/models/recurrence/shopping-recurrence.d.ts +2 -6
- package/src/domain/shopping/types/shipping-method-response.type.d.ts +13 -0
- package/src/infra/firebase/firestore/mixins/with-helpers.mixin.d.ts +1 -1
- package/src/infra/hasura-graphql/repositories/catalog/helpers/index.d.ts +1 -0
- package/src/infra/hasura-graphql/repositories/catalog/helpers/wishlist-listing-find.helper.d.ts +10 -0
- package/src/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.d.ts +7 -3
- package/src/infra/pagarme/types/v5/pagarmev5-order-request-payload.type.d.ts +2 -1
- package/src/test.d.ts +1 -0
package/index.cjs.js
CHANGED
|
@@ -7415,6 +7415,44 @@ class ProductVariantReportHelper {
|
|
|
7415
7415
|
}
|
|
7416
7416
|
}
|
|
7417
7417
|
|
|
7418
|
+
const BFLU_OR_GLAMGIRL_WISHLIST_LISTING_FIELDS = [
|
|
7419
|
+
'id',
|
|
7420
|
+
'name',
|
|
7421
|
+
'slug',
|
|
7422
|
+
'personName',
|
|
7423
|
+
'personPhoto',
|
|
7424
|
+
'personHasPhoto',
|
|
7425
|
+
'personType',
|
|
7426
|
+
'published',
|
|
7427
|
+
'updatedAt',
|
|
7428
|
+
];
|
|
7429
|
+
const BFLU_OR_GLAMGIRL_WISHLIST_CACHE_DEFAULT = {
|
|
7430
|
+
enabled: true,
|
|
7431
|
+
ttl: 300,
|
|
7432
|
+
};
|
|
7433
|
+
function resolveBfluOrGlamgirlWishlistCacheOptions(options) {
|
|
7434
|
+
return { cache: options?.cache ?? BFLU_OR_GLAMGIRL_WISHLIST_CACHE_DEFAULT };
|
|
7435
|
+
}
|
|
7436
|
+
function buildBfluOrGlamgirlWishlistFindParams(params, shops) {
|
|
7437
|
+
return {
|
|
7438
|
+
...params,
|
|
7439
|
+
fields: params.fields ?? BFLU_OR_GLAMGIRL_WISHLIST_LISTING_FIELDS,
|
|
7440
|
+
filters: {
|
|
7441
|
+
...params.filters,
|
|
7442
|
+
published: true,
|
|
7443
|
+
shops: { operator: exports.Where.IN, value: shops },
|
|
7444
|
+
personType: params.filters?.personType ?? {
|
|
7445
|
+
operator: exports.Where.IN,
|
|
7446
|
+
value: [exports.PersonTypes.BFLU, exports.PersonTypes.GLAMGIRL],
|
|
7447
|
+
},
|
|
7448
|
+
},
|
|
7449
|
+
orderBy: {
|
|
7450
|
+
personHasPhoto: 'desc',
|
|
7451
|
+
...lodash.omit(params.orderBy, ['personHasPhoto']),
|
|
7452
|
+
},
|
|
7453
|
+
};
|
|
7454
|
+
}
|
|
7455
|
+
|
|
7418
7456
|
const fieldsConfiguration$4 = [
|
|
7419
7457
|
{ id: { columnName: 'id', to: (value) => +value, from: (value) => value.toString() } },
|
|
7420
7458
|
{ firestoreId: { columnName: 'firestore_id' } },
|
|
@@ -9983,7 +10021,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
9983
10021
|
throw new NotFoundError(`Category with id ${identifiers.id} is not a wishlist`);
|
|
9984
10022
|
return data;
|
|
9985
10023
|
}
|
|
9986
|
-
async find(params) {
|
|
10024
|
+
async find(params, options) {
|
|
9987
10025
|
const { filters, ...rest } = params;
|
|
9988
10026
|
return await super.find({
|
|
9989
10027
|
...rest,
|
|
@@ -9991,7 +10029,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
9991
10029
|
...filters,
|
|
9992
10030
|
isWishlist: { operator: exports.Where.EQUALS, value: true },
|
|
9993
10031
|
},
|
|
9994
|
-
});
|
|
10032
|
+
}, options);
|
|
9995
10033
|
}
|
|
9996
10034
|
async update(params) {
|
|
9997
10035
|
const { id: checkId, metadatas, ...data } = lodash.omit(params, ['products', 'filters']);
|
|
@@ -10059,23 +10097,8 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
10059
10097
|
});
|
|
10060
10098
|
return data;
|
|
10061
10099
|
}
|
|
10062
|
-
async findBfluOrGlamgirlWishlists(params, shops) {
|
|
10063
|
-
return this.find(
|
|
10064
|
-
...params,
|
|
10065
|
-
filters: {
|
|
10066
|
-
...params.filters,
|
|
10067
|
-
published: true,
|
|
10068
|
-
shops: { operator: exports.Where.LIKE, value: shops },
|
|
10069
|
-
personType: params.filters?.personType ?? {
|
|
10070
|
-
operator: exports.Where.IN,
|
|
10071
|
-
value: [exports.PersonTypes.BFLU, exports.PersonTypes.GLAMGIRL],
|
|
10072
|
-
},
|
|
10073
|
-
},
|
|
10074
|
-
orderBy: {
|
|
10075
|
-
personHasPhoto: 'desc',
|
|
10076
|
-
...lodash.omit(params.orderBy, ['personHasPhoto']),
|
|
10077
|
-
},
|
|
10078
|
-
});
|
|
10100
|
+
async findBfluOrGlamgirlWishlists(params, shops, options) {
|
|
10101
|
+
return this.find(buildBfluOrGlamgirlWishlistFindParams(params, shops), resolveBfluOrGlamgirlWishlistCacheOptions(options));
|
|
10079
10102
|
}
|
|
10080
10103
|
getCategoriesForHome() {
|
|
10081
10104
|
return;
|
|
@@ -10162,7 +10185,7 @@ tslib.__decorate([
|
|
|
10162
10185
|
tslib.__decorate([
|
|
10163
10186
|
Log(),
|
|
10164
10187
|
tslib.__metadata("design:type", Function),
|
|
10165
|
-
tslib.__metadata("design:paramtypes", [Object, Array]),
|
|
10188
|
+
tslib.__metadata("design:paramtypes", [Object, Array, Object]),
|
|
10166
10189
|
tslib.__metadata("design:returntype", Promise)
|
|
10167
10190
|
], WishlistHasuraGraphQLRepository.prototype, "findBfluOrGlamgirlWishlists", null);
|
|
10168
10191
|
|
|
@@ -11021,7 +11044,7 @@ class PagarMeV5RequestHelper {
|
|
|
11021
11044
|
.filter((item) => !item.isGift)
|
|
11022
11045
|
.map((item) => {
|
|
11023
11046
|
return {
|
|
11024
|
-
amount:
|
|
11047
|
+
amount: toCents(item.pricePaid),
|
|
11025
11048
|
description: isSubscriber ? `${item.name} - ASSINANTE` : item.name,
|
|
11026
11049
|
quantity: item.quantity,
|
|
11027
11050
|
code: item.EAN,
|
|
@@ -11058,7 +11081,7 @@ class PagarMeV5RequestHelper {
|
|
|
11058
11081
|
}
|
|
11059
11082
|
static buildShipping(checkout) {
|
|
11060
11083
|
return {
|
|
11061
|
-
amount:
|
|
11084
|
+
amount: toCents(checkout.shipping.ShippingPrice),
|
|
11062
11085
|
description: `${checkout.shipping.ShippingCompanyName} - ${checkout.shipping.description}`,
|
|
11063
11086
|
recipient_name: checkout.shippingAddress.recipient,
|
|
11064
11087
|
recipient_phone: checkout.user.phone,
|
|
@@ -11076,7 +11099,7 @@ class PagarMeV5RequestHelper {
|
|
|
11076
11099
|
return [
|
|
11077
11100
|
{
|
|
11078
11101
|
payment_method: method,
|
|
11079
|
-
amount:
|
|
11102
|
+
amount: toCents(checkout.totalPrice),
|
|
11080
11103
|
...(method === 'pix' && {
|
|
11081
11104
|
pix: this.getPixOrder(),
|
|
11082
11105
|
}),
|
|
@@ -11103,20 +11126,24 @@ class PagarMeV5RequestHelper {
|
|
|
11103
11126
|
};
|
|
11104
11127
|
}
|
|
11105
11128
|
static getCardOrder(checkout, card) {
|
|
11129
|
+
const billingAddress = {
|
|
11130
|
+
line_1: `${checkout.billingAddress.number}, ${checkout.billingAddress.street}, ${checkout.billingAddress.district}`,
|
|
11131
|
+
zip_code: checkout.billingAddress.zip,
|
|
11132
|
+
city: checkout.billingAddress.city,
|
|
11133
|
+
state: checkout.billingAddress.state,
|
|
11134
|
+
country: 'BR',
|
|
11135
|
+
};
|
|
11136
|
+
// Tokenized charges (e.g. shopping recurrence renewals) must not send empty/undefined CVV.
|
|
11137
|
+
// First checkout still passes cardCvv when the shopper types it.
|
|
11138
|
+
const cardPayload = {
|
|
11139
|
+
billing_address: billingAddress,
|
|
11140
|
+
...(card.cardCvv ? { cvv: card.cardCvv } : {}),
|
|
11141
|
+
};
|
|
11106
11142
|
return {
|
|
11107
11143
|
installments: card.installments,
|
|
11108
11144
|
statement_descriptor: checkout.shop === exports.Shops.GLAMSHOP ? 'loja glam' : 'mens market',
|
|
11109
11145
|
card_id: card.cardId,
|
|
11110
|
-
card:
|
|
11111
|
-
cvv: card.cardCvv,
|
|
11112
|
-
billing_address: {
|
|
11113
|
-
line_1: `${checkout.billingAddress.number}, ${checkout.billingAddress.street}, ${checkout.billingAddress.district}`,
|
|
11114
|
-
zip_code: checkout.billingAddress.zip,
|
|
11115
|
-
city: checkout.billingAddress.city,
|
|
11116
|
-
state: checkout.billingAddress.state,
|
|
11117
|
-
country: 'BR',
|
|
11118
|
-
},
|
|
11119
|
-
},
|
|
11146
|
+
card: cardPayload,
|
|
11120
11147
|
};
|
|
11121
11148
|
}
|
|
11122
11149
|
static buildAdditionalInfo(checkout) {
|
package/index.esm.js
CHANGED
|
@@ -7409,6 +7409,44 @@ class ProductVariantReportHelper {
|
|
|
7409
7409
|
}
|
|
7410
7410
|
}
|
|
7411
7411
|
|
|
7412
|
+
const BFLU_OR_GLAMGIRL_WISHLIST_LISTING_FIELDS = [
|
|
7413
|
+
'id',
|
|
7414
|
+
'name',
|
|
7415
|
+
'slug',
|
|
7416
|
+
'personName',
|
|
7417
|
+
'personPhoto',
|
|
7418
|
+
'personHasPhoto',
|
|
7419
|
+
'personType',
|
|
7420
|
+
'published',
|
|
7421
|
+
'updatedAt',
|
|
7422
|
+
];
|
|
7423
|
+
const BFLU_OR_GLAMGIRL_WISHLIST_CACHE_DEFAULT = {
|
|
7424
|
+
enabled: true,
|
|
7425
|
+
ttl: 300,
|
|
7426
|
+
};
|
|
7427
|
+
function resolveBfluOrGlamgirlWishlistCacheOptions(options) {
|
|
7428
|
+
return { cache: options?.cache ?? BFLU_OR_GLAMGIRL_WISHLIST_CACHE_DEFAULT };
|
|
7429
|
+
}
|
|
7430
|
+
function buildBfluOrGlamgirlWishlistFindParams(params, shops) {
|
|
7431
|
+
return {
|
|
7432
|
+
...params,
|
|
7433
|
+
fields: params.fields ?? BFLU_OR_GLAMGIRL_WISHLIST_LISTING_FIELDS,
|
|
7434
|
+
filters: {
|
|
7435
|
+
...params.filters,
|
|
7436
|
+
published: true,
|
|
7437
|
+
shops: { operator: Where.IN, value: shops },
|
|
7438
|
+
personType: params.filters?.personType ?? {
|
|
7439
|
+
operator: Where.IN,
|
|
7440
|
+
value: [PersonTypes.BFLU, PersonTypes.GLAMGIRL],
|
|
7441
|
+
},
|
|
7442
|
+
},
|
|
7443
|
+
orderBy: {
|
|
7444
|
+
personHasPhoto: 'desc',
|
|
7445
|
+
...omit(params.orderBy, ['personHasPhoto']),
|
|
7446
|
+
},
|
|
7447
|
+
};
|
|
7448
|
+
}
|
|
7449
|
+
|
|
7412
7450
|
const fieldsConfiguration$4 = [
|
|
7413
7451
|
{ id: { columnName: 'id', to: (value) => +value, from: (value) => value.toString() } },
|
|
7414
7452
|
{ firestoreId: { columnName: 'firestore_id' } },
|
|
@@ -9977,7 +10015,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
9977
10015
|
throw new NotFoundError(`Category with id ${identifiers.id} is not a wishlist`);
|
|
9978
10016
|
return data;
|
|
9979
10017
|
}
|
|
9980
|
-
async find(params) {
|
|
10018
|
+
async find(params, options) {
|
|
9981
10019
|
const { filters, ...rest } = params;
|
|
9982
10020
|
return await super.find({
|
|
9983
10021
|
...rest,
|
|
@@ -9985,7 +10023,7 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
9985
10023
|
...filters,
|
|
9986
10024
|
isWishlist: { operator: Where.EQUALS, value: true },
|
|
9987
10025
|
},
|
|
9988
|
-
});
|
|
10026
|
+
}, options);
|
|
9989
10027
|
}
|
|
9990
10028
|
async update(params) {
|
|
9991
10029
|
const { id: checkId, metadatas, ...data } = omit(params, ['products', 'filters']);
|
|
@@ -10053,23 +10091,8 @@ class WishlistHasuraGraphQLRepository extends withCrudHasuraGraphQL(withHasuraGr
|
|
|
10053
10091
|
});
|
|
10054
10092
|
return data;
|
|
10055
10093
|
}
|
|
10056
|
-
async findBfluOrGlamgirlWishlists(params, shops) {
|
|
10057
|
-
return this.find(
|
|
10058
|
-
...params,
|
|
10059
|
-
filters: {
|
|
10060
|
-
...params.filters,
|
|
10061
|
-
published: true,
|
|
10062
|
-
shops: { operator: Where.LIKE, value: shops },
|
|
10063
|
-
personType: params.filters?.personType ?? {
|
|
10064
|
-
operator: Where.IN,
|
|
10065
|
-
value: [PersonTypes.BFLU, PersonTypes.GLAMGIRL],
|
|
10066
|
-
},
|
|
10067
|
-
},
|
|
10068
|
-
orderBy: {
|
|
10069
|
-
personHasPhoto: 'desc',
|
|
10070
|
-
...omit(params.orderBy, ['personHasPhoto']),
|
|
10071
|
-
},
|
|
10072
|
-
});
|
|
10094
|
+
async findBfluOrGlamgirlWishlists(params, shops, options) {
|
|
10095
|
+
return this.find(buildBfluOrGlamgirlWishlistFindParams(params, shops), resolveBfluOrGlamgirlWishlistCacheOptions(options));
|
|
10073
10096
|
}
|
|
10074
10097
|
getCategoriesForHome() {
|
|
10075
10098
|
return;
|
|
@@ -10156,7 +10179,7 @@ __decorate([
|
|
|
10156
10179
|
__decorate([
|
|
10157
10180
|
Log(),
|
|
10158
10181
|
__metadata("design:type", Function),
|
|
10159
|
-
__metadata("design:paramtypes", [Object, Array]),
|
|
10182
|
+
__metadata("design:paramtypes", [Object, Array, Object]),
|
|
10160
10183
|
__metadata("design:returntype", Promise)
|
|
10161
10184
|
], WishlistHasuraGraphQLRepository.prototype, "findBfluOrGlamgirlWishlists", null);
|
|
10162
10185
|
|
|
@@ -11015,7 +11038,7 @@ class PagarMeV5RequestHelper {
|
|
|
11015
11038
|
.filter((item) => !item.isGift)
|
|
11016
11039
|
.map((item) => {
|
|
11017
11040
|
return {
|
|
11018
|
-
amount:
|
|
11041
|
+
amount: toCents(item.pricePaid),
|
|
11019
11042
|
description: isSubscriber ? `${item.name} - ASSINANTE` : item.name,
|
|
11020
11043
|
quantity: item.quantity,
|
|
11021
11044
|
code: item.EAN,
|
|
@@ -11052,7 +11075,7 @@ class PagarMeV5RequestHelper {
|
|
|
11052
11075
|
}
|
|
11053
11076
|
static buildShipping(checkout) {
|
|
11054
11077
|
return {
|
|
11055
|
-
amount:
|
|
11078
|
+
amount: toCents(checkout.shipping.ShippingPrice),
|
|
11056
11079
|
description: `${checkout.shipping.ShippingCompanyName} - ${checkout.shipping.description}`,
|
|
11057
11080
|
recipient_name: checkout.shippingAddress.recipient,
|
|
11058
11081
|
recipient_phone: checkout.user.phone,
|
|
@@ -11070,7 +11093,7 @@ class PagarMeV5RequestHelper {
|
|
|
11070
11093
|
return [
|
|
11071
11094
|
{
|
|
11072
11095
|
payment_method: method,
|
|
11073
|
-
amount:
|
|
11096
|
+
amount: toCents(checkout.totalPrice),
|
|
11074
11097
|
...(method === 'pix' && {
|
|
11075
11098
|
pix: this.getPixOrder(),
|
|
11076
11099
|
}),
|
|
@@ -11097,20 +11120,24 @@ class PagarMeV5RequestHelper {
|
|
|
11097
11120
|
};
|
|
11098
11121
|
}
|
|
11099
11122
|
static getCardOrder(checkout, card) {
|
|
11123
|
+
const billingAddress = {
|
|
11124
|
+
line_1: `${checkout.billingAddress.number}, ${checkout.billingAddress.street}, ${checkout.billingAddress.district}`,
|
|
11125
|
+
zip_code: checkout.billingAddress.zip,
|
|
11126
|
+
city: checkout.billingAddress.city,
|
|
11127
|
+
state: checkout.billingAddress.state,
|
|
11128
|
+
country: 'BR',
|
|
11129
|
+
};
|
|
11130
|
+
// Tokenized charges (e.g. shopping recurrence renewals) must not send empty/undefined CVV.
|
|
11131
|
+
// First checkout still passes cardCvv when the shopper types it.
|
|
11132
|
+
const cardPayload = {
|
|
11133
|
+
billing_address: billingAddress,
|
|
11134
|
+
...(card.cardCvv ? { cvv: card.cardCvv } : {}),
|
|
11135
|
+
};
|
|
11100
11136
|
return {
|
|
11101
11137
|
installments: card.installments,
|
|
11102
11138
|
statement_descriptor: checkout.shop === Shops.GLAMSHOP ? 'loja glam' : 'mens market',
|
|
11103
11139
|
card_id: card.cardId,
|
|
11104
|
-
card:
|
|
11105
|
-
cvv: card.cardCvv,
|
|
11106
|
-
billing_address: {
|
|
11107
|
-
line_1: `${checkout.billingAddress.number}, ${checkout.billingAddress.street}, ${checkout.billingAddress.district}`,
|
|
11108
|
-
zip_code: checkout.billingAddress.zip,
|
|
11109
|
-
city: checkout.billingAddress.city,
|
|
11110
|
-
state: checkout.billingAddress.state,
|
|
11111
|
-
country: 'BR',
|
|
11112
|
-
},
|
|
11113
|
-
},
|
|
11140
|
+
card: cardPayload,
|
|
11114
11141
|
};
|
|
11115
11142
|
}
|
|
11116
11143
|
static buildAdditionalInfo(checkout) {
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { FindRepositoryParams, RepositoryFindResult } from '../../generic';
|
|
1
|
+
import { FindRepositoryParams, RepositoryCacheOptions, RepositoryFindResult } from '../../generic';
|
|
2
2
|
import { Shops } from '../models';
|
|
3
3
|
import { Wishlist } from '../models/wishlist';
|
|
4
4
|
import { CategoryRepository } from '.';
|
|
5
5
|
export interface WishlistRepository extends CategoryRepository<Wishlist> {
|
|
6
6
|
getWishlistBySlug(slug: string): Promise<Wishlist>;
|
|
7
7
|
getWishlistByPerson(personId: string): Promise<Wishlist[]>;
|
|
8
|
-
findBfluOrGlamgirlWishlists(params: FindRepositoryParams<Wishlist>, shops: Shops[]
|
|
8
|
+
findBfluOrGlamgirlWishlists(params: FindRepositoryParams<Wishlist>, shops: Shops[], options?: {
|
|
9
|
+
cache?: RepositoryCacheOptions;
|
|
10
|
+
}): Promise<RepositoryFindResult<Wishlist>>;
|
|
9
11
|
addProduct(wishlistId: string, productId: string): Promise<void>;
|
|
10
12
|
removeProduct(wishlistId: string, productId: string): Promise<void>;
|
|
11
13
|
}
|
|
@@ -19,6 +19,10 @@ export declare class Checkout extends BaseModel<Checkout> {
|
|
|
19
19
|
glampoints?: number;
|
|
20
20
|
pointsUsed?: number;
|
|
21
21
|
pointsDiscount?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Why shippingDiscount was applied. Null/absent when no shipping discount.
|
|
24
|
+
*/
|
|
25
|
+
shippingDiscountSource?: 'threshold_sp' | 'coupon' | null;
|
|
22
26
|
lineItems?: LineItem[];
|
|
23
27
|
user?: User;
|
|
24
28
|
shippingAddress?: UserAddress;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Shops } from '../../../catalog/models/enums/shops.enum';
|
|
2
2
|
import { BaseModel, GenericIdentifier } from '../../../generic/model/base.model';
|
|
3
3
|
import { User, UserAddress } from '../../../users';
|
|
4
|
-
import { PaymentMethod } from '../../types';
|
|
5
|
-
import { PaymentProvider } from '../../types/payment-provider.type';
|
|
4
|
+
import { CardForPaymentInfo, PaymentMethod } from '../../types';
|
|
6
5
|
import { Coupon } from '../coupons/coupon';
|
|
7
6
|
import { ShoppingRecurrenceCycle } from '../enums/shopping-recurrence-cycle.enum';
|
|
8
7
|
import { ShoppingRecurrenceStatus } from '../enums/shopping-recurrence-status.enum';
|
|
@@ -23,10 +22,7 @@ export declare class ShoppingRecurrence extends BaseModel<ShoppingRecurrence> {
|
|
|
23
22
|
discount?: number;
|
|
24
23
|
totalPrice: number;
|
|
25
24
|
paymentMethod: PaymentMethod;
|
|
26
|
-
cards:
|
|
27
|
-
paymentProvider: PaymentProvider;
|
|
28
|
-
cardId: string;
|
|
29
|
-
}>;
|
|
25
|
+
cards: CardForPaymentInfo[];
|
|
30
26
|
originalOrderId: string;
|
|
31
27
|
lastOrderId?: string;
|
|
32
28
|
user: User;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type ShippingFreeShippingSource = 'edition' | 'threshold_sp';
|
|
1
2
|
export type ShippingMethodResponse = {
|
|
2
3
|
daysToDelivery: number;
|
|
3
4
|
currency?: string;
|
|
@@ -10,4 +11,16 @@ export type ShippingMethodResponse = {
|
|
|
10
11
|
additionalDescription?: string;
|
|
11
12
|
cnpj?: string;
|
|
12
13
|
ShippingCompanyName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Original quote before free-shipping zeroing (when a benefit applied).
|
|
16
|
+
*/
|
|
17
|
+
listTotalPrice?: number;
|
|
18
|
+
/**
|
|
19
|
+
* Cheapest non-Same Day quote at the time free shipping was evaluated.
|
|
20
|
+
*/
|
|
21
|
+
cheapestListTotalPrice?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Why free shipping was applied to this option (UI still shows totalPrice 0).
|
|
24
|
+
*/
|
|
25
|
+
freeShippingSource?: ShippingFreeShippingSource;
|
|
13
26
|
};
|
|
@@ -5,7 +5,7 @@ import { FirestoreRepository, FirestoreSubRepository } from '../types';
|
|
|
5
5
|
export declare const withHelpers: <TMixinBase extends MixinCtor<any, any[]> = MixinCtor<any, any[]>>(MixinBase: MixinCtor<any, any[]> & TMixinBase) => {
|
|
6
6
|
new (...args: any[]): {
|
|
7
7
|
[x: string]: any;
|
|
8
|
-
toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T
|
|
8
|
+
toArray<T extends ModelBaseStructure<T, T["identifiersFields"][number]>>(snapShot: QuerySnapshot<T> | QueryDocumentSnapshot<T>[]): T[];
|
|
9
9
|
isSubCollection<T_1 extends ModelBaseStructure<T_1, T_1["identifiersFields"][number]>, E extends ModelBaseStructure<E, E["identifiersFields"][number]>>(repository: FirestoreRepository<T_1> | FirestoreSubRepository<T_1, E>): repository is FirestoreSubRepository<T_1, E>;
|
|
10
10
|
};
|
|
11
11
|
} & TMixinBase;
|
package/src/infra/hasura-graphql/repositories/catalog/helpers/wishlist-listing-find.helper.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FindRepositoryParams, NonFunctionPropertyNames, RepositoryCacheOptions, Shops } from '../../../../../domain';
|
|
2
|
+
import { WishlistHasuraGraphQL } from '../../../models/wishlist-hasura-graphql';
|
|
3
|
+
export declare const BFLU_OR_GLAMGIRL_WISHLIST_LISTING_FIELDS: NonFunctionPropertyNames<WishlistHasuraGraphQL>[];
|
|
4
|
+
export declare const BFLU_OR_GLAMGIRL_WISHLIST_CACHE_DEFAULT: RepositoryCacheOptions;
|
|
5
|
+
export declare function resolveBfluOrGlamgirlWishlistCacheOptions(options?: {
|
|
6
|
+
cache?: RepositoryCacheOptions;
|
|
7
|
+
}): {
|
|
8
|
+
cache?: RepositoryCacheOptions;
|
|
9
|
+
};
|
|
10
|
+
export declare function buildBfluOrGlamgirlWishlistFindParams(params: FindRepositoryParams<WishlistHasuraGraphQL>, shops: Shops[]): FindRepositoryParams<WishlistHasuraGraphQL>;
|
package/src/infra/hasura-graphql/repositories/catalog/wishlist-hasura-graphql.repository.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Category, CreateRepositoryParams, FindRepositoryParams, GetRepositoryParams, Product, RepositoryFindResult, Shops, UpdateRepositoryParams, Wishlist, WishlistRepository } from '../../../../domain';
|
|
1
|
+
import { Category, CreateRepositoryParams, FindRepositoryParams, GetRepositoryParams, Product, RepositoryCacheOptions, RepositoryFindResult, Shops, UpdateRepositoryParams, Wishlist, WishlistRepository } from '../../../../domain';
|
|
2
2
|
import { HasuraConstructorParams } from '../../mixins';
|
|
3
3
|
import { WishlistHasuraGraphQL } from '../../models/wishlist-hasura-graphql';
|
|
4
4
|
import { CategoryProductHasuraGraphQLRepository } from './category-product-hasura-graphql.repository';
|
|
@@ -8,13 +8,17 @@ export declare class WishlistHasuraGraphQLRepository extends WishlistHasuraGraph
|
|
|
8
8
|
constructor({ endpoint, authOptions, interceptors, cache, }: Pick<HasuraConstructorParams<Wishlist>, 'endpoint' | 'authOptions' | 'interceptors' | 'cache'>, categoryProductRepository: CategoryProductHasuraGraphQLRepository);
|
|
9
9
|
create(params: CreateRepositoryParams<WishlistHasuraGraphQL>): Promise<WishlistHasuraGraphQL>;
|
|
10
10
|
get(identifiers: GetRepositoryParams<WishlistHasuraGraphQL>): Promise<WishlistHasuraGraphQL>;
|
|
11
|
-
find(params?: FindRepositoryParams<WishlistHasuraGraphQL
|
|
11
|
+
find(params?: FindRepositoryParams<WishlistHasuraGraphQL>, options?: {
|
|
12
|
+
cache?: RepositoryCacheOptions;
|
|
13
|
+
}): Promise<RepositoryFindResult<WishlistHasuraGraphQL>>;
|
|
12
14
|
update(params: UpdateRepositoryParams<WishlistHasuraGraphQL>): Promise<WishlistHasuraGraphQL>;
|
|
13
15
|
getWishlistBySlug(slug: string): Promise<WishlistHasuraGraphQL>;
|
|
14
16
|
getWishlistByPerson(personId: string): Promise<WishlistHasuraGraphQL[]>;
|
|
15
17
|
getCategoryBySlug(slug: string, _shop: Shops): Promise<Wishlist>;
|
|
16
18
|
getCategoryByShop(shop: string): Promise<any>;
|
|
17
|
-
findBfluOrGlamgirlWishlists(params: FindRepositoryParams<WishlistHasuraGraphQL>, shops: Shops[]
|
|
19
|
+
findBfluOrGlamgirlWishlists(params: FindRepositoryParams<WishlistHasuraGraphQL>, shops: Shops[], options?: {
|
|
20
|
+
cache?: RepositoryCacheOptions;
|
|
21
|
+
}): Promise<RepositoryFindResult<WishlistHasuraGraphQL>>;
|
|
18
22
|
getCategoriesForHome(): Promise<{
|
|
19
23
|
category: Category;
|
|
20
24
|
products: Product[];
|
|
@@ -65,7 +65,8 @@ export type PagarMeV5OrderPaymentCardInfo = {
|
|
|
65
65
|
statement_descriptor: string;
|
|
66
66
|
card_id: string;
|
|
67
67
|
card: {
|
|
68
|
-
|
|
68
|
+
/** Present only on first charge when the shopper types CVV. Omitted for tokenized renewals. */
|
|
69
|
+
cvv?: string;
|
|
69
70
|
billing_address?: {
|
|
70
71
|
line_1: string;
|
|
71
72
|
zip_code: string;
|
package/src/test.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|