@mamindom/contracts 1.0.125 → 1.0.126

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.
Files changed (54) hide show
  1. package/dist/events/auth/otp-requested.interface.d.ts +6 -2
  2. package/dist/events/index.d.ts +1 -0
  3. package/dist/events/index.js +1 -0
  4. package/dist/events/orders/order-cancelled.interface.d.ts +7 -0
  5. package/dist/events/orders/order-status-changed.interface.d.ts +9 -0
  6. package/dist/events/stock/index.d.ts +5 -0
  7. package/dist/events/stock/index.js +21 -0
  8. package/dist/events/stock/stock-confirm-requested.interface.d.ts +4 -0
  9. package/dist/events/stock/stock-confirm-requested.interface.js +2 -0
  10. package/dist/events/stock/stock-release-requested.interface.d.ts +9 -0
  11. package/dist/events/stock/stock-release-requested.interface.js +2 -0
  12. package/dist/events/stock/stock-reserve-failed.interface.d.ts +9 -0
  13. package/dist/events/stock/stock-reserve-failed.interface.js +2 -0
  14. package/dist/events/stock/stock-reserve-requested.interface.d.ts +10 -0
  15. package/dist/events/stock/stock-reserve-requested.interface.js +2 -0
  16. package/dist/events/stock/stock-reserved.interface.d.ts +11 -0
  17. package/dist/events/stock/stock-reserved.interface.js +2 -0
  18. package/dist/gen/audit.d.ts +65 -0
  19. package/dist/gen/audit.js +28 -0
  20. package/dist/gen/manager.d.ts +102 -0
  21. package/dist/gen/manager.js +39 -0
  22. package/dist/gen/notification.d.ts +279 -0
  23. package/dist/gen/notification.js +119 -0
  24. package/dist/gen/product.d.ts +16 -0
  25. package/dist/gen/rbac.d.ts +111 -0
  26. package/dist/gen/rbac.js +37 -0
  27. package/dist/proto/audit.proto +59 -0
  28. package/dist/proto/manager.proto +88 -0
  29. package/dist/proto/notification.proto +317 -0
  30. package/dist/proto/product.proto +26 -9
  31. package/dist/proto/rbac.proto +109 -0
  32. package/dist/src/proto/paths.d.ts +4 -0
  33. package/dist/src/proto/paths.js +5 -1
  34. package/events/auth/otp-requested.interface.ts +10 -2
  35. package/events/index.ts +1 -0
  36. package/events/orders/order-cancelled.interface.ts +9 -0
  37. package/events/orders/order-status-changed.interface.ts +14 -0
  38. package/events/stock/index.ts +5 -0
  39. package/events/stock/stock-confirm-requested.interface.ts +6 -0
  40. package/events/stock/stock-release-requested.interface.ts +11 -0
  41. package/events/stock/stock-reserve-failed.interface.ts +8 -0
  42. package/events/stock/stock-reserve-requested.interface.ts +16 -0
  43. package/events/stock/stock-reserved.interface.ts +13 -0
  44. package/gen/audit.ts +109 -0
  45. package/gen/manager.ts +192 -0
  46. package/gen/notification.ts +427 -0
  47. package/gen/product.ts +31 -5
  48. package/gen/rbac.ts +192 -0
  49. package/package.json +1 -1
  50. package/proto/audit.proto +59 -0
  51. package/proto/manager.proto +88 -0
  52. package/proto/notification.proto +317 -0
  53. package/proto/product.proto +26 -9
  54. package/proto/rbac.proto +109 -0
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.4
5
+ // protoc v3.21.12
6
+ // source: notification.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.TELEGRAM_CHATS_SERVICE_NAME = exports.NOTIFICATION_LOGS_SERVICE_NAME = exports.NOTIFICATION_TEMPLATE_SERVICE_NAME = exports.NOTIFICATION_V1_PACKAGE_NAME = exports.TelegramTopic = exports.NotificationStatus = exports.NotificationCategory = exports.NotificationLocale = exports.NotificationChannel = exports.protobufPackage = void 0;
9
+ exports.NotificationTemplateServiceControllerMethods = NotificationTemplateServiceControllerMethods;
10
+ exports.NotificationLogsServiceControllerMethods = NotificationLogsServiceControllerMethods;
11
+ exports.TelegramChatsServiceControllerMethods = TelegramChatsServiceControllerMethods;
12
+ /* eslint-disable */
13
+ const microservices_1 = require("@nestjs/microservices");
14
+ exports.protobufPackage = "notification.v1";
15
+ var NotificationChannel;
16
+ (function (NotificationChannel) {
17
+ NotificationChannel[NotificationChannel["NOTIFICATION_CHANNEL_UNSPECIFIED"] = 0] = "NOTIFICATION_CHANNEL_UNSPECIFIED";
18
+ NotificationChannel[NotificationChannel["EMAIL"] = 1] = "EMAIL";
19
+ NotificationChannel[NotificationChannel["SMS"] = 2] = "SMS";
20
+ NotificationChannel[NotificationChannel["TELEGRAM"] = 3] = "TELEGRAM";
21
+ NotificationChannel[NotificationChannel["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
22
+ })(NotificationChannel || (exports.NotificationChannel = NotificationChannel = {}));
23
+ var NotificationLocale;
24
+ (function (NotificationLocale) {
25
+ NotificationLocale[NotificationLocale["NOTIFICATION_LOCALE_UNSPECIFIED"] = 0] = "NOTIFICATION_LOCALE_UNSPECIFIED";
26
+ NotificationLocale[NotificationLocale["UK"] = 1] = "UK";
27
+ NotificationLocale[NotificationLocale["RU"] = 2] = "RU";
28
+ NotificationLocale[NotificationLocale["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
29
+ })(NotificationLocale || (exports.NotificationLocale = NotificationLocale = {}));
30
+ var NotificationCategory;
31
+ (function (NotificationCategory) {
32
+ NotificationCategory[NotificationCategory["NOTIFICATION_CATEGORY_UNSPECIFIED"] = 0] = "NOTIFICATION_CATEGORY_UNSPECIFIED";
33
+ NotificationCategory[NotificationCategory["TRANSACTIONAL"] = 1] = "TRANSACTIONAL";
34
+ NotificationCategory[NotificationCategory["ACCOUNT"] = 2] = "ACCOUNT";
35
+ NotificationCategory[NotificationCategory["MARKETING"] = 3] = "MARKETING";
36
+ NotificationCategory[NotificationCategory["ADMIN"] = 4] = "ADMIN";
37
+ NotificationCategory[NotificationCategory["OTP"] = 5] = "OTP";
38
+ NotificationCategory[NotificationCategory["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
39
+ })(NotificationCategory || (exports.NotificationCategory = NotificationCategory = {}));
40
+ var NotificationStatus;
41
+ (function (NotificationStatus) {
42
+ NotificationStatus[NotificationStatus["NOTIFICATION_STATUS_UNSPECIFIED"] = 0] = "NOTIFICATION_STATUS_UNSPECIFIED";
43
+ NotificationStatus[NotificationStatus["PENDING"] = 1] = "PENDING";
44
+ NotificationStatus[NotificationStatus["SENT"] = 2] = "SENT";
45
+ NotificationStatus[NotificationStatus["FAILED"] = 3] = "FAILED";
46
+ NotificationStatus[NotificationStatus["SIMULATED"] = 4] = "SIMULATED";
47
+ NotificationStatus[NotificationStatus["SUPPRESSED"] = 5] = "SUPPRESSED";
48
+ NotificationStatus[NotificationStatus["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
49
+ })(NotificationStatus || (exports.NotificationStatus = NotificationStatus = {}));
50
+ var TelegramTopic;
51
+ (function (TelegramTopic) {
52
+ TelegramTopic[TelegramTopic["TELEGRAM_TOPIC_UNSPECIFIED"] = 0] = "TELEGRAM_TOPIC_UNSPECIFIED";
53
+ TelegramTopic[TelegramTopic["ORDERS"] = 1] = "ORDERS";
54
+ TelegramTopic[TelegramTopic["ORDERS_ALERTS"] = 2] = "ORDERS_ALERTS";
55
+ TelegramTopic[TelegramTopic["PAYMENTS"] = 3] = "PAYMENTS";
56
+ TelegramTopic[TelegramTopic["WAREHOUSE"] = 4] = "WAREHOUSE";
57
+ TelegramTopic[TelegramTopic["REVIEWS"] = 5] = "REVIEWS";
58
+ TelegramTopic[TelegramTopic["CALLBACK"] = 6] = "CALLBACK";
59
+ TelegramTopic[TelegramTopic["REPORTS"] = 7] = "REPORTS";
60
+ TelegramTopic[TelegramTopic["ALERTS"] = 8] = "ALERTS";
61
+ TelegramTopic[TelegramTopic["GENERAL"] = 9] = "GENERAL";
62
+ TelegramTopic[TelegramTopic["UNRECOGNIZED"] = -1] = "UNRECOGNIZED";
63
+ })(TelegramTopic || (exports.TelegramTopic = TelegramTopic = {}));
64
+ exports.NOTIFICATION_V1_PACKAGE_NAME = "notification.v1";
65
+ function NotificationTemplateServiceControllerMethods() {
66
+ return function (constructor) {
67
+ const grpcMethods = [
68
+ "listTemplates",
69
+ "getTemplate",
70
+ "upsertTemplate",
71
+ "updateTemplate",
72
+ "toggleTemplate",
73
+ "listVersions",
74
+ "restoreVersion",
75
+ "renderPreview",
76
+ "sendTest",
77
+ ];
78
+ for (const method of grpcMethods) {
79
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
80
+ (0, microservices_1.GrpcMethod)("NotificationTemplateService", method)(constructor.prototype[method], method, descriptor);
81
+ }
82
+ const grpcStreamMethods = [];
83
+ for (const method of grpcStreamMethods) {
84
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
85
+ (0, microservices_1.GrpcStreamMethod)("NotificationTemplateService", method)(constructor.prototype[method], method, descriptor);
86
+ }
87
+ };
88
+ }
89
+ exports.NOTIFICATION_TEMPLATE_SERVICE_NAME = "NotificationTemplateService";
90
+ function NotificationLogsServiceControllerMethods() {
91
+ return function (constructor) {
92
+ const grpcMethods = ["listLogs"];
93
+ for (const method of grpcMethods) {
94
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
95
+ (0, microservices_1.GrpcMethod)("NotificationLogsService", method)(constructor.prototype[method], method, descriptor);
96
+ }
97
+ const grpcStreamMethods = [];
98
+ for (const method of grpcStreamMethods) {
99
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
100
+ (0, microservices_1.GrpcStreamMethod)("NotificationLogsService", method)(constructor.prototype[method], method, descriptor);
101
+ }
102
+ };
103
+ }
104
+ exports.NOTIFICATION_LOGS_SERVICE_NAME = "NotificationLogsService";
105
+ function TelegramChatsServiceControllerMethods() {
106
+ return function (constructor) {
107
+ const grpcMethods = ["listChats", "upsertChat", "deleteChat", "testSendTelegram"];
108
+ for (const method of grpcMethods) {
109
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
110
+ (0, microservices_1.GrpcMethod)("TelegramChatsService", method)(constructor.prototype[method], method, descriptor);
111
+ }
112
+ const grpcStreamMethods = [];
113
+ for (const method of grpcStreamMethods) {
114
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
115
+ (0, microservices_1.GrpcStreamMethod)("TelegramChatsService", method)(constructor.prototype[method], method, descriptor);
116
+ }
117
+ };
118
+ }
119
+ exports.TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
@@ -101,6 +101,8 @@ export interface ProductListItemResponse {
101
101
  reviewCount: number;
102
102
  stickers: ProductStickerResponse[];
103
103
  activePromo?: ProductPromoInfo | undefined;
104
+ /** Вага у кг для розрахунку доставки (0 → fallback на defaultItemWeightKg). */
105
+ weightKg: number;
104
106
  }
105
107
  export interface ProductListItemResponse_NameEntry {
106
108
  key: string;
@@ -164,6 +166,8 @@ export interface ProductDetailResponse {
164
166
  manualRating?: number | undefined;
165
167
  activePromo?: ProductPromoInfo | undefined;
166
168
  colors: ProductColorResponse[];
169
+ /** Вага товару у кг для розрахунку доставки (variant може override'ити). */
170
+ weightKg: number;
167
171
  }
168
172
  export interface ProductDetailResponse_NameEntry {
169
173
  key: string;
@@ -373,6 +377,7 @@ export interface CreateProductRequest {
373
377
  [key: string]: string;
374
378
  };
375
379
  colorHex?: string | undefined;
380
+ weightKg?: number | undefined;
376
381
  }
377
382
  export interface CreateProductRequest_NameEntry {
378
383
  key: string;
@@ -436,6 +441,7 @@ export interface UpdateProductRequest {
436
441
  };
437
442
  colorHex?: string | undefined;
438
443
  manualRating?: number | undefined;
444
+ weightKg?: number | undefined;
439
445
  }
440
446
  export interface UpdateProductRequest_NameEntry {
441
447
  key: string;
@@ -673,6 +679,8 @@ export interface ProductVariantDetailResponse {
673
679
  attributes: ProductAttributeResponse[];
674
680
  overrides: VariantOverrides | undefined;
675
681
  colorId?: string | undefined;
682
+ /** Override-вага варіанту у кг; 0 означає "успадкувати від продукту". */
683
+ weightKg: number;
676
684
  }
677
685
  export interface ProductVariantDetailResponse_OptionsEntry {
678
686
  key: string;
@@ -710,6 +718,7 @@ export interface VariantOverrides {
710
718
  hasOwnAttributes: boolean;
711
719
  hasOwnVideo: boolean;
712
720
  hasOwnOldPrice: boolean;
721
+ hasOwnWeight: boolean;
713
722
  }
714
723
  export interface CreateProductVariantRequest {
715
724
  productId: string;
@@ -743,6 +752,8 @@ export interface CreateProductVariantRequest {
743
752
  images: ProductImagePayload[];
744
753
  attributeValueIds: string[];
745
754
  colorId?: string | undefined;
755
+ /** Override-вага варіанту у кг (null/unset → успадкувати від продукту). */
756
+ weightKg?: number | undefined;
746
757
  }
747
758
  export interface CreateProductVariantRequest_OptionsEntry {
748
759
  key: string;
@@ -800,6 +811,8 @@ export interface UpdateProductVariantRequest {
800
811
  images: ProductImagePayload[];
801
812
  attributeValueIds: string[];
802
813
  colorId?: string | undefined;
814
+ /** Override-вага варіанту у кг (null/unset → успадкувати від продукту). */
815
+ weightKg?: number | undefined;
803
816
  clearPrice: boolean;
804
817
  clearOldPrice: boolean;
805
818
  clearName: boolean;
@@ -812,6 +825,7 @@ export interface UpdateProductVariantRequest {
812
825
  clearAttributes: boolean;
813
826
  clearVideo: boolean;
814
827
  clearColor: boolean;
828
+ clearWeight: boolean;
815
829
  }
816
830
  export interface UpdateProductVariantRequest_OptionsEntry {
817
831
  key: string;
@@ -882,6 +896,8 @@ export interface VariantLookupResult {
882
896
  nameUk: string;
883
897
  mainImage: string;
884
898
  colorId?: string | undefined;
899
+ /** Вага у кг (variant.weight_kg ?? product.weight_kg ?? 0). */
900
+ weightKg: number;
885
901
  }
886
902
  export interface BulkLookupVariantsRequest {
887
903
  variantIds: string[];
@@ -0,0 +1,111 @@
1
+ import { Observable } from "rxjs";
2
+ export declare const protobufPackage = "rbac.v1";
3
+ export interface RbacPermission {
4
+ id: string;
5
+ key: string;
6
+ groupKey: string;
7
+ label: string;
8
+ description: string;
9
+ }
10
+ export interface RbacRole {
11
+ id: string;
12
+ slug: string;
13
+ name: string;
14
+ description: string;
15
+ color: string;
16
+ isSystem: boolean;
17
+ isProtected: boolean;
18
+ usersCount: number;
19
+ permissionKeys: string[];
20
+ createdAt: string;
21
+ updatedAt: string;
22
+ }
23
+ export interface ListPermissionsRequest {
24
+ }
25
+ export interface ListPermissionsResponse {
26
+ items: RbacPermission[];
27
+ }
28
+ export interface ListRolesRequest {
29
+ search?: string | undefined;
30
+ }
31
+ export interface ListRolesResponse {
32
+ items: RbacRole[];
33
+ }
34
+ export interface GetRoleRequest {
35
+ id: string;
36
+ }
37
+ export interface CreateRoleRequest {
38
+ slug: string;
39
+ name: string;
40
+ description: string;
41
+ color: string;
42
+ permissionKeys: string[];
43
+ }
44
+ export interface UpdateRoleRequest {
45
+ id: string;
46
+ name?: string | undefined;
47
+ description?: string | undefined;
48
+ color?: string | undefined;
49
+ /** Якщо передано — повна заміна; якщо не передано — без змін. */
50
+ permissionKeys: string[];
51
+ replacePermissions: boolean;
52
+ }
53
+ export interface DeleteRoleRequest {
54
+ id: string;
55
+ }
56
+ export interface DeleteRoleResponse {
57
+ ok: boolean;
58
+ }
59
+ export interface AssignAccountRoleRequest {
60
+ accountId: string;
61
+ /**
62
+ * Якщо custom_role_id порожній — користувач відвʼязується від кастомної ролі,
63
+ * і дозволи беруться з системної.
64
+ */
65
+ customRoleId?: string | undefined;
66
+ }
67
+ export interface AssignAccountRoleResponse {
68
+ ok: boolean;
69
+ }
70
+ export interface GetAccountPermissionsRequest {
71
+ accountId: string;
72
+ }
73
+ export interface GetAccountPermissionsResponse {
74
+ /**
75
+ * Effective permissions з урахуванням system role + custom role override.
76
+ * Може містити "*" — повний доступ (ADMIN).
77
+ */
78
+ permissionKeys: string[];
79
+ /** Слаг ефективної ролі (для UI/labels). */
80
+ roleSlug: string;
81
+ roleName: string;
82
+ }
83
+ export declare const RBAC_V1_PACKAGE_NAME = "rbac.v1";
84
+ export interface RbacServiceClient {
85
+ /** Permissions catalog (read-only, seeded). */
86
+ listPermissions(request: ListPermissionsRequest): Observable<ListPermissionsResponse>;
87
+ /** Roles CRUD. */
88
+ listRoles(request: ListRolesRequest): Observable<ListRolesResponse>;
89
+ getRole(request: GetRoleRequest): Observable<RbacRole>;
90
+ createRole(request: CreateRoleRequest): Observable<RbacRole>;
91
+ updateRole(request: UpdateRoleRequest): Observable<RbacRole>;
92
+ deleteRole(request: DeleteRoleRequest): Observable<DeleteRoleResponse>;
93
+ /** Account ↔ role bindings. */
94
+ assignAccountRole(request: AssignAccountRoleRequest): Observable<AssignAccountRoleResponse>;
95
+ getAccountPermissions(request: GetAccountPermissionsRequest): Observable<GetAccountPermissionsResponse>;
96
+ }
97
+ export interface RbacServiceController {
98
+ /** Permissions catalog (read-only, seeded). */
99
+ listPermissions(request: ListPermissionsRequest): Promise<ListPermissionsResponse> | Observable<ListPermissionsResponse> | ListPermissionsResponse;
100
+ /** Roles CRUD. */
101
+ listRoles(request: ListRolesRequest): Promise<ListRolesResponse> | Observable<ListRolesResponse> | ListRolesResponse;
102
+ getRole(request: GetRoleRequest): Promise<RbacRole> | Observable<RbacRole> | RbacRole;
103
+ createRole(request: CreateRoleRequest): Promise<RbacRole> | Observable<RbacRole> | RbacRole;
104
+ updateRole(request: UpdateRoleRequest): Promise<RbacRole> | Observable<RbacRole> | RbacRole;
105
+ deleteRole(request: DeleteRoleRequest): Promise<DeleteRoleResponse> | Observable<DeleteRoleResponse> | DeleteRoleResponse;
106
+ /** Account ↔ role bindings. */
107
+ assignAccountRole(request: AssignAccountRoleRequest): Promise<AssignAccountRoleResponse> | Observable<AssignAccountRoleResponse> | AssignAccountRoleResponse;
108
+ getAccountPermissions(request: GetAccountPermissionsRequest): Promise<GetAccountPermissionsResponse> | Observable<GetAccountPermissionsResponse> | GetAccountPermissionsResponse;
109
+ }
110
+ export declare function RbacServiceControllerMethods(): (constructor: Function) => void;
111
+ export declare const RBAC_SERVICE_NAME = "RbacService";
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
3
+ // versions:
4
+ // protoc-gen-ts_proto v2.11.4
5
+ // protoc v3.21.12
6
+ // source: rbac.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.RBAC_SERVICE_NAME = exports.RBAC_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.RbacServiceControllerMethods = RbacServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "rbac.v1";
13
+ exports.RBAC_V1_PACKAGE_NAME = "rbac.v1";
14
+ function RbacServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = [
17
+ "listPermissions",
18
+ "listRoles",
19
+ "getRole",
20
+ "createRole",
21
+ "updateRole",
22
+ "deleteRole",
23
+ "assignAccountRole",
24
+ "getAccountPermissions",
25
+ ];
26
+ for (const method of grpcMethods) {
27
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
28
+ (0, microservices_1.GrpcMethod)("RbacService", method)(constructor.prototype[method], method, descriptor);
29
+ }
30
+ const grpcStreamMethods = [];
31
+ for (const method of grpcStreamMethods) {
32
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
33
+ (0, microservices_1.GrpcStreamMethod)("RbacService", method)(constructor.prototype[method], method, descriptor);
34
+ }
35
+ };
36
+ }
37
+ exports.RBAC_SERVICE_NAME = "RbacService";
@@ -0,0 +1,59 @@
1
+ syntax = "proto3";
2
+
3
+ package audit.v1;
4
+
5
+ service AuditService {
6
+ rpc LogAction(LogActionRequest) returns (LogActionResponse);
7
+ rpc ListAudit(ListAuditRequest) returns (ListAuditResponse);
8
+ }
9
+
10
+ message LogActionRequest {
11
+ optional string actor_id = 1;
12
+ optional string actor_name = 2;
13
+ optional string actor_email = 3;
14
+ string action = 4; // e.g. "order.cancelled", "product.price_changed"
15
+ string target_type = 5; // e.g. "order", "product", "role"
16
+ optional string target_id = 6;
17
+ optional string summary = 7; // human-readable summary
18
+ optional string before_json = 8; // serialized JSON snapshot (small!)
19
+ optional string after_json = 9;
20
+ optional string ip = 10;
21
+ optional string user_agent = 11;
22
+ }
23
+
24
+ message LogActionResponse {
25
+ bool ok = 1;
26
+ }
27
+
28
+ message ListAuditRequest {
29
+ optional int32 page = 1;
30
+ optional int32 limit = 2;
31
+ optional string actor_id = 3;
32
+ optional string target_type = 4;
33
+ optional string target_id = 5;
34
+ optional string action = 6;
35
+ optional string action_group = 7; // "orders" matches order.* etc
36
+ optional string from = 8; // ISO date
37
+ optional string to = 9;
38
+ }
39
+
40
+ message AuditEntry {
41
+ string id = 1;
42
+ string actor_id = 2;
43
+ string actor_name = 3;
44
+ string actor_email = 4;
45
+ string action = 5;
46
+ string target_type = 6;
47
+ string target_id = 7;
48
+ string summary = 8;
49
+ string before_json = 9;
50
+ string after_json = 10;
51
+ string ip = 11;
52
+ string user_agent = 12;
53
+ string created_at = 13;
54
+ }
55
+
56
+ message ListAuditResponse {
57
+ repeated AuditEntry items = 1;
58
+ int32 total = 2;
59
+ }
@@ -0,0 +1,88 @@
1
+ syntax = "proto3";
2
+
3
+ package manager.v1;
4
+
5
+ service ManagerService {
6
+ rpc ListManagers(ListManagersRequest) returns (ListManagersResponse);
7
+ rpc GetManager(GetManagerRequest) returns (ManagerProfileDto);
8
+ rpc CreateManager(CreateManagerRequest) returns (ManagerProfileDto);
9
+ rpc UpdateManager(UpdateManagerRequest) returns (ManagerProfileDto);
10
+ rpc SetManagerActive(SetManagerActiveRequest) returns (ManagerProfileDto);
11
+ rpc TerminateManager(TerminateManagerRequest) returns (ManagerProfileDto);
12
+ rpc ReorderManagers(ReorderManagersRequest) returns (BoolResult);
13
+ rpc AddVacation(AddVacationRequest) returns (AddVacationResponse);
14
+ rpc DeleteVacation(DeleteVacationRequest) returns (BoolResult);
15
+ rpc ReassignUnassigned(ReassignUnassignedRequest) returns (ReassignUnassignedResponse);
16
+ }
17
+
18
+ message Vacation {
19
+ string id = 1;
20
+ string starts_at = 2;
21
+ string ends_at = 3;
22
+ string reason = 4;
23
+ }
24
+
25
+ message ManagerProfileDto {
26
+ string id = 1;
27
+ string account_id = 2;
28
+ string display_name = 3;
29
+ string email = 4;
30
+ bool is_active = 5;
31
+ int32 queue_order = 6;
32
+ int32 assigned_count = 7;
33
+ string terminated_at = 8;
34
+ string reassignment_strategy = 9;
35
+ repeated Vacation vacations = 10;
36
+ string created_at = 11;
37
+ string updated_at = 12;
38
+ }
39
+
40
+ message ListManagersRequest {}
41
+ message ListManagersResponse {
42
+ repeated ManagerProfileDto items = 1;
43
+ }
44
+
45
+ message GetManagerRequest { string id = 1; }
46
+
47
+ message CreateManagerRequest {
48
+ string account_id = 1;
49
+ optional string display_name = 2;
50
+ optional string email = 3;
51
+ optional string reassignment_strategy = 4; // URGENT_ONLY | ALL
52
+ }
53
+
54
+ message UpdateManagerRequest {
55
+ string id = 1;
56
+ optional string display_name = 2;
57
+ optional string email = 3;
58
+ optional string reassignment_strategy = 4;
59
+ }
60
+
61
+ message SetManagerActiveRequest {
62
+ string id = 1;
63
+ bool is_active = 2;
64
+ }
65
+
66
+ message TerminateManagerRequest { string id = 1; }
67
+
68
+ message ReorderManagersRequest {
69
+ repeated string ordered_ids = 1;
70
+ }
71
+
72
+ message AddVacationRequest {
73
+ string manager_id = 1;
74
+ string starts_at = 2; // ISO date
75
+ string ends_at = 3;
76
+ optional string reason = 4;
77
+ }
78
+ message AddVacationResponse { string id = 1; }
79
+
80
+ message DeleteVacationRequest { string id = 1; }
81
+
82
+ message ReassignUnassignedRequest {}
83
+ message ReassignUnassignedResponse {
84
+ bool ok = 1;
85
+ int32 reassigned_count = 2;
86
+ }
87
+
88
+ message BoolResult { bool ok = 1; }