crmbonus-component-wake 1.0.42 → 1.0.43

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.
Files changed (31) hide show
  1. package/dist/cjs/app-modal_4.cjs.entry.js +1 -1
  2. package/dist/cjs/crm-bonus.cjs.entry.js +1 -1
  3. package/dist/cjs/{crmbonus.service-e92b7283.js → crmbonus.service-ad521d7d.js} +3 -3
  4. package/dist/{esm/crmbonus.service-8324c3ea.js.map → cjs/crmbonus.service-ad521d7d.js.map} +1 -1
  5. package/dist/cjs/pedido-finalizado.cjs.entry.js +1 -1
  6. package/dist/collection/services/crmbonus.service.js +2 -2
  7. package/dist/collection/services/crmbonus.service.js.map +1 -1
  8. package/dist/components/crm-bonus-form.js +1 -1
  9. package/dist/components/crm-bonus.js +2 -2
  10. package/dist/components/{p-6d1a378d.js → p-0ebfe0d3.js} +2 -2
  11. package/dist/components/{p-6d1a378d.js.map → p-0ebfe0d3.js.map} +1 -1
  12. package/dist/components/{p-8a7e31bd.js → p-aeaad64e.js} +3 -3
  13. package/dist/components/p-aeaad64e.js.map +1 -0
  14. package/dist/components/pedido-finalizado.js +1 -1
  15. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +1 -1
  16. package/dist/crmbonus-component-wake/{p-68622d7c.entry.js → p-04db24fc.entry.js} +2 -2
  17. package/dist/crmbonus-component-wake/{p-4c4f6c05.entry.js → p-60249052.entry.js} +2 -2
  18. package/dist/crmbonus-component-wake/{p-6006b4d8.entry.js → p-6de2e9c3.entry.js} +2 -2
  19. package/dist/crmbonus-component-wake/{p-8a7e31bd.js → p-aeaad64e.js} +2 -2
  20. package/dist/crmbonus-component-wake/{p-8a7e31bd.js.map → p-aeaad64e.js.map} +1 -1
  21. package/dist/esm/app-modal_4.entry.js +1 -1
  22. package/dist/esm/crm-bonus.entry.js +1 -1
  23. package/dist/esm/{crmbonus.service-8324c3ea.js → crmbonus.service-dda2d96b.js} +3 -3
  24. package/dist/esm/crmbonus.service-dda2d96b.js.map +1 -0
  25. package/dist/esm/pedido-finalizado.entry.js +1 -1
  26. package/package.json +1 -1
  27. package/dist/cjs/crmbonus.service-e92b7283.js.map +0 -1
  28. package/dist/components/p-8a7e31bd.js.map +0 -1
  29. /package/dist/crmbonus-component-wake/{p-68622d7c.entry.js.map → p-04db24fc.entry.js.map} +0 -0
  30. /package/dist/crmbonus-component-wake/{p-4c4f6c05.entry.js.map → p-60249052.entry.js.map} +0 -0
  31. /package/dist/crmbonus-component-wake/{p-6006b4d8.entry.js.map → p-6de2e9c3.entry.js.map} +0 -0
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-52d8a075.js');
6
- const crmbonus_service = require('./crmbonus.service-e92b7283.js');
6
+ const crmbonus_service = require('./crmbonus.service-ad521d7d.js');
7
7
 
8
8
  const Pedido = class {
9
9
  constructor(hostRef) {
@@ -11,12 +11,12 @@ export class CrmBonusService {
11
11
  });
12
12
  }
13
13
  async getCustomer(userId, store) {
14
- const response = await this.axiosInstance.get(`/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } });
14
+ const response = await this.axiosInstance.get(`/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } });
15
15
  console.log('response.data', response.data);
16
16
  return response.data;
17
17
  }
18
18
  async updateOrder(updateOrderDTO) {
19
- const response = await this.axiosInstance.patch(`/api/checkouts/${updateOrderDTO.cartId}/updateOrder`, {
19
+ const response = await this.axiosInstance.patch(`/checkouts/${updateOrderDTO.cartId}/updateOrder`, {
20
20
  orderId: updateOrderDTO.orderId,
21
21
  externalId: updateOrderDTO.cartIdCrm
22
22
  }, { headers: { 'Content-Type': 'application/json' } });
@@ -1 +1 @@
1
- {"version":3,"file":"crmbonus.service.js","sourceRoot":"","sources":["../../../src/services/crmbonus.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAA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AE,KAAK,EAAE,EAAE,CAAC,CAAC;QAClJ,OAAO;YACH,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,OAAO;YAC9B,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM;SAC/B,CAAA;IACL,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,OAA4B,EAAE,KAAa;QAC9D,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;QAE/G,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAoB;QAC9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;QAClF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,KAAa;QACtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,8BAA8B,EAAE;YAC3E,MAAM,EAAE,MAAM;SACjB,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ","sourcesContent":["import axios, { AxiosInstance } from 'axios';\nimport { CRM_BONUS_API_URL } from '../../env'\nimport { IPinSent } from '../dto/pin.sent';\nimport { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';\nimport { UpdateOrderDTO } from '../dto/update.order.dto';\n\nexport class CrmBonusService {\n private axiosInstance: AxiosInstance;\n\n constructor() {\n this.axiosInstance = axios.create({\n baseURL: CRM_BONUS_API_URL,\n headers: {\n 'Content-Type': 'application/json',\n 'accept': 'application/json',\n },\n });\n }\n\n async getCustomer(userId: number, store: string) {\n const response = await this.axiosInstance.get(`/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } })\n console.log('response.data', response.data)\n return response.data\n }\n\n async updateOrder(updateOrderDTO: UpdateOrderDTO){\n const response = await this.axiosInstance.patch(`/api/checkouts/${updateOrderDTO.cartId}/updateOrder`, \n { \n orderId: updateOrderDTO.orderId,\n externalId: updateOrderDTO.cartIdCrm\n }, { headers: { 'Content-Type': 'application/json' } })\n\n console.log('response', response.data)\n \n }\n\n async sendPin(phone: number, name: string, store: string): Promise<IPinSent> {\n const response = await this.axiosInstance.post(\"/crmbonus/send-pin\", { cellphone: phone, name: name, storeName: store }, { headers: { store } });\n return {\n storeId: response.data.storeId,\n userId: response.data.userId\n }\n }\n\n async validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus> {\n console.log('[validatePinBonus]', payload);\n\n const response = await this.axiosInstance.post(\"/crmbonus/process-pin-bonus\", payload, { headers: { store } })\n\n return response.data;\n }\n\n async reserve(payload: IReserveDTO) {\n const response = await this.axiosInstance.post(\"/crmbonus/redeem-bonus\", payload);\n return response.data;\n }\n\n async cancel(cartId: string, store: string) {\n const response = await this.axiosInstance.post(\"/crmbonus/cancel-apply-bonus\", {\n ticket: cartId\n }, { headers: { store } });\n return response.data;\n }\n}"]}
1
+ {"version":3,"file":"crmbonus.service.js","sourceRoot":"","sources":["../../../src/services/crmbonus.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,OAAO,eAAe;IAGxB;QACI,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;YAC9B,OAAO,EAAE,iBAAiB;YAC1B,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,QAAQ,EAAE,kBAAkB;aAC7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O,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,CAAC;QAE3C,MAAM,QAAQ,GAAI,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,6BAA6B,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAA;QAE/G,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,OAAO,CAAC,OAAoB;QAC9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC;QAClF,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,KAAa;QACtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,8BAA8B,EAAE;YAC3E,MAAM,EAAE,MAAM;SACjB,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QAC3B,OAAO,QAAQ,CAAC,IAAI,CAAC;IACzB,CAAC;CACJ","sourcesContent":["import axios, { AxiosInstance } from 'axios';\nimport { CRM_BONUS_API_URL } from '../../env'\nimport { IPinSent } from '../dto/pin.sent';\nimport { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';\nimport { UpdateOrderDTO } from '../dto/update.order.dto';\n\nexport class CrmBonusService {\n private axiosInstance: AxiosInstance;\n\n constructor() {\n this.axiosInstance = axios.create({\n baseURL: CRM_BONUS_API_URL,\n headers: {\n 'Content-Type': 'application/json',\n 'accept': 'application/json',\n },\n });\n }\n\n async getCustomer(userId: number, store: string) {\n const response = await this.axiosInstance.get(`/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } })\n console.log('response.data', response.data)\n return response.data\n }\n\n async updateOrder(updateOrderDTO: UpdateOrderDTO){\n const response = await this.axiosInstance.patch(`/checkouts/${updateOrderDTO.cartId}/updateOrder`, \n { \n orderId: updateOrderDTO.orderId,\n externalId: updateOrderDTO.cartIdCrm\n }, { headers: { 'Content-Type': 'application/json' } })\n\n console.log('response', response.data)\n \n }\n\n async sendPin(phone: number, name: string, store: string): Promise<IPinSent> {\n const response = await this.axiosInstance.post(\"/crmbonus/send-pin\", { cellphone: phone, name: name, storeName: store }, { headers: { store } });\n return {\n storeId: response.data.storeId,\n userId: response.data.userId\n }\n }\n\n async validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus> {\n console.log('[validatePinBonus]', payload);\n\n const response = await this.axiosInstance.post(\"/crmbonus/process-pin-bonus\", payload, { headers: { store } })\n\n return response.data;\n }\n\n async reserve(payload: IReserveDTO) {\n const response = await this.axiosInstance.post(\"/crmbonus/redeem-bonus\", payload);\n return response.data;\n }\n\n async cancel(cartId: string, store: string) {\n const response = await this.axiosInstance.post(\"/crmbonus/cancel-apply-bonus\", {\n ticket: cartId\n }, { headers: { store } });\n return response.data;\n }\n}"]}
@@ -1,4 +1,4 @@
1
- import { C as CrmBonusForm$1, d as defineCustomElement$1 } from './p-6d1a378d.js';
1
+ import { C as CrmBonusForm$1, d as defineCustomElement$1 } from './p-0ebfe0d3.js';
2
2
 
3
3
  const CrmBonusForm = CrmBonusForm$1;
4
4
  const defineCustomElement = defineCustomElement$1;
@@ -1,6 +1,6 @@
1
1
  import { p as proxyCustomElement, H, h } from './p-faf7103e.js';
2
- import { C as CrmBonusService } from './p-8a7e31bd.js';
3
- import { d as defineCustomElement$a, S as StepFormEnum } from './p-6d1a378d.js';
2
+ import { C as CrmBonusService } from './p-aeaad64e.js';
3
+ import { d as defineCustomElement$a, S as StepFormEnum } from './p-0ebfe0d3.js';
4
4
  import { d as defineCustomElement$b } from './p-1dbb0f43.js';
5
5
  import { d as defineCustomElement$9 } from './p-530006e6.js';
6
6
  import { d as defineCustomElement$8 } from './p-0e99f907.js';
@@ -1,5 +1,5 @@
1
1
  import { p as proxyCustomElement, H, h, d as Host } from './p-faf7103e.js';
2
- import { C as CrmBonusService } from './p-8a7e31bd.js';
2
+ import { C as CrmBonusService } from './p-aeaad64e.js';
3
3
  import { d as defineCustomElement$5 } from './p-530006e6.js';
4
4
  import { d as defineCustomElement$4 } from './p-0e99f907.js';
5
5
  import { d as defineCustomElement$3 } from './p-e2727638.js';
@@ -169,4 +169,4 @@ defineCustomElement();
169
169
 
170
170
  export { CrmBonusForm as C, StepFormEnum as S, defineCustomElement as d };
171
171
 
172
- //# sourceMappingURL=p-6d1a378d.js.map
172
+ //# sourceMappingURL=p-0ebfe0d3.js.map
@@ -1 +1 @@
1
- {"file":"p-6d1a378d.js","mappings":";;;;;;;;IAAY;AAAZ,WAAY,YAAY;IACpB,yDAAa,CAAA;IACb,2DAAc,CAAA;IACd,uDAAY,CAAA;IACZ,+DAAgB,CAAA;IAChB,2DAAc,CAAA;AAClB,CAAC,EANW,YAAY,KAAZ,YAAY;;ACAxB,MAAM,eAAe,GAAG,wOAAwO,CAAC;AACjQ,2BAAe,eAAe;;MCUjB,YAAY;;;;;QAEb,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;;;;wBAKnC;YAC1B,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;SACX;;;;;;;;uBAY2B,KAAK;oBAET,YAAY,CAAC,SAAS;;;;IAO9C,MAAM,OAAO,CAAC,IAAkB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;KACnB;IAEM,MAAM,aAAa,CAAC,GAAW;;QAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,MAAM,OAAO,GAAwB;YACjC,GAAG,EAAE,GAAG;YACR,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YAChC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,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GAAI,EACrN,IAAI,CAAC,IAAI,KAAK,YAAY,CAAC,UAAU,IAAI,yEAAmB,EAC7D,0DAAG,KAAK,EAAC,eAAe,IAAE,IAAI,CAAC,OAAO,CAAK,CACxC,EACV;KACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/contants/index.ts","src/components/crm-bonus-form/crm-bonus-form.css?tag=crm-bonus-form&encapsulation=shadow","src/components/crm-bonus-form/crm-bonus-form.tsx"],"sourcesContent":["export enum StepFormEnum {\n STEP_NAME = 0,\n STEP_PHONE = 1,\n STEP_PIN = 2,\n STEP_RESERVE = 3,\n STEP_APPLY = 4\n}",".form-container {\n width: 100%;\n display: flex;\n justify-content: center;\n justify-content: space-around;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.message-error {\n color: #d11111;\n font-weight: bold;\n font-family: Arial;\n font-size: small;\n margin-left: 16px;\n}","import { Component, Host, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent';\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() sent: IPinSent;\n @Prop() stepNext: StepFormEnum;\n @Prop() phone: number;\n @Prop() loadingModal: boolean;\n\n @Prop() saveStore: (amount: number) => void;\n\n @Prop() cancel: () => void;\n\n @Prop() handleCustomerName: (name: string) => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_NAME;\n\n @State() message: string;\n\n @State() bonus: IBonus;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n storeId: this.sent.storeId.toString(),\n userId: this.sent.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: null,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n this.step = StepFormEnum.STEP_APPLY;\n\n this.saveStore(amount);\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserve(amount: number) {\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {/* {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />} */}\n \n {this.step == StepFormEnum.STEP_NAME && <name-input loading={this.loadingModal} value={this.customer.name} applyName={(name) => this.handleCustomerName(name)} />}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"],"version":3}
1
+ {"file":"p-0ebfe0d3.js","mappings":";;;;;;;;IAAY;AAAZ,WAAY,YAAY;IACpB,yDAAa,CAAA;IACb,2DAAc,CAAA;IACd,uDAAY,CAAA;IACZ,+DAAgB,CAAA;IAChB,2DAAc,CAAA;AAClB,CAAC,EANW,YAAY,KAAZ,YAAY;;ACAxB,MAAM,eAAe,GAAG,wOAAwO,CAAC;AACjQ,2BAAe,eAAe;;MCUjB,YAAY;;;;;QAEb,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;;;;wBAKnC;YAC1B,KAAK,EAAE,EAAE;YACT,SAAS,EAAE,EAAE;YACb,QAAQ,EAAE,EAAE;YACZ,IAAI,EAAE,EAAE;SACX;;;;;;;;uBAY2B,KAAK;oBAET,YAAY,CAAC,SAAS;;;;IAO9C,MAAM,OAAO,CAAC,IAAkB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;KACnB;IAEM,MAAM,aAAa,CAAC,GAAW;;QAClC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,MAAM,OAAO,GAAwB;YACjC,GAAG,EAAE,GAAG;YACR,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YAChC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACrC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;YACnC,UAAU,EAAE,IAAI,CAAC,MAAM;YACvB,gBAAgB,EAAE,IAAI,CAAC,QAAQ;YAC/B,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,IAAI,CAAC,SAAS;SAC5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;;;;;;","names":[],"sources":["src/contants/index.ts","src/components/crm-bonus-form/crm-bonus-form.css?tag=crm-bonus-form&encapsulation=shadow","src/components/crm-bonus-form/crm-bonus-form.tsx"],"sourcesContent":["export enum StepFormEnum {\n STEP_NAME = 0,\n STEP_PHONE = 1,\n STEP_PIN = 2,\n STEP_RESERVE = 3,\n STEP_APPLY = 4\n}",".form-container {\n width: 100%;\n display: flex;\n justify-content: center;\n justify-content: space-around;\n}\n\n.disabled {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.message-error {\n color: #d11111;\n font-weight: bold;\n font-family: Arial;\n font-size: small;\n margin-left: 16px;\n}","import { Component, Host, Method, Prop, State, h } from \"@stencil/core\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\nimport { IBonus, ICustomer, IProccesPinBonusDto, IProduct } from \"../../dto/validate.pin.bonus\";\nimport { StepFormEnum } from \"../../contants\";\nimport { IPinSent } from '../../dto/pin.sent';\n\n@Component({\n tag: 'crm-bonus-form',\n styleUrl: 'crm-bonus-form.css',\n shadow: true\n})\nexport class CrmBonusForm {\n\n private crmBonusService: CrmBonusService = new CrmBonusService();\n\n @Prop({ attribute: 'storename' }) storeName;\n @Prop() cartId;\n @Prop() products: Array<IProduct>;\n @Prop() customer: ICustomer = {\n phone: \"\",\n birthDate: \"\",\n document: \"\",\n name: \"\"\n };\n @Prop() sent: IPinSent;\n @Prop() stepNext: StepFormEnum;\n @Prop() phone: number;\n @Prop() loadingModal: boolean;\n\n @Prop() saveStore: (amount: number) => void;\n\n @Prop() cancel: () => void;\n\n @Prop() handleCustomerName: (name: string) => void;\n\n @State() loading: boolean = false;\n\n @State() step: number = StepFormEnum.STEP_NAME;\n\n @State() message: string;\n\n @State() bonus: IBonus;\n\n @Method()\n async setStep(step: StepFormEnum) {\n this.step = step\n }\n\n public async validateBonus(pin: string) {\n this.loading = true;\n this.message = \"\";\n const payload: IProccesPinBonusDto = {\n pin: pin,\n cellphone: this.phone.toString(),\n storeId: this.sent.storeId.toString(),\n userId: this.sent.userId.toString(),\n checkoutId: this.cartId,\n checkoutProducts: this.products,\n name: null,\n storeName: this.storeName\n }\n\n try {\n this.bonus = await this.crmBonusService.validatePinBonus(payload, this.storeName);\n\n console.log('[this.bonus]', this.bonus);\n this.step = StepFormEnum.STEP_RESERVE;\n } catch (error) {\n this.message = error?.response?.data?.message\n } finally {\n this.loading = false;\n }\n console.log('payload', payload)\n }\n\n public async reserveApply(amount: number) {\n this.loading = true;\n this.message = \"\";\n try {\n await this.reserve(amount);\n\n this.step = StepFormEnum.STEP_APPLY;\n\n this.saveStore(amount);\n } catch (error) {\n this.message = \"ocorreu um error ao solicitar a aplicação do bonus! tente novamente\"\n } finally {\n this.loading = false;\n }\n }\n\n public async reserve(amount: number) {\n await this.crmBonusService.reserve({\n redeemedBonus: amount,\n cartId: this.cartId,\n ticket: this.cartId,\n grossValue: Number(this.bonus.totalValue),\n storeName: this.storeName,\n storeId: this.bonus.storeId.toString(),\n userId: this.bonus.userId\n });\n }\n\n public handleCancel() {\n this.step = StepFormEnum.STEP_PHONE;\n this.cancel()\n }\n\n render() {\n return (\n <Host>\n {/* {this.step === StepFormEnum.STEP_PHONE && <phone-input value={this.customer.phone} sendPin={(phone) => this.sendPin(phone)} loading={this.loading} />} */}\n \n {this.step == StepFormEnum.STEP_NAME && <name-input loading={this.loadingModal} value={this.customer.name} applyName={(name) => this.handleCustomerName(name)} />}\n {this.step === StepFormEnum.STEP_PIN && <giftback-pin cancel={() => this.handleCancel()} sent={this.sent} validate={(data) => this.validateBonus(data)} loading={this.loading} />}\n\n {this.step === StepFormEnum.STEP_RESERVE && <giftback-progress loading={this.loading} cancel={() => this.handleCancel()} bonus={this.bonus} reserve={(amountRedeemed: number) => this.reserveApply(amountRedeemed)} />}\n {this.step === StepFormEnum.STEP_APPLY && <giftback-finish />}\n <p class=\"message-error\">{this.message}</p>\n </Host>\n )\n }\n}"],"version":3}
@@ -3762,12 +3762,12 @@ class CrmBonusService {
3762
3762
  });
3763
3763
  }
3764
3764
  async getCustomer(userId, store) {
3765
- const response = await this.axiosInstance.get(`/wake/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } });
3765
+ const response = await this.axiosInstance.get(`/store/${store}/customer/${userId}`, { headers: { 'Content-Type': 'application/json' } });
3766
3766
  console.log('response.data', response.data);
3767
3767
  return response.data;
3768
3768
  }
3769
3769
  async updateOrder(updateOrderDTO) {
3770
- const response = await this.axiosInstance.patch(`/api/checkouts/${updateOrderDTO.cartId}/updateOrder`, {
3770
+ const response = await this.axiosInstance.patch(`/checkouts/${updateOrderDTO.cartId}/updateOrder`, {
3771
3771
  orderId: updateOrderDTO.orderId,
3772
3772
  externalId: updateOrderDTO.cartIdCrm
3773
3773
  }, { headers: { 'Content-Type': 'application/json' } });
@@ -3799,4 +3799,4 @@ class CrmBonusService {
3799
3799
 
3800
3800
  export { CrmBonusService as C };
3801
3801
 
3802
- //# sourceMappingURL=p-8a7e31bd.js.map
3802
+ //# sourceMappingURL=p-aeaad64e.js.map