@accon/connect 0.9.1 → 0.10.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.
@@ -0,0 +1,50 @@
1
+ export declare class ItensDto {
2
+ codigo_produto: string;
3
+ observacao: string;
4
+ valor: number;
5
+ desconto: number;
6
+ qnt: number;
7
+ total: number;
8
+ itens_montagem: {
9
+ codigo_produto: string;
10
+ observacao: string;
11
+ valor: number;
12
+ qnt: number;
13
+ desconto: number;
14
+ total: number;
15
+ }[];
16
+ }
17
+ export declare class PagamentoDto {
18
+ valor: number;
19
+ forma: string;
20
+ forma_nome: string;
21
+ }
22
+ export declare class CreateOrderDto {
23
+ token: string;
24
+ requests: {
25
+ jsonrpc: string;
26
+ method: string;
27
+ params: {
28
+ estabelecimento_id: string;
29
+ cliente_fone: string;
30
+ cliente_nome: string;
31
+ valor_produtos: number;
32
+ valor_total: number;
33
+ valor_desconto: number;
34
+ valor_taxa: number;
35
+ fullservice: string;
36
+ entrega_estado: string;
37
+ entrega_cidade: string;
38
+ entrega_bairronome: string;
39
+ entrega_cep: string;
40
+ entrega_logradouro: string;
41
+ entrega_numero: string;
42
+ entrega_complemento: string;
43
+ entrega_referencia: string;
44
+ entrega_noestabelecimento: number;
45
+ itens: Array<ItensDto>;
46
+ pagamento: PagamentoDto;
47
+ };
48
+ id: string;
49
+ };
50
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateOrderDto = exports.PagamentoDto = exports.ItensDto = void 0;
4
+ class ItensDto {
5
+ codigo_produto;
6
+ observacao;
7
+ valor;
8
+ desconto;
9
+ qnt;
10
+ total;
11
+ itens_montagem;
12
+ }
13
+ exports.ItensDto = ItensDto;
14
+ class PagamentoDto {
15
+ valor;
16
+ forma;
17
+ forma_nome;
18
+ }
19
+ exports.PagamentoDto = PagamentoDto;
20
+ class CreateOrderDto {
21
+ token;
22
+ requests;
23
+ }
24
+ exports.CreateOrderDto = CreateOrderDto;
25
+ //# sourceMappingURL=create-order.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-order.dto.js","sourceRoot":"","sources":["../../../../lib/order/menew/dto/create-order.dto.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAQ;IACnB,cAAc,CAAS;IACvB,UAAU,CAAS;IACnB,KAAK,CAAS;IACd,QAAQ,CAAS;IACjB,GAAG,CAAS;IACZ,KAAK,CAAS;IACd,cAAc,CAOV;CACL;AAfD,4BAeC;AAED,MAAa,YAAY;IACvB,KAAK,CAAS;IACd,KAAK,CAAS;IACd,UAAU,CAAS;CACpB;AAJD,oCAIC;AAED,MAAa,cAAc;IACzB,KAAK,CAAS;IACd,QAAQ,CAyBN;CACH;AA5BD,wCA4BC"}
@@ -0,0 +1,15 @@
1
+ import { FromSchema } from 'json-schema-to-ts';
2
+ export declare const MENEW_CONFIG_SCHEMA: {
3
+ readonly $schema: "http://json-schema.org/draft-07/schema#";
4
+ readonly title: "Menew Configuration";
5
+ readonly type: "object";
6
+ readonly properties: {
7
+ readonly ESTABLISHMENT_ID: {
8
+ readonly type: "string";
9
+ readonly title: "ID estabelecimento";
10
+ readonly description: "ID do estabelecimento fornecido pelo Menew";
11
+ };
12
+ };
13
+ readonly required: readonly ["ESTABLISHMENT_ID"];
14
+ };
15
+ export type MenewConfig = FromSchema<typeof MENEW_CONFIG_SCHEMA>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MENEW_CONFIG_SCHEMA = void 0;
4
+ exports.MENEW_CONFIG_SCHEMA = {
5
+ $schema: 'http://json-schema.org/draft-07/schema#',
6
+ title: 'Menew Configuration',
7
+ type: 'object',
8
+ properties: {
9
+ ESTABLISHMENT_ID: {
10
+ type: 'string',
11
+ title: 'ID estabelecimento',
12
+ description: 'ID do estabelecimento fornecido pelo Menew',
13
+ },
14
+ },
15
+ required: ['ESTABLISHMENT_ID'],
16
+ };
17
+ //# sourceMappingURL=menew.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menew.config.js","sourceRoot":"","sources":["../../../lib/order/menew/menew.config.ts"],"names":[],"mappings":";;;AAEa,QAAA,mBAAmB,GAAG;IACjC,OAAO,EAAE,yCAAyC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,gBAAgB,EAAE;YAChB,IAAI,EAAE,QAAQ;YACd,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,4CAA4C;SAC1D;KACF;IACD,QAAQ,EAAE,CAAC,kBAAkB,CAAC;CACD,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { EventsService, IntegrationPayload, Order, OrderOutputIntegration } from '../../core/index.js';
2
+ import { HttpService } from '@nestjs/axios';
3
+ import { CreateOrderDto, ItensDto, PagamentoDto } from './dto/create-order.dto';
4
+ import { MenewConfig } from './menew.config';
5
+ export declare class MenewOrderOutput implements OrderOutputIntegration<MenewConfig> {
6
+ readonly eventService: EventsService;
7
+ private readonly httpService;
8
+ private readonly logger;
9
+ private readonly MENEW_BASE_URL;
10
+ private readonly MENEW_USER;
11
+ private readonly MENEW_TOKEN;
12
+ private readonly ALLOWED_ORDER_TYPES;
13
+ private readonly dispatchEvent;
14
+ constructor(eventService: EventsService, httpService: HttpService);
15
+ onOrderCreated(payload: IntegrationPayload, config: MenewConfig): Promise<void>;
16
+ transformItems(order: Order): Array<ItensDto>;
17
+ transformPayment(order: Order): PagamentoDto;
18
+ transformOrder(order: Order, config: MenewConfig, token: string): CreateOrderDto;
19
+ getToken(): Promise<any>;
20
+ }
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var MenewOrderOutput_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.MenewOrderOutput = void 0;
14
+ const core_1 = require("../../core/index.js");
15
+ const common_1 = require("@nestjs/common");
16
+ const axios_1 = require("@nestjs/axios");
17
+ const axios_2 = require("axios");
18
+ const rxjs_1 = require("rxjs");
19
+ const crypto_1 = require("crypto");
20
+ const menew_config_1 = require("./menew.config");
21
+ let MenewOrderOutput = MenewOrderOutput_1 = class MenewOrderOutput {
22
+ eventService;
23
+ httpService;
24
+ logger = new common_1.Logger(MenewOrderOutput_1.name);
25
+ MENEW_BASE_URL;
26
+ MENEW_USER;
27
+ MENEW_TOKEN;
28
+ ALLOWED_ORDER_TYPES;
29
+ dispatchEvent;
30
+ constructor(eventService, httpService) {
31
+ this.eventService = eventService;
32
+ this.httpService = httpService;
33
+ this.MENEW_BASE_URL =
34
+ process.env.MENEW_BASE_URL || 'https://api.menew.com.br';
35
+ this.MENEW_USER = process.env.MENEW_USER;
36
+ if (!this.MENEW_USER) {
37
+ this.logger.error('MENEW_USER não está definido nas variáveis de ambiente');
38
+ }
39
+ this.MENEW_TOKEN = process.env.MENEW_TOKEN;
40
+ if (!this.MENEW_TOKEN) {
41
+ this.logger.error('MENEW_TOKEN não está definido nas variáveis de ambiente');
42
+ }
43
+ this.ALLOWED_ORDER_TYPES = ['DELIVERY', 'TAKEOUT'];
44
+ this.dispatchEvent = eventService.createDispatcherFor('Menew', 'OrderOutput');
45
+ }
46
+ async onOrderCreated(payload, config) {
47
+ const { order } = payload;
48
+ const orderId = parseInt(order.externalId);
49
+ this.logger.log(`Processando pedido #${orderId} na Menew`);
50
+ if (!this.ALLOWED_ORDER_TYPES.includes(order.type)) {
51
+ this.logger.verbose(`Ignorando tipo de pedido não permitido: ${order.type} [${this.ALLOWED_ORDER_TYPES.join(',')}]`);
52
+ this.dispatchEvent({
53
+ eventType: 'INTEGRATION_FAILED',
54
+ orderId,
55
+ metadata: {
56
+ error: `Ignorando tipo de pedido não permitido: ${order.type} [${this.ALLOWED_ORDER_TYPES.join(',')}]`,
57
+ },
58
+ });
59
+ return;
60
+ }
61
+ this.dispatchEvent({
62
+ eventType: 'INTEGRATION_INITIATED',
63
+ orderId,
64
+ });
65
+ try {
66
+ const token = await this.getToken();
67
+ if (!token) {
68
+ throw new Error('Não foi possível autenticar com a Menew');
69
+ }
70
+ this.logger.debug(`Token recebido da Menew: ${token}`);
71
+ const body = this.transformOrder(order, config, token);
72
+ this.dispatchEvent({
73
+ eventType: 'INTEGRATION_PROCESSING',
74
+ orderId,
75
+ metadata: { request: body },
76
+ });
77
+ this.logger.debug(`Enviando pedido para Menew: ${JSON.stringify(body)}`);
78
+ const { data } = await (0, rxjs_1.firstValueFrom)(this.httpService.post(this.MENEW_BASE_URL, body));
79
+ this.dispatchEvent({
80
+ eventType: 'INTEGRATION_COMPLETED',
81
+ orderId,
82
+ metadata: { response: data },
83
+ });
84
+ }
85
+ catch (error) {
86
+ if ((0, axios_2.isAxiosError)(error)) {
87
+ this.logger.error('onOrderCreated: falha ao realizar requisição na Menew', JSON.stringify(error.response?.data));
88
+ this.dispatchEvent({
89
+ eventType: 'INTEGRATION_FAILED',
90
+ orderId,
91
+ metadata: { error: error.response?.data },
92
+ });
93
+ }
94
+ else {
95
+ this.dispatchEvent({
96
+ eventType: 'INTEGRATION_FAILED',
97
+ orderId,
98
+ metadata: { error },
99
+ });
100
+ this.logger.error('onOrderCreated: falha ao criar pedido na Menew', error);
101
+ }
102
+ }
103
+ }
104
+ transformItems(order) {
105
+ const items = order.items.map((item) => ({
106
+ codigo_produto: item.externalCode || item.id,
107
+ observacao: item.specialInstructions || '',
108
+ valor: item.totalPrice.value,
109
+ desconto: 0,
110
+ qnt: item.quantity,
111
+ total: item.totalPrice.value,
112
+ itens_montagem: item.options?.map((itemOption) => ({
113
+ codigo_produto: itemOption.externalCode || itemOption.id,
114
+ observacao: itemOption.specialInstructions || '',
115
+ valor: itemOption.totalPrice.value,
116
+ qnt: itemOption.quantity,
117
+ desconto: 0.0,
118
+ total: itemOption.totalPrice.value,
119
+ })) || [],
120
+ }));
121
+ return items;
122
+ }
123
+ transformPayment(order) {
124
+ return {
125
+ valor: order.payments.methods.reduce((acc, cur) => acc + cur.value, 0),
126
+ forma: order.displayId || '1',
127
+ forma_nome: order.payments.pending === 0
128
+ ? `Online - ${order.payments.methods.map((m) => m.method).join(', ')}`
129
+ : order.payments.methods.map((m) => m.method).join(', '),
130
+ };
131
+ }
132
+ transformOrder(order, config, token) {
133
+ if (!order.customer) {
134
+ throw new core_1.InvalidOrderException('Pedido sem informações do cliente', 'customer');
135
+ }
136
+ if (order.type === 'DELIVERY' && !order.delivery?.deliveryAddress) {
137
+ throw new core_1.InvalidOrderException('Pedido de entrega sem endereço', 'delivery');
138
+ }
139
+ const phone = order.customer?.phone.number.replace(/\D/g, '');
140
+ const deliveryFee = order.otherFees?.find(({ type }) => type === 'DELIVERY_FEE');
141
+ const address = order.delivery?.deliveryAddress;
142
+ const dto = {
143
+ token,
144
+ requests: {
145
+ jsonrpc: '2.0',
146
+ method: 'Pedido/send',
147
+ params: {
148
+ estabelecimento_id: config.ESTABLISHMENT_ID,
149
+ cliente_fone: phone,
150
+ cliente_nome: order.customer.name,
151
+ valor_produtos: order.total.itemsPrice.value,
152
+ valor_total: order.total.orderAmount.value,
153
+ valor_desconto: order.total.discount.value,
154
+ valor_taxa: deliveryFee?.price.value || 0,
155
+ fullservice: 'N',
156
+ entrega_estado: address?.state || '',
157
+ entrega_cidade: address?.city || '',
158
+ entrega_bairronome: address?.district || '',
159
+ entrega_cep: address?.postalCode?.replace(/\D/g, '') || '',
160
+ entrega_logradouro: address?.street || '',
161
+ entrega_numero: address?.number || '',
162
+ entrega_complemento: address?.complement || '',
163
+ entrega_referencia: address?.reference || '',
164
+ entrega_noestabelecimento: order.type === 'DELIVERY' ? 0 : 1,
165
+ itens: this.transformItems(order),
166
+ pagamento: this.transformPayment(order),
167
+ },
168
+ id: order.id,
169
+ },
170
+ };
171
+ return dto;
172
+ }
173
+ async getToken() {
174
+ const { data } = await (0, rxjs_1.firstValueFrom)(this.httpService.post(this.MENEW_BASE_URL, {
175
+ token: null,
176
+ requests: {
177
+ jsonrpc: '2.0',
178
+ method: 'Usuario/login',
179
+ params: {
180
+ usuario: this.MENEW_USER,
181
+ token: this.MENEW_TOKEN,
182
+ },
183
+ id: (0, crypto_1.randomUUID)(),
184
+ },
185
+ }));
186
+ return data;
187
+ }
188
+ };
189
+ exports.MenewOrderOutput = MenewOrderOutput;
190
+ exports.MenewOrderOutput = MenewOrderOutput = MenewOrderOutput_1 = __decorate([
191
+ (0, core_1.RegistryIntegration)({
192
+ id: 'menew',
193
+ category: 'POS',
194
+ type: 'OrderOutput',
195
+ title: 'Menew',
196
+ description: 'Menew, Sistema para gestão de restaurantes.',
197
+ logoUrl: 'https://raichu-uploads.s3.amazonaws.com/logo_menew_LlqUvW.png',
198
+ websiteUrl: 'https://www.menew.com.br',
199
+ configSchema: menew_config_1.MENEW_CONFIG_SCHEMA,
200
+ }),
201
+ (0, common_1.Injectable)(),
202
+ __metadata("design:paramtypes", [core_1.EventsService,
203
+ axios_1.HttpService])
204
+ ], MenewOrderOutput);
205
+ //# sourceMappingURL=menew.order-output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menew.order-output.js","sourceRoot":"","sources":["../../../lib/order/menew/menew.order-output.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,oCAQmB;AAEnB,2CAAoD;AACpD,yCAA4C;AAC5C,iCAAqC;AAIrC,+BAAsC;AACtC,mCAAoC;AAEp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