@lucaapp/service-utils 1.32.1 → 1.34.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/dist/lib/kafka/events/consumer.d.ts +1 -2
- package/dist/lib/kafka/events/location.d.ts +1 -2
- package/dist/lib/kafka/events/locationGroup.d.ts +1 -2
- package/dist/lib/kafka/events/locationGroupEmployees.d.ts +1 -2
- package/dist/lib/kafka/events/locationMenu.d.ts +6 -0
- package/dist/lib/kafka/events/locationMenu.js +2 -0
- package/dist/lib/kafka/events/operator.d.ts +1 -2
- package/dist/lib/kafka/events/payment.d.ts +1 -2
- package/dist/lib/kafka/events/wsEvent.d.ts +1 -2
- package/dist/lib/kafka/events.d.ts +4 -0
- package/dist/lib/kafka/events.js +2 -0
- package/dist/lib/money/money.d.ts +4 -0
- package/dist/lib/money/money.js +14 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type LocationGroupEmployees = {
|
|
1
|
+
export type LocationGroupEmployees = {
|
|
2
2
|
uuid: string;
|
|
3
3
|
firstName: string;
|
|
4
4
|
lastName: string | null;
|
|
@@ -9,4 +9,3 @@ type LocationGroupEmployees = {
|
|
|
9
9
|
createdAt: Date;
|
|
10
10
|
updatedAt: Date;
|
|
11
11
|
};
|
|
12
|
-
export type { LocationGroupEmployees };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Payment } from './events/payment';
|
|
2
2
|
import type { Consumer } from './events/consumer';
|
|
3
3
|
import type { Operator } from './events/operator';
|
|
4
|
+
import type { LocationMenu } from './events/locationMenu';
|
|
4
5
|
import type { LocationGroupEmployees } from './events/locationGroupEmployees';
|
|
5
6
|
import type { WsEvent } from './events/wsEvent';
|
|
6
7
|
import { Service } from '../serviceIdentity';
|
|
@@ -11,6 +12,7 @@ declare enum KafkaTopic {
|
|
|
11
12
|
CONSUMERS = "consumers",
|
|
12
13
|
OPERATORS = "operators",
|
|
13
14
|
LOCATIONS = "locations",
|
|
15
|
+
LOCATION_MENUS = "location_menus",
|
|
14
16
|
LOCATION_GROUPS = "location_groups",
|
|
15
17
|
LOCATION_GROUP_EMPLOYEES = "location_group_employees",
|
|
16
18
|
WS_EVENT_backend = "wsevent_backend",
|
|
@@ -22,6 +24,7 @@ type MessageFormats = {
|
|
|
22
24
|
[KafkaTopic.CONSUMERS]: Consumer;
|
|
23
25
|
[KafkaTopic.OPERATORS]: Operator;
|
|
24
26
|
[KafkaTopic.LOCATIONS]: Location;
|
|
27
|
+
[KafkaTopic.LOCATION_MENUS]: LocationMenu;
|
|
25
28
|
[KafkaTopic.LOCATION_GROUPS]: LocationGroup;
|
|
26
29
|
[KafkaTopic.LOCATION_GROUP_EMPLOYEES]: LocationGroupEmployees;
|
|
27
30
|
[KafkaTopic.WS_EVENT_backend]: WsEvent;
|
|
@@ -33,6 +36,7 @@ declare const MessageIssuer: {
|
|
|
33
36
|
consumers: Service;
|
|
34
37
|
operators: Service;
|
|
35
38
|
locations: Service;
|
|
39
|
+
location_menus: Service;
|
|
36
40
|
location_groups: Service;
|
|
37
41
|
location_group_employees: Service;
|
|
38
42
|
wsevent_backend: Service;
|
package/dist/lib/kafka/events.js
CHANGED
|
@@ -8,6 +8,7 @@ var KafkaTopic;
|
|
|
8
8
|
KafkaTopic["CONSUMERS"] = "consumers";
|
|
9
9
|
KafkaTopic["OPERATORS"] = "operators";
|
|
10
10
|
KafkaTopic["LOCATIONS"] = "locations";
|
|
11
|
+
KafkaTopic["LOCATION_MENUS"] = "location_menus";
|
|
11
12
|
KafkaTopic["LOCATION_GROUPS"] = "location_groups";
|
|
12
13
|
KafkaTopic["LOCATION_GROUP_EMPLOYEES"] = "location_group_employees";
|
|
13
14
|
KafkaTopic["WS_EVENT_backend"] = "wsevent_backend";
|
|
@@ -20,6 +21,7 @@ const MessageIssuer = {
|
|
|
20
21
|
[KafkaTopic.CONSUMERS]: serviceIdentity_1.Service.BACKEND,
|
|
21
22
|
[KafkaTopic.OPERATORS]: serviceIdentity_1.Service.BACKEND,
|
|
22
23
|
[KafkaTopic.LOCATIONS]: serviceIdentity_1.Service.BACKEND,
|
|
24
|
+
[KafkaTopic.LOCATION_MENUS]: serviceIdentity_1.Service.BACKEND,
|
|
23
25
|
[KafkaTopic.LOCATION_GROUPS]: serviceIdentity_1.Service.BACKEND,
|
|
24
26
|
[KafkaTopic.LOCATION_GROUP_EMPLOYEES]: serviceIdentity_1.Service.BACKEND,
|
|
25
27
|
[KafkaTopic.WS_EVENT_backend]: serviceIdentity_1.Service.BACKEND,
|
|
@@ -22,7 +22,11 @@ declare class Money implements Money {
|
|
|
22
22
|
private constructor();
|
|
23
23
|
clone(): Money;
|
|
24
24
|
getEuroAmount(): number;
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated Use getFormattedString in place of getEuroString
|
|
27
|
+
*/
|
|
25
28
|
getEuroString(): string;
|
|
29
|
+
getFormattedString(locale: string): string;
|
|
26
30
|
percentage(percentage: number): Money;
|
|
27
31
|
min(comparator: Money): Money;
|
|
28
32
|
max(comparator: Money): Money;
|
package/dist/lib/money/money.js
CHANGED
|
@@ -34,9 +34,23 @@ class Money {
|
|
|
34
34
|
getEuroAmount() {
|
|
35
35
|
return amountToEuro(this.value);
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* @deprecated Use getFormattedString in place of getEuroString
|
|
39
|
+
*/
|
|
37
40
|
getEuroString() {
|
|
38
41
|
return this.getEuroAmount().toFixed(2);
|
|
39
42
|
}
|
|
43
|
+
getFormattedString(locale) {
|
|
44
|
+
const transactionalLanguage = locale === 'de' ? 'de-DE' : 'en-US';
|
|
45
|
+
return new Intl.NumberFormat(transactionalLanguage, {
|
|
46
|
+
style: 'currency',
|
|
47
|
+
currency: 'EUR',
|
|
48
|
+
minimumFractionDigits: 2,
|
|
49
|
+
maximumFractionDigits: 2,
|
|
50
|
+
})
|
|
51
|
+
.format(this.getEuroAmount())
|
|
52
|
+
.replace(/\s/, ' ');
|
|
53
|
+
}
|
|
40
54
|
add(addend) {
|
|
41
55
|
return Money.fromAmount(this.value + (addend?.value || 0));
|
|
42
56
|
}
|