@lucaapp/service-utils 5.37.0 → 5.38.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,36 @@
1
+ export declare const FISCALIZED_PAYMENT_EVENT_VERSION = 1;
2
+ export type FiscalizedPaymentEventVersion = typeof FISCALIZED_PAYMENT_EVENT_VERSION;
3
+ /**
4
+ * Emitted by backend-tse when a payment's fiscalization reaches a terminal
5
+ * ready state (signed and receipt PDF materializable).
6
+ * Consumers (e.g. backend-pay) use this instead of polling readiness.
7
+ *
8
+ * ID fields are intentionally distinct — they are not always equal:
9
+ * - POS checkout fast-path can create `fiscal_payment_events` under a throwaway
10
+ * Kafka uuid before `V3Payment` exists; TSE then reuses that fiscal row via
11
+ * `checkoutId` and does not rewrite the fiscal id to `V3Payment.uuid`.
12
+ * - Cash / HTTP paths often have no `V3Payment` at all.
13
+ */
14
+ export type FiscalizedPayment = {
15
+ version: FiscalizedPaymentEventVersion;
16
+ /**
17
+ * `fiscal_payment_events.id` — TSE primary key used for receipt-token /
18
+ * readiness / PDF. Always present. Envelope `id` should match this.
19
+ */
20
+ fiscalPaymentEventId: string;
21
+ locationId: string;
22
+ /**
23
+ * backend-pay `V3Payment.uuid` when TSE knows it (settled Kafka card/web
24
+ * path). May differ from `fiscalPaymentEventId` after fast-path reuse.
25
+ * Absent for cash / when only a throwaway Kafka uuid was seen.
26
+ */
27
+ paymentId?: string | null;
28
+ /**
29
+ * backend-pay `V3Checkout.uuid` when known. Join key when
30
+ * `fiscalPaymentEventId` ≠ `paymentId`.
31
+ */
32
+ checkoutId?: string | null;
33
+ notfallmodus?: boolean;
34
+ tseSigningEventId?: string | null;
35
+ statusCompleteAt?: Date | null;
36
+ };
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FISCALIZED_PAYMENT_EVENT_VERSION = void 0;
4
+ exports.FISCALIZED_PAYMENT_EVENT_VERSION = 1;
@@ -29,4 +29,6 @@ export type RefundEvent = {
29
29
  method?: string | null;
30
30
  /** Optional on the wire for in-flight events produced before this field existed. */
31
31
  reason?: string | null;
32
+ /** Operator who confirmed the refund; optional so older producers and consumers keep working. */
33
+ performedBy?: string | null;
32
34
  };
@@ -1,6 +1,7 @@
1
1
  import type { Payment, PaymentEvent } from './events/payment';
2
2
  import type { OrderEvent } from './events/order';
3
3
  import type { RefundEvent } from './events/refund';
4
+ import type { FiscalizedPayment } from './events/fiscalizedPayment';
4
5
  import type { Consumer } from './events/consumer';
5
6
  import type { Operator } from './events/operator';
6
7
  import type { LocationGroupEmployees } from './events/locationGroupEmployees';
@@ -23,6 +24,7 @@ declare enum KafkaTopic {
23
24
  PAYMENTS = "payments",
24
25
  ORDERS = "orders",
25
26
  REFUNDS = "refunds",
27
+ FISCALIZED_PAYMENTS = "fiscalized_payments",
26
28
  CONSUMERS = "consumers",
27
29
  OPERATORS = "operators",
28
30
  OPERATORS_PAY = "operators_pay",
@@ -48,6 +50,7 @@ type MessageFormats = {
48
50
  [KafkaTopic.PAYMENTS]: Payment | PaymentEvent;
49
51
  [KafkaTopic.ORDERS]: OrderEvent;
50
52
  [KafkaTopic.REFUNDS]: RefundEvent;
53
+ [KafkaTopic.FISCALIZED_PAYMENTS]: FiscalizedPayment;
51
54
  [KafkaTopic.CONSUMERS]: Consumer;
52
55
  [KafkaTopic.OPERATORS]: Operator;
53
56
  [KafkaTopic.OPERATORS_PAY]: OperatorPay;
@@ -73,6 +76,7 @@ declare const MessageIssuer: {
73
76
  payments: Service;
74
77
  orders: Service;
75
78
  refunds: Service;
79
+ fiscalized_payments: Service;
76
80
  consumers: Service;
77
81
  operators: Service;
78
82
  operator_devices: Service;
@@ -7,6 +7,7 @@ var KafkaTopic;
7
7
  KafkaTopic["PAYMENTS"] = "payments";
8
8
  KafkaTopic["ORDERS"] = "orders";
9
9
  KafkaTopic["REFUNDS"] = "refunds";
10
+ KafkaTopic["FISCALIZED_PAYMENTS"] = "fiscalized_payments";
10
11
  KafkaTopic["CONSUMERS"] = "consumers";
11
12
  KafkaTopic["OPERATORS"] = "operators";
12
13
  KafkaTopic["OPERATORS_PAY"] = "operators_pay";
@@ -32,6 +33,7 @@ const MessageIssuer = {
32
33
  [KafkaTopic.PAYMENTS]: serviceIdentity_1.Service.BACKEND_PAY,
33
34
  [KafkaTopic.ORDERS]: serviceIdentity_1.Service.BACKEND_PAY,
34
35
  [KafkaTopic.REFUNDS]: serviceIdentity_1.Service.BACKEND_PAY,
36
+ [KafkaTopic.FISCALIZED_PAYMENTS]: serviceIdentity_1.Service.BACKEND_TSE,
35
37
  [KafkaTopic.CONSUMERS]: serviceIdentity_1.Service.BACKEND,
36
38
  [KafkaTopic.OPERATORS]: serviceIdentity_1.Service.BACKEND,
37
39
  [KafkaTopic.OPERATOR_DEVICES]: serviceIdentity_1.Service.BACKEND,
@@ -5,4 +5,6 @@ export type { RefundEvent } from './events/refund';
5
5
  export { REFUND_EVENT_VERSION } from './events/refund';
6
6
  export type { OrderEvent, OrderEventItem, OrderEventType, OrderEventStatus, OrderEventTranslatableName, } from './events/order';
7
7
  export { ORDER_EVENT_VERSION } from './events/order';
8
+ export type { FiscalizedPayment } from './events/fiscalizedPayment';
9
+ export { FISCALIZED_PAYMENT_EVENT_VERSION } from './events/fiscalizedPayment';
8
10
  export type { KafkaEvent, GenericKafkaEvent, EventPayloadHandler, GenericEventPayloadHandler, KafkaConfiguration, CustomTopicConfig, CustomTopicPoisonContext, CustomTopicPoisonHandler, } from './types';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ORDER_EVENT_VERSION = exports.REFUND_EVENT_VERSION = exports.KafkaTopic = exports.KafkaClient = void 0;
3
+ exports.FISCALIZED_PAYMENT_EVENT_VERSION = exports.ORDER_EVENT_VERSION = exports.REFUND_EVENT_VERSION = exports.KafkaTopic = exports.KafkaClient = void 0;
4
4
  var kafkaClient_1 = require("./kafkaClient");
5
5
  Object.defineProperty(exports, "KafkaClient", { enumerable: true, get: function () { return kafkaClient_1.KafkaClient; } });
6
6
  var events_1 = require("./events");
@@ -9,3 +9,5 @@ var refund_1 = require("./events/refund");
9
9
  Object.defineProperty(exports, "REFUND_EVENT_VERSION", { enumerable: true, get: function () { return refund_1.REFUND_EVENT_VERSION; } });
10
10
  var order_1 = require("./events/order");
11
11
  Object.defineProperty(exports, "ORDER_EVENT_VERSION", { enumerable: true, get: function () { return order_1.ORDER_EVENT_VERSION; } });
12
+ var fiscalizedPayment_1 = require("./events/fiscalizedPayment");
13
+ Object.defineProperty(exports, "FISCALIZED_PAYMENT_EVENT_VERSION", { enumerable: true, get: function () { return fiscalizedPayment_1.FISCALIZED_PAYMENT_EVENT_VERSION; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lucaapp/service-utils",
3
- "version": "5.37.0",
3
+ "version": "5.38.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -30,7 +30,7 @@
30
30
  "@types/response-time": "^2.3.9",
31
31
  "@types/swagger-ui-express": "4.1.8",
32
32
  "@types/validator": "13.7.1",
33
- "axios": "1.18.0",
33
+ "axios": "1.20.0",
34
34
  "axios-rate-limit": "^1.4.0",
35
35
  "axios-retry": "^4.5.0",
36
36
  "body-parser": "1.20.6",
@@ -82,7 +82,7 @@
82
82
  "typescript": "npm:@typescript/typescript6@6.0.2",
83
83
  "vite-tsconfig-paths": "4.3.2",
84
84
  "vitest": "4.1.1",
85
- "yarn-osv-audit": "0.1.8"
85
+ "yarn-osv-audit": "1.0.0"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "@sentry/node": "^9.10.1",
@@ -111,13 +111,14 @@
111
111
  "node-forge": "1.4.0",
112
112
  "uuid": "^14.0.0",
113
113
  "follow-redirects": "^1.16.0",
114
- "axios": "1.18.0",
114
+ "axios": "1.20.0",
115
115
  "path-to-regexp": "0.1.13",
116
- "ip-address": "10.5.1",
116
+ "ip-address": "10.7.2",
117
117
  "fast-xml-builder": "^1.1.7",
118
- "brace-expansion": "2.1.4",
118
+ "brace-expansion": "2.1.7",
119
119
  "form-data": "4.0.6",
120
120
  "js-yaml": "4.3.2",
121
- "@opentelemetry/core": "2.8.0"
121
+ "@opentelemetry/core": "2.8.0",
122
+ "proxy-addr": "2.0.8"
122
123
  }
123
124
  }