crmbonus-component-wake 0.0.12 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/dist/components/loading-spinner.d.ts +11 -0
  2. package/dist/components/pedido-finalizado.d.ts +11 -0
  3. package/dist/crmbonus-component-wake/app-modal.entry.js +2 -2
  4. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js +71 -3861
  5. package/dist/crmbonus-component-wake/crm-bonus-form.entry.js.map +1 -1
  6. package/dist/crmbonus-component-wake/crm-bonus.entry.js +11 -3
  7. package/dist/crmbonus-component-wake/crm-bonus.entry.js.map +1 -1
  8. package/dist/crmbonus-component-wake/crmbonus-component-wake.esm.js +3 -3
  9. package/dist/crmbonus-component-wake/crmbonus.service-134e7b0c.js +3863 -0
  10. package/dist/crmbonus-component-wake/crmbonus.service-134e7b0c.js.map +1 -0
  11. package/dist/crmbonus-component-wake/giftback-pin.entry.js +3 -5
  12. package/dist/crmbonus-component-wake/giftback-pin.entry.js.map +1 -1
  13. package/dist/crmbonus-component-wake/giftback-progress.entry.js +21 -8
  14. package/dist/crmbonus-component-wake/giftback-progress.entry.js.map +1 -1
  15. package/dist/crmbonus-component-wake/{index-71c2c4ae.js → index-b9a7a992.js} +2 -2
  16. package/dist/crmbonus-component-wake/{index-71c2c4ae.js.map → index-b9a7a992.js.map} +1 -1
  17. package/dist/crmbonus-component-wake/loading-spinner.entry.js +19 -0
  18. package/dist/crmbonus-component-wake/loading-spinner.entry.js.map +1 -0
  19. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js +18 -0
  20. package/dist/crmbonus-component-wake/pedido-finalizado.entry.js.map +1 -0
  21. package/dist/crmbonus-component-wake/phone-input-mask.entry.js +2 -2
  22. package/dist/crmbonus-component-wake/phone-input.entry.js +2 -2
  23. package/dist/crmbonus-component-wake/phone-input.entry.js.map +1 -1
  24. package/dist/types/components/crm-bonus/crm-bonus.d.ts +6 -1
  25. package/dist/types/components/crm-bonus-form/crm-bonus-form.d.ts +8 -2
  26. package/dist/types/components/crm-bonus-form/subcomponents/giftback-pin/giftback-pin.d.ts +1 -1
  27. package/dist/types/components/crm-bonus-form/subcomponents/giftback-progress/giftback-progress.d.ts +6 -3
  28. package/dist/types/components/loading-spinner/loading-spinner.d.ts +5 -0
  29. package/dist/types/components/pedido/pedido.d.ts +4 -0
  30. package/dist/types/components.d.ts +50 -10
  31. package/dist/types/contants/index.d.ts +5 -0
  32. package/dist/types/contants/mocks.d.ts +4 -0
  33. package/dist/types/dto/validate.pin.bonus.d.ts +42 -6
  34. package/dist/types/services/crmbonus.service.d.ts +4 -1
  35. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import { r as registerInstance, h } from './index-b9a7a992.js';
2
+
3
+ const loadingSpinnerCss = ".spinner{display:inline-block;border:4px solid transparent;border-radius:50%;border-top-color:var(--color, #0078d7);animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}";
4
+
5
+ const LoadingSpinner = class {
6
+ constructor(hostRef) {
7
+ registerInstance(this, hostRef);
8
+ this.size = '50px';
9
+ this.color = '#0078d7';
10
+ }
11
+ render() {
12
+ return (h("div", { key: '671c2b621a084871eb30ae2d4e8def280844d612', class: "spinner", style: { width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` } }));
13
+ }
14
+ };
15
+ LoadingSpinner.style = loadingSpinnerCss;
16
+
17
+ export { LoadingSpinner as loading_spinner };
18
+
19
+ //# sourceMappingURL=loading-spinner.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"loading-spinner.entry.esm.js","mappings":";;AAAA,MAAM,iBAAiB,GAAG,iOAAiO;;MCO9O,cAAc;;;oBACA,MAAM;qBACL,SAAS;;IAEjC,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,sCAAsC,EAAE,GAAQ,EAC/I;KACL;;;;;;","names":[],"sources":["src/components/loading-spinner/loading-spinner.css?tag=loading-spinner&encapsulation=shadow","src/components/loading-spinner/loading-spinner.tsx"],"sourcesContent":[".spinner {\n display: inline-block;\n border: 4px solid transparent;\n border-radius: 50%;\n border-top-color: var(--color, #0078d7);\n animation: spin 1s linear infinite;\n}\n\n@keyframes spin {\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n}","import { Component, h, Prop } from '@stencil/core';\n\n@Component({\n tag: 'loading-spinner',\n styleUrl: 'loading-spinner.css',\n shadow: true,\n})\nexport class LoadingSpinner {\n @Prop() size: string = '50px'; // Tamanho do spinner (padrão 50px)\n @Prop() color: string = '#0078d7'; // Cor do spinner (padrão azul)\n\n render() {\n return (\n <div class=\"spinner\" style={{ width: this.size, height: this.size, borderColor: `${this.color} transparent transparent transparent` }}></div>\n );\n }\n}\n"],"version":3}
@@ -0,0 +1,18 @@
1
+ import { r as registerInstance, h } from './index-b9a7a992.js';
2
+ import { C as CrmBonusService } from './crmbonus.service-134e7b0c.js';
3
+
4
+ const Pedido = class {
5
+ constructor(hostRef) {
6
+ registerInstance(this, hostRef);
7
+ }
8
+ async componentWillLoad() {
9
+ await new CrmBonusService().teste();
10
+ }
11
+ render() {
12
+ return (h("div", { key: 'ba5af472622d47dc602df822998aad9dc9554856' }, "oi"));
13
+ }
14
+ };
15
+
16
+ export { Pedido as pedido_finalizado };
17
+
18
+ //# sourceMappingURL=pedido-finalizado.entry.js.map
@@ -0,0 +1 @@
1
+ {"file":"pedido-finalizado.entry.esm.js","mappings":";;;MAOa,MAAM;;;;IAEf,MAAM,iBAAiB;QACnB,MAAM,IAAI,eAAe,EAAE,CAAC,KAAK,EAAE,CAAA;KACtC;IAED,MAAM;QACF,QACI,mEAAa,EAChB;KACJ;;;;;","names":[],"sources":["src/components/pedido/pedido.tsx"],"sourcesContent":["import { Component, h } from \"@stencil/core\";\nimport axios from \"axios\";\nimport { CrmBonusService } from \"../../services/crmbonus.service\";\n\n@Component({\n tag: \"pedido-finalizado\"\n})\nexport class Pedido {\n\n async componentWillLoad() {\n await new CrmBonusService().teste()\n }\n\n render() {\n return (\n <div>oi</div>\n )\n }\n}"],"version":3}
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-71c2c4ae.js';
1
+ import { r as registerInstance, h } from './index-b9a7a992.js';
2
2
 
3
3
  const phoneInputMaskCss = ".inline-text-field-container{display:flex;flex-direction:column}@supports (top: max(0%)){.mdc-text-field--outlined{padding-right:max(16px, var(--mdc-shape-small, 4px))}}@supports (top: max(0%)){.mdc-text-field--outlined{padding-left:max(16px, calc(var(--mdc-shape-small, 4px) + 4px))}}.mdc-text-field--outlined{height:55px;overflow:visible}.phone{width:300px;height:50px;font-size:18px;padding:10px;color:grey;border:1px solid #d3c6c6;outline:none}.mdc-text-field{border-top-left-radius:4px;border-top-left-radius:var(--mdc-shape-small, 4px);border-top-right-radius:4px;border-top-right-radius:var(--mdc-shape-small, 4px);border-bottom-right-radius:0;border-bottom-left-radius:0;display:inline-flex;align-items:baseline;padding:0 16px;position:relative;box-sizing:border-box;overflow:hidden;will-change:opacity, transform, color}";
4
4
 
@@ -25,7 +25,7 @@ const PhoneInputMask = class {
25
25
  return this.phone;
26
26
  }
27
27
  render() {
28
- return (h("input", { key: '8ec2c5769fd514155a25391de89b5267d9742473', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
28
+ return (h("input", { key: '3b00242e5569a40f078a985a7b4bc99dad86e161', id: "phone", type: "tel", class: "phone", value: this.phone, onInput: (event) => this.handleInput(event), placeholder: "(12) 94567-8910" }));
29
29
  }
30
30
  };
31
31
  PhoneInputMask.style = phoneInputMaskCss;
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h } from './index-71c2c4ae.js';
1
+ import { r as registerInstance, h } from './index-b9a7a992.js';
2
2
 
3
3
  const PhoneInput = class {
4
4
  constructor(hostRef) {
@@ -11,7 +11,7 @@ const PhoneInput = class {
11
11
  await this.sendPin(phone);
12
12
  }
13
13
  render() {
14
- return (h("div", { key: '3e5921ab208cc6505874414e605a180b9c45c9ea', class: "form-container" }, h("phone-input-mask", { key: 'e8c80c27aa999df162f8e2ad9efacc5989dab23b', ref: ref => this.phoneInputMask = ref }), h("button", { key: 'ea6b0922c223e4154baf2a6a3f0b725f62113f57', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, "validar")));
14
+ return (h("div", { key: '7cacb66e387cdc92af272234e128ac0084ac76b5', class: "form-container" }, h("phone-input-mask", { key: 'd8f5d6ed8d34136d8eb9aeb0f16de934ba376976', ref: ref => this.phoneInputMask = ref }), h("button", { key: '4b3170982fa5b3908829b1ccd386aa481f46170e', class: `button ${this.loading ? 'disabled' : ''} `, disabled: this.loading, onClick: () => this.validatePhone() }, !this.loading ? "validar" : h("loading-spinner", { size: "25px", color: "#fff" }))));
15
15
  }
16
16
  };
17
17
 
@@ -1 +1 @@
1
- {"file":"phone-input.entry.esm.js","mappings":";;MAKa,UAAU;;;;;;IAOnB,MAAM,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC7B;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,gBAAgB,IACvB,yEAAkB,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI,EAC3D,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,cAAkB,CACvI,EACT;KACJ;;;;;","names":[],"sources":["src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask ref={ref => this.phoneInputMask = ref} />\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>validar</button>\n </div>\n )\n }\n}"],"version":3}
1
+ {"file":"phone-input.entry.esm.js","mappings":";;MAKa,UAAU;;;;;;IAOnB,MAAM,aAAa;QACf,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,CAAC;QACnD,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KAC7B;IAED,MAAM;QACF,QACI,4DAAK,KAAK,EAAC,gBAAgB,IACvB,yEAAkB,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,cAAc,GAAG,GAAG,GAAI,EAC3D,+DAAQ,KAAK,EAAE,UAAU,IAAI,CAAC,OAAO,GAAG,UAAU,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC,aAAa,EAAE,IAE/G,CAAC,IAAI,CAAC,OAAO,GAAG,SAAS,GAAG,uBAAiB,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,GAAG,CAEvE,CACP,EACT;KACJ;;;;;","names":[],"sources":["src/components/crm-bonus-form/subcomponents/phone/phone.input.tsx"],"sourcesContent":["import { Component, Prop, h } from \"@stencil/core\";\n\n@Component({\n tag: 'phone-input'\n})\nexport class PhoneInput {\n\n private phoneInputMask: HTMLPhoneInputMaskElement;\n\n @Prop() sendPin: Function;\n @Prop() loading: boolean;\n\n async validatePhone() {\n const phone = await this.phoneInputMask.getPhone();\n await this.sendPin(phone);\n }\n\n render() {\n return (\n <div class=\"form-container\">\n <phone-input-mask ref={ref => this.phoneInputMask = ref} />\n <button class={`button ${this.loading ? 'disabled' : ''} `} disabled={this.loading} onClick={() => this.validatePhone()}>\n {\n !this.loading ? \"validar\" : <loading-spinner size=\"25px\" color=\"#fff\" />\n }\n </button>\n </div>\n )\n }\n}"],"version":3}
@@ -1,7 +1,12 @@
1
+ import { IProduct, IProductWake } from '../../dto/validate.pin.bonus';
1
2
  export declare class MyComponent {
2
3
  showModal: boolean;
3
4
  userId: string;
4
5
  storeName: any;
5
- products: Array<any>;
6
+ productsInString: string;
7
+ cartId: any;
8
+ products: Array<IProductWake>;
9
+ componentWillLoad(): void;
10
+ buildProducts(): IProduct[];
6
11
  render(): any;
7
12
  }
@@ -1,12 +1,18 @@
1
1
  import { IPinSent } from "../../components";
2
- import { IValidatePinBonus } from "../../dto/validate.pin.bonus";
2
+ import { IBonus, IProduct } from "../../dto/validate.pin.bonus";
3
3
  export declare class CrmBonusForm {
4
4
  private crmBonusService;
5
5
  storeName: any;
6
+ cartId: any;
7
+ products: Array<IProduct>;
6
8
  loading: boolean;
7
9
  step: number;
8
10
  sent: IPinSent;
11
+ message: string;
12
+ phone: number;
13
+ bonus: IBonus;
9
14
  sendPin(phone: string): Promise<void>;
10
- validateBonus(data: IValidatePinBonus): Promise<void>;
15
+ validateBonus(pin: string): Promise<void>;
16
+ reserve(amount: number): Promise<void>;
11
17
  render(): any;
12
18
  }
@@ -1,7 +1,7 @@
1
1
  import { IPinSent } from '../../../../dto/pin.sent';
2
2
  export declare class GiftbackPin {
3
3
  sent: IPinSent;
4
- validate: Function;
4
+ validate: (pin: string) => void;
5
5
  pin: string[];
6
6
  isVerified: boolean;
7
7
  loading: boolean;
@@ -1,8 +1,11 @@
1
+ import { IBonus } from '../../../../dto/validate.pin.bonus';
1
2
  export declare class GiftbackProgress {
2
- maxValue: number;
3
- totalGiftback: number;
4
- validityDate: string;
5
3
  usedValue: number;
4
+ loading: boolean;
5
+ bonus: Partial<IBonus>;
6
+ reserve: (amountRedeemed: number) => void;
7
+ componentWillLoad(): void;
6
8
  handleSliderChange(event: Event): void;
9
+ handleReserve(): Promise<void>;
7
10
  render(): any;
8
11
  }
@@ -0,0 +1,5 @@
1
+ export declare class LoadingSpinner {
2
+ size: string;
3
+ color: string;
4
+ render(): any;
5
+ }
@@ -0,0 +1,4 @@
1
+ export declare class Pedido {
2
+ componentWillLoad(): Promise<void>;
3
+ render(): any;
4
+ }
@@ -5,7 +5,9 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { IBonus, IProduct } from "./dto/validate.pin.bonus";
8
9
  import { IPinSent } from "./dto/pin.sent";
10
+ export { IBonus, IProduct } from "./dto/validate.pin.bonus";
9
11
  export { IPinSent } from "./dto/pin.sent";
10
12
  export namespace Components {
11
13
  interface AppModal {
@@ -13,21 +15,31 @@ export namespace Components {
13
15
  "modalTitle": string;
14
16
  }
15
17
  interface CrmBonus {
16
- "products": Array<any>;
18
+ "cartId": any;
19
+ "productsInString": string;
17
20
  "storeName": any;
18
21
  "userId": string;
19
22
  }
20
23
  interface CrmBonusForm {
24
+ "cartId": any;
25
+ "products": Array<IProduct>;
21
26
  "storeName": any;
22
27
  }
23
28
  interface GiftbackPin {
29
+ "loading": boolean;
24
30
  "sent": IPinSent;
25
- "validate": Function;
31
+ "validate": (pin: string) => void;
26
32
  }
27
33
  interface GiftbackProgress {
28
- "maxValue": number;
29
- "totalGiftback": number;
30
- "validityDate": string;
34
+ "bonus": Partial<IBonus>;
35
+ "loading": boolean;
36
+ "reserve": (amountRedeemed: number) => void;
37
+ }
38
+ interface LoadingSpinner {
39
+ "color": string;
40
+ "size": string;
41
+ }
42
+ interface PedidoFinalizado {
31
43
  }
32
44
  interface PhoneInput {
33
45
  "loading": boolean;
@@ -83,6 +95,18 @@ declare global {
83
95
  prototype: HTMLGiftbackProgressElement;
84
96
  new (): HTMLGiftbackProgressElement;
85
97
  };
98
+ interface HTMLLoadingSpinnerElement extends Components.LoadingSpinner, HTMLStencilElement {
99
+ }
100
+ var HTMLLoadingSpinnerElement: {
101
+ prototype: HTMLLoadingSpinnerElement;
102
+ new (): HTMLLoadingSpinnerElement;
103
+ };
104
+ interface HTMLPedidoFinalizadoElement extends Components.PedidoFinalizado, HTMLStencilElement {
105
+ }
106
+ var HTMLPedidoFinalizadoElement: {
107
+ prototype: HTMLPedidoFinalizadoElement;
108
+ new (): HTMLPedidoFinalizadoElement;
109
+ };
86
110
  interface HTMLPhoneInputElement extends Components.PhoneInput, HTMLStencilElement {
87
111
  }
88
112
  var HTMLPhoneInputElement: {
@@ -101,6 +125,8 @@ declare global {
101
125
  "crm-bonus-form": HTMLCrmBonusFormElement;
102
126
  "giftback-pin": HTMLGiftbackPinElement;
103
127
  "giftback-progress": HTMLGiftbackProgressElement;
128
+ "loading-spinner": HTMLLoadingSpinnerElement;
129
+ "pedido-finalizado": HTMLPedidoFinalizadoElement;
104
130
  "phone-input": HTMLPhoneInputElement;
105
131
  "phone-input-mask": HTMLPhoneInputMaskElement;
106
132
  }
@@ -112,21 +138,31 @@ declare namespace LocalJSX {
112
138
  "onModalClosed"?: (event: AppModalCustomEvent<void>) => void;
113
139
  }
114
140
  interface CrmBonus {
115
- "products"?: Array<any>;
141
+ "cartId"?: any;
142
+ "productsInString"?: string;
116
143
  "storeName"?: any;
117
144
  "userId"?: string;
118
145
  }
119
146
  interface CrmBonusForm {
147
+ "cartId"?: any;
148
+ "products"?: Array<IProduct>;
120
149
  "storeName"?: any;
121
150
  }
122
151
  interface GiftbackPin {
152
+ "loading"?: boolean;
123
153
  "sent"?: IPinSent;
124
- "validate"?: Function;
154
+ "validate"?: (pin: string) => void;
125
155
  }
126
156
  interface GiftbackProgress {
127
- "maxValue"?: number;
128
- "totalGiftback"?: number;
129
- "validityDate"?: string;
157
+ "bonus"?: Partial<IBonus>;
158
+ "loading"?: boolean;
159
+ "reserve"?: (amountRedeemed: number) => void;
160
+ }
161
+ interface LoadingSpinner {
162
+ "color"?: string;
163
+ "size"?: string;
164
+ }
165
+ interface PedidoFinalizado {
130
166
  }
131
167
  interface PhoneInput {
132
168
  "loading"?: boolean;
@@ -140,6 +176,8 @@ declare namespace LocalJSX {
140
176
  "crm-bonus-form": CrmBonusForm;
141
177
  "giftback-pin": GiftbackPin;
142
178
  "giftback-progress": GiftbackProgress;
179
+ "loading-spinner": LoadingSpinner;
180
+ "pedido-finalizado": PedidoFinalizado;
143
181
  "phone-input": PhoneInput;
144
182
  "phone-input-mask": PhoneInputMask;
145
183
  }
@@ -153,6 +191,8 @@ declare module "@stencil/core" {
153
191
  "crm-bonus-form": LocalJSX.CrmBonusForm & JSXBase.HTMLAttributes<HTMLCrmBonusFormElement>;
154
192
  "giftback-pin": LocalJSX.GiftbackPin & JSXBase.HTMLAttributes<HTMLGiftbackPinElement>;
155
193
  "giftback-progress": LocalJSX.GiftbackProgress & JSXBase.HTMLAttributes<HTMLGiftbackProgressElement>;
194
+ "loading-spinner": LocalJSX.LoadingSpinner & JSXBase.HTMLAttributes<HTMLLoadingSpinnerElement>;
195
+ "pedido-finalizado": LocalJSX.PedidoFinalizado & JSXBase.HTMLAttributes<HTMLPedidoFinalizadoElement>;
156
196
  "phone-input": LocalJSX.PhoneInput & JSXBase.HTMLAttributes<HTMLPhoneInputElement>;
157
197
  "phone-input-mask": LocalJSX.PhoneInputMask & JSXBase.HTMLAttributes<HTMLPhoneInputMaskElement>;
158
198
  }
@@ -0,0 +1,5 @@
1
+ export declare enum StepFormEnum {
2
+ STEP_PHONE = 1,
3
+ STEP_PIN = 2,
4
+ STEP_RESERVE = 3
5
+ }
@@ -0,0 +1,4 @@
1
+ import { IBonus } from "../components";
2
+ export declare const RESPONSE_CONSULTA_BONUS: {
3
+ data: IBonus;
4
+ };
@@ -1,13 +1,49 @@
1
1
  export interface IProduct {
2
- variantId: string;
2
+ variantId: number;
3
3
  sku: string;
4
- amount: number;
4
+ value: number;
5
5
  }
6
- export interface IValidatePinBonus {
6
+ export interface IProductWake {
7
+ ProdutoVarianteId: number;
8
+ SKU: string;
9
+ PrecoPor: number;
10
+ }
11
+ export interface IProccesPinBonusDto {
12
+ cartId: string;
13
+ products: Array<IProduct>;
14
+ loja_id: number;
15
+ user_id: number;
16
+ cellphone: string;
17
+ pin: string;
18
+ }
19
+ export interface IBonus {
20
+ hasBonus: boolean;
21
+ bonusBalance: number;
22
+ totalBonus: number;
23
+ minimumPurchase: number;
24
+ bonusIds: string;
25
+ firstValidityDate: string;
26
+ history: [
27
+ {
28
+ validityStart: string;
29
+ validityEnd: string;
30
+ value: number;
31
+ },
32
+ {
33
+ validityStart: string;
34
+ validityEnd: string;
35
+ value: number;
36
+ }
37
+ ];
7
38
  storeId: number;
8
39
  userId: number;
9
40
  cartId: string;
10
- products: Array<IProduct>;
11
- phone: number;
12
- pin: number;
41
+ calculatedValue: number;
42
+ totalValue: number;
43
+ }
44
+ export interface IReserveDTO {
45
+ cart_id: string;
46
+ valor_bruto: number;
47
+ bonus_resgatado: number;
48
+ ticket: string;
13
49
  }
@@ -1,7 +1,10 @@
1
1
  import { IPinSent } from '../dto/pin.sent';
2
+ import { IBonus, IProccesPinBonusDto, IReserveDTO } from '../dto/validate.pin.bonus';
2
3
  export declare class CrmBonusService {
3
4
  private axiosInstance;
4
5
  constructor();
6
+ teste(): Promise<void>;
5
7
  sendPin(phone: number, store: string): Promise<IPinSent>;
6
- validatePinBonus(): Promise<void>;
8
+ validatePinBonus(payload: IProccesPinBonusDto, store: string): Promise<IBonus>;
9
+ reserve(payload: IReserveDTO, store: string): Promise<any>;
7
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crmbonus-component-wake",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "Stencil Component Starter",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",