@mamindom/common 1.0.99 → 1.0.101

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.
@@ -53,16 +53,20 @@ let GrpcClientFactory = (() => {
53
53
  }
54
54
  clients = new Map();
55
55
  createClient(options) {
56
+ const channelOptions = {
57
+ 'grpc.service_config': JSON.stringify({
58
+ loadBalancingConfig: [{ round_robin: {} }]
59
+ }),
60
+ ...options.channelOptions
61
+ };
56
62
  return microservices_1.ClientProxyFactory.create({
57
63
  transport: microservices_1.Transport.GRPC,
58
64
  options: {
59
65
  ...options,
66
+ channelOptions,
60
67
  loader: {
61
68
  keepCase: false,
62
69
  longs: String,
63
- // enums: String — інакше enum'и приходять як числа (1, 2…), а
64
- // фронт чекає string-keys ('EMAIL'/'UK'/etc.) і CHANNEL_LABEL[1]
65
- // дає undefined. Бекенд-сервіси у grpc.options теж сетять String.
66
70
  enums: String,
67
71
  defaults: true,
68
72
  oneofs: false
@@ -42,7 +42,13 @@ exports.PERMISSION_GROUPS = [
42
42
  permissions: [
43
43
  { key: 'customers.view', groupKey: 'customers', label: 'Перегляд клієнтів' },
44
44
  { key: 'customers.edit', groupKey: 'customers', label: 'Редагування клієнтів' },
45
- { key: 'customers.export', groupKey: 'customers', label: 'Експорт бази' }
45
+ { key: 'customers.export', groupKey: 'customers', label: 'Експорт бази' },
46
+ {
47
+ key: 'customers.notify',
48
+ groupKey: 'customers',
49
+ label: 'Надсилання повідомлень',
50
+ description: 'Email/SMS з адмінки + персональні промокоди'
51
+ }
46
52
  ]
47
53
  },
48
54
  {
@@ -129,6 +135,7 @@ exports.SYSTEM_ROLE_DEFAULTS = {
129
135
  'orders.assign',
130
136
  'customers.view',
131
137
  'customers.edit',
138
+ 'customers.notify',
132
139
  'reviews.view',
133
140
  'reviews.moderate',
134
141
  'products.view',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mamindom/common",
3
- "version": "1.0.99",
3
+ "version": "1.0.101",
4
4
  "type": "commonjs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,7 +21,7 @@
21
21
  "typescript": "^5.9.3"
22
22
  },
23
23
  "dependencies": {
24
- "@mamindom/contracts": "^1.0.129",
24
+ "@mamindom/contracts": "^1.0.131",
25
25
  "@nestjs/common": "^11.1.16",
26
26
  "@nestjs/config": "^4.0.3",
27
27
  "@nestjs/microservices": "^11.1.16"