dcos-core-monalisav2-latam 1.0.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/README.md +130 -0
- package/index.js +350 -0
- package/package.json +52 -0
- package/src/auth/handler.js +3 -0
- package/src/common/MondelezCastOrder.js +449 -0
- package/src/common/utils/AuthSecurity.js +46 -0
- package/src/common/utils/account-error-handler.js +279 -0
- package/src/common/utils/account-error-helper.js +231 -0
- package/src/common/utils/account-properties-handler.js +355 -0
- package/src/common/utils/api-response.js +62 -0
- package/src/common/utils/aws-services.js +186 -0
- package/src/common/utils/constants/account-error-codes.json +801 -0
- package/src/common/utils/constants.js +37 -0
- package/src/common/utils/convert/MondelezClientsItemsCast.js +52 -0
- package/src/common/utils/convert/MondelezInventoryItemsCast.js +15 -0
- package/src/common/utils/convert/MondelezOrderStatusCast.js +34 -0
- package/src/common/utils/convert/MondelezPricesItemsCast.js +37 -0
- package/src/common/utils/cron-ftp-get.js +143 -0
- package/src/common/utils/data-tables-helper.js +213 -0
- package/src/common/utils/date-range-calculator.js +113 -0
- package/src/common/utils/delay.js +17 -0
- package/src/common/utils/ftp-sftp.js +320 -0
- package/src/common/utils/logger.js +126 -0
- package/src/common/utils/nodemailerLib.js +61 -0
- package/src/common/utils/product-unit-converter.js +168 -0
- package/src/common/utils/schemas-utils.js +101 -0
- package/src/common/utils/seller-email-sharing-service.js +441 -0
- package/src/common/utils/sftp-utils.js +202 -0
- package/src/common/utils/status.js +15 -0
- package/src/common/utils/util.js +236 -0
- package/src/common/utils/validate-state-order.js +35 -0
- package/src/common/utils/validateProviders.js +67 -0
- package/src/common/utils/validation-data.js +45 -0
- package/src/common/utils/vtex/save-hooks.js +65 -0
- package/src/common/utils/vtex/save-schemas.js +65 -0
- package/src/common/utils/vtex-hook-handler.js +71 -0
- package/src/common/validation/AccountCoordinatesValidation.js +350 -0
- package/src/common/validation/GeneralErrorValidation.js +11 -0
- package/src/common/validation/MainErrorValidation.js +8 -0
- package/src/entities/account.js +639 -0
- package/src/entities/clients.js +104 -0
- package/src/entities/controlprice.js +196 -0
- package/src/entities/controlstock.js +206 -0
- package/src/entities/cron.js +77 -0
- package/src/entities/cronjob.js +71 -0
- package/src/entities/orders.js +195 -0
- package/src/entities/sftp-inbound.js +88 -0
- package/src/entities/sku.js +220 -0
- package/src/entities/taxpromotion.js +249 -0
- package/src/functions/account/account-get.js +262 -0
- package/src/functions/account/account-handler.js +299 -0
- package/src/functions/account/clients.js +10 -0
- package/src/functions/account/index.js +208 -0
- package/src/functions/actions/save-promotions-order-history.js +324 -0
- package/src/functions/affiliates/affiliates-hook-consumer.js +87 -0
- package/src/functions/affiliates/affiliates-hook-producer.js +45 -0
- package/src/functions/clients/clients-audience.js +62 -0
- package/src/functions/clients/clients-consumer.js +648 -0
- package/src/functions/clients/clients-producer.js +362 -0
- package/src/functions/clients/clients-suggested-product-consumer.js +166 -0
- package/src/functions/clients/helpers/suggested-product-mdlz.js +233 -0
- package/src/functions/clients_peru/email.html +129 -0
- package/src/functions/clients_peru/splitfile.js +357 -0
- package/src/functions/clients_peru/updateClients.js +1334 -0
- package/src/functions/clients_peru/utils.js +243 -0
- package/src/functions/cronjobs/cron-jobs-manager.js +40 -0
- package/src/functions/cronjobs/cron-jobs.js +171 -0
- package/src/functions/crons/cron.js +39 -0
- package/src/functions/distributors/distributor-handler.js +81 -0
- package/src/functions/distributors/distributor.js +535 -0
- package/src/functions/distributors/index.js +60 -0
- package/src/functions/financialpolicy/assign-financialpolicy.js +111 -0
- package/src/functions/financialpolicy/get-financialpolicy.js +91 -0
- package/src/functions/financialpolicy/index.js +28 -0
- package/src/functions/inventory/catalog-sync-consumer.js +17 -0
- package/src/functions/inventory/catalog-sync-handler.js +311 -0
- package/src/functions/inventory/inventory-consumer.js +119 -0
- package/src/functions/inventory/inventory-producer.js +197 -0
- package/src/functions/multiPresentation/multipre-queue.js +155 -0
- package/src/functions/multiPresentation/multipres.js +459 -0
- package/src/functions/nodeflow/index.js +83 -0
- package/src/functions/nodeflow/nodeflow-cron.js +200 -0
- package/src/functions/nodeflow/nodeflow-pub.js +203 -0
- package/src/functions/nodeflow/nodeflow-pvt.js +266 -0
- package/src/functions/notifications/download-leads-handler.js +67 -0
- package/src/functions/notifications/new-leads-notification-consumer.js +17 -0
- package/src/functions/notifications/new-leads-notification-handler.js +359 -0
- package/src/functions/notifications/order-status-notification-handler.js +482 -0
- package/src/functions/notifications/promotion-notification-handler.js +193 -0
- package/src/functions/orders/index.js +32 -0
- package/src/functions/orders/orders-cancel-handler.js +74 -0
- package/src/functions/orders/orders-handler.js +280 -0
- package/src/functions/orders/orders-hook-consumer.js +137 -0
- package/src/functions/orders/orders-hook-producer.js +170 -0
- package/src/functions/orders/orders-notifications-handler.js +137 -0
- package/src/functions/orders/orders-status-consumer.js +461 -0
- package/src/functions/orders/orders-status-producer.js +443 -0
- package/src/functions/prices/index.js +75 -0
- package/src/functions/prices/prices-consumer.js +236 -0
- package/src/functions/prices/prices-producer.js +323 -0
- package/src/functions/prices/promotion-and-tax.js +1284 -0
- package/src/functions/routesflow/assign-routeflow-queue.js +77 -0
- package/src/functions/schemas/vtex/handle-schemas.js +102 -0
- package/src/functions/security/process_gas.js +221 -0
- package/src/functions/security/security-handler.js +950 -0
- package/src/functions/sftp/sftp-consumer.js +453 -0
- package/src/functions/sftpIntegrations/processes/redirectServices.js +184 -0
- package/src/functions/sftpIntegrations/processes/validateFileSchema.js +226 -0
- package/src/functions/sftpIntegrations/schemas/credential-schema.js +123 -0
- package/src/functions/sftpIntegrations/schemas/record-schema.js +131 -0
- package/src/functions/sftpIntegrations/schemas/sftp_required_fields.json +3 -0
- package/src/functions/sftpIntegrations/sftp-config-producer.js +112 -0
- package/src/functions/sftpIntegrations/sftp-consumer.js +700 -0
- package/src/functions/sftpIntegrations/test/validateFile.test.js +122 -0
- package/src/functions/sftpIntegrations/utils/connect-dynamo.js +29 -0
- package/src/functions/sftpIntegrations/utils/split-data.js +25 -0
- package/src/functions/utils/index.js +130 -0
- package/src/functions/vtex/vtex-helpers.js +694 -0
- package/src/integrations/accountErrors/AccountErrorManager.js +437 -0
- package/src/integrations/audience/Audience.js +70 -0
- package/src/integrations/financialPolicy/FinancialPolicyApi.js +377 -0
- package/src/integrations/index.js +0 -0
- package/src/integrations/mobilvendor/MobilvendorApi.js +405 -0
- package/src/integrations/productmultipresentation/ProductMultiPresentation.js +200 -0
- package/src/mdlz/auth/SecretManagerApi.js +77 -0
- package/src/mdlz/client/MdlzApi.js +70 -0
- package/src/vtex/clients/ProvidersApi.js +51 -0
- package/src/vtex/clients/VtexApi.js +511 -0
- package/src/vtex/models/VtexOrder.js +87 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
class VtexOrder {
|
|
2
|
+
constructor(json) {
|
|
3
|
+
this.orderId = json.orderId;
|
|
4
|
+
this.sequence = json.sequence;
|
|
5
|
+
this.marketplaceOrderId = json.marketplaceOrderId;
|
|
6
|
+
this.marketplaceServicesEndpoint = json.marketplaceServicesEndpoint;
|
|
7
|
+
this.sellerOrderId = json.sellerOrderId;
|
|
8
|
+
this.origin = json.origin;
|
|
9
|
+
this.affiliateId = json.affiliateId;
|
|
10
|
+
this.salesChannel = json.salesChannel;
|
|
11
|
+
this.merchantName = json.merchantName;
|
|
12
|
+
this.status = json.status;
|
|
13
|
+
this.statusDescription = json.statusDescription;
|
|
14
|
+
this.value = json.value;
|
|
15
|
+
this.creationDate = json.creationDate;
|
|
16
|
+
this.lastChange = json.lastChange;
|
|
17
|
+
this.orderGroup = json.orderGroup;
|
|
18
|
+
this.totals = json.totals.map((total) => {
|
|
19
|
+
return { id: total.id, name: total.name, value: total.value };
|
|
20
|
+
});
|
|
21
|
+
this.items = json.items.map((item) => {
|
|
22
|
+
return {
|
|
23
|
+
uniqueId: item.uniqueId,
|
|
24
|
+
id: item.id,
|
|
25
|
+
productId: item.productId,
|
|
26
|
+
ean: item.ean,
|
|
27
|
+
lockId: item.lockId,
|
|
28
|
+
itemAttachment: item.itemAttachment,
|
|
29
|
+
attachments: item.attachments,
|
|
30
|
+
quantity: item.quantity,
|
|
31
|
+
seller: item.seller,
|
|
32
|
+
name: item.name,
|
|
33
|
+
refId: item.refId,
|
|
34
|
+
price: item.price,
|
|
35
|
+
listPrice: item.listPrice,
|
|
36
|
+
manualPrice: item.manualPrice,
|
|
37
|
+
priceTags: item.priceTags,
|
|
38
|
+
imageUrl: item.imageUrl,
|
|
39
|
+
detailUrl: item.detailUrl,
|
|
40
|
+
components: item.components,
|
|
41
|
+
bundleItems: item.bundleItems,
|
|
42
|
+
params: item.params,
|
|
43
|
+
offerings: item.offerings,
|
|
44
|
+
sellerSku: item.sellerSku,
|
|
45
|
+
priceValidUntil: item.priceValidUntil,
|
|
46
|
+
commission: item.commission,
|
|
47
|
+
tax: item.tax,
|
|
48
|
+
preSaleDate: item.preSaleDate,
|
|
49
|
+
additionalInfo: item.additionalInfo,
|
|
50
|
+
measurementUnit: item.measurementUnit,
|
|
51
|
+
unitMultiplier: item.unitMultiplier,
|
|
52
|
+
sellingPrice: item.sellingPrice,
|
|
53
|
+
isGift: item.isGift,
|
|
54
|
+
shippingPrice: item.shippingPrice,
|
|
55
|
+
rewardValue: item.rewardValue,
|
|
56
|
+
freightCommission: item.freightCommission,
|
|
57
|
+
priceDefinition: item.priceDefinition,
|
|
58
|
+
taxCode: item.taxCode,
|
|
59
|
+
parentItemIndex: item.parentItemIndex,
|
|
60
|
+
parentAssemblyBinding: item.parentAssemblyBinding,
|
|
61
|
+
callCenterOperator: item.callCenterOperator,
|
|
62
|
+
serialNumbers: item.serialNumbers,
|
|
63
|
+
assemblies: item.assemblies,
|
|
64
|
+
costPrice: item.costPrice,
|
|
65
|
+
};
|
|
66
|
+
});
|
|
67
|
+
this.marketplaceItems = json.marketplaceItems;
|
|
68
|
+
this.clientProfileData = {
|
|
69
|
+
id: json.clientProfileData.id,
|
|
70
|
+
email: json.clientProfileData.email,
|
|
71
|
+
firstName: json.clientProfileData.firstName,
|
|
72
|
+
lastName: json.clientProfileData.lastName,
|
|
73
|
+
documentType: json.clientProfileData.documentType,
|
|
74
|
+
document: json.clientProfileData.document,
|
|
75
|
+
phone: json.clientProfileData.phone,
|
|
76
|
+
corporateName: json.clientProfileData.corporateName,
|
|
77
|
+
tradeName: json.clientProfileData.tradeName,
|
|
78
|
+
corporateDocument: json.clientProfileData.corporateDocument,
|
|
79
|
+
stateInscription: json.clientProfileData.stateInscription,
|
|
80
|
+
corporatePhone: json.clientProfileData.corporatePhone,
|
|
81
|
+
isCorporate: json.clientProfileData.isCorporate,
|
|
82
|
+
userProfileId: json.clientProfileData.userProfileId,
|
|
83
|
+
customerClass: json.clientProfileData.customerClass,
|
|
84
|
+
gender: json.clientProfileData.gender,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|