@mamindom/contracts 1.0.126 → 1.0.129
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/gen/cart.d.ts +5 -0
- package/dist/gen/manager.d.ts +15 -0
- package/dist/gen/manager.js +1 -0
- package/dist/gen/notification.d.ts +44 -0
- package/dist/gen/notification.js +17 -1
- package/dist/gen/order.d.ts +16 -0
- package/dist/gen/payment.d.ts +16 -0
- package/dist/gen/payment.js +1 -0
- package/dist/proto/cart.proto +3 -0
- package/dist/proto/manager.proto +6 -0
- package/dist/proto/notification.proto +36 -0
- package/dist/proto/order.proto +11 -0
- package/dist/proto/payment.proto +10 -0
- package/gen/cart.ts +5 -0
- package/gen/manager.ts +23 -0
- package/gen/notification.ts +70 -0
- package/gen/order.ts +16 -0
- package/gen/payment.ts +24 -0
- package/package.json +1 -1
- package/proto/cart.proto +3 -0
- package/proto/manager.proto +6 -0
- package/proto/notification.proto +36 -0
- package/proto/order.proto +11 -0
- package/proto/payment.proto +10 -0
package/dist/gen/cart.d.ts
CHANGED
|
@@ -57,6 +57,11 @@ export interface DeliveryDraft {
|
|
|
57
57
|
pickupPointId: string;
|
|
58
58
|
cost: number;
|
|
59
59
|
freeShipping: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Область з City.region — клієнт передає при виборі міста, щоб
|
|
62
|
+
* потім order-service зміг записати в snapshot замовлення.
|
|
63
|
+
*/
|
|
64
|
+
region: string;
|
|
60
65
|
}
|
|
61
66
|
export interface PaymentDraft {
|
|
62
67
|
provider: string;
|
package/dist/gen/manager.d.ts
CHANGED
|
@@ -28,6 +28,9 @@ export interface ListManagersResponse {
|
|
|
28
28
|
export interface GetManagerRequest {
|
|
29
29
|
id: string;
|
|
30
30
|
}
|
|
31
|
+
export interface GetManagerByAccountRequest {
|
|
32
|
+
accountId: string;
|
|
33
|
+
}
|
|
31
34
|
export interface CreateManagerRequest {
|
|
32
35
|
accountId: string;
|
|
33
36
|
displayName?: string | undefined;
|
|
@@ -77,6 +80,12 @@ export declare const MANAGER_V1_PACKAGE_NAME = "manager.v1";
|
|
|
77
80
|
export interface ManagerServiceClient {
|
|
78
81
|
listManagers(request: ListManagersRequest): Observable<ListManagersResponse>;
|
|
79
82
|
getManager(request: GetManagerRequest): Observable<ManagerProfileDto>;
|
|
83
|
+
/**
|
|
84
|
+
* Резолв account_id (з auth-service) → ManagerProfile. Використовується
|
|
85
|
+
* у gateway щоб з'ясувати ManagerProfile.id для логіну-під-менеджером —
|
|
86
|
+
* order.managerId зберігає ManagerProfile.id, а не Account.id.
|
|
87
|
+
*/
|
|
88
|
+
getManagerByAccount(request: GetManagerByAccountRequest): Observable<ManagerProfileDto>;
|
|
80
89
|
createManager(request: CreateManagerRequest): Observable<ManagerProfileDto>;
|
|
81
90
|
updateManager(request: UpdateManagerRequest): Observable<ManagerProfileDto>;
|
|
82
91
|
setManagerActive(request: SetManagerActiveRequest): Observable<ManagerProfileDto>;
|
|
@@ -89,6 +98,12 @@ export interface ManagerServiceClient {
|
|
|
89
98
|
export interface ManagerServiceController {
|
|
90
99
|
listManagers(request: ListManagersRequest): Promise<ListManagersResponse> | Observable<ListManagersResponse> | ListManagersResponse;
|
|
91
100
|
getManager(request: GetManagerRequest): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
101
|
+
/**
|
|
102
|
+
* Резолв account_id (з auth-service) → ManagerProfile. Використовується
|
|
103
|
+
* у gateway щоб з'ясувати ManagerProfile.id для логіну-під-менеджером —
|
|
104
|
+
* order.managerId зберігає ManagerProfile.id, а не Account.id.
|
|
105
|
+
*/
|
|
106
|
+
getManagerByAccount(request: GetManagerByAccountRequest): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
92
107
|
createManager(request: CreateManagerRequest): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
93
108
|
updateManager(request: UpdateManagerRequest): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
94
109
|
setManagerActive(request: SetManagerActiveRequest): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
package/dist/gen/manager.js
CHANGED
|
@@ -44,6 +44,38 @@ export declare enum TelegramTopic {
|
|
|
44
44
|
GENERAL = 9,
|
|
45
45
|
UNRECOGNIZED = -1
|
|
46
46
|
}
|
|
47
|
+
export interface BrandingEmpty {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Поля що поверталися з resolved-merge (DB ∪ env). Порожні рядки означають
|
|
51
|
+
* "взяти fallback з env" при наступному GET.
|
|
52
|
+
*/
|
|
53
|
+
export interface BrandingProfile {
|
|
54
|
+
logoUrl: string;
|
|
55
|
+
brandName: string;
|
|
56
|
+
brandUrl: string;
|
|
57
|
+
supportEmail: string;
|
|
58
|
+
footerHtml: string;
|
|
59
|
+
updatedAt: number;
|
|
60
|
+
updatedBy: string;
|
|
61
|
+
/**
|
|
62
|
+
* resolved: остаточні значення, що використовуються wrapper'ом
|
|
63
|
+
* (DB override → env fallback). Для UI щоб показати "поточне значення".
|
|
64
|
+
*/
|
|
65
|
+
resolvedLogoUrl: string;
|
|
66
|
+
resolvedBrandName: string;
|
|
67
|
+
resolvedBrandUrl: string;
|
|
68
|
+
resolvedSupportEmail: string;
|
|
69
|
+
}
|
|
70
|
+
export interface UpdateBrandingRequest {
|
|
71
|
+
/** optional: відсутність → не оновлювати; порожній рядок → скинути до NULL у БД. */
|
|
72
|
+
logoUrl?: string | undefined;
|
|
73
|
+
brandName?: string | undefined;
|
|
74
|
+
brandUrl?: string | undefined;
|
|
75
|
+
supportEmail?: string | undefined;
|
|
76
|
+
footerHtml?: string | undefined;
|
|
77
|
+
actorId: string;
|
|
78
|
+
}
|
|
47
79
|
export interface NotificationTemplate {
|
|
48
80
|
id: string;
|
|
49
81
|
key: string;
|
|
@@ -277,3 +309,15 @@ export interface TelegramChatsServiceController {
|
|
|
277
309
|
}
|
|
278
310
|
export declare function TelegramChatsServiceControllerMethods(): (constructor: Function) => void;
|
|
279
311
|
export declare const TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
|
312
|
+
/** Брендинг email-шаблонів — singleton редагується адміном. */
|
|
313
|
+
export interface BrandingServiceClient {
|
|
314
|
+
getBranding(request: BrandingEmpty): Observable<BrandingProfile>;
|
|
315
|
+
updateBranding(request: UpdateBrandingRequest): Observable<BrandingProfile>;
|
|
316
|
+
}
|
|
317
|
+
/** Брендинг email-шаблонів — singleton редагується адміном. */
|
|
318
|
+
export interface BrandingServiceController {
|
|
319
|
+
getBranding(request: BrandingEmpty): Promise<BrandingProfile> | Observable<BrandingProfile> | BrandingProfile;
|
|
320
|
+
updateBranding(request: UpdateBrandingRequest): Promise<BrandingProfile> | Observable<BrandingProfile> | BrandingProfile;
|
|
321
|
+
}
|
|
322
|
+
export declare function BrandingServiceControllerMethods(): (constructor: Function) => void;
|
|
323
|
+
export declare const BRANDING_SERVICE_NAME = "BrandingService";
|
package/dist/gen/notification.js
CHANGED
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
// protoc v3.21.12
|
|
6
6
|
// source: notification.proto
|
|
7
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;
|
|
8
|
+
exports.BRANDING_SERVICE_NAME = 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
9
|
exports.NotificationTemplateServiceControllerMethods = NotificationTemplateServiceControllerMethods;
|
|
10
10
|
exports.NotificationLogsServiceControllerMethods = NotificationLogsServiceControllerMethods;
|
|
11
11
|
exports.TelegramChatsServiceControllerMethods = TelegramChatsServiceControllerMethods;
|
|
12
|
+
exports.BrandingServiceControllerMethods = BrandingServiceControllerMethods;
|
|
12
13
|
/* eslint-disable */
|
|
13
14
|
const microservices_1 = require("@nestjs/microservices");
|
|
14
15
|
exports.protobufPackage = "notification.v1";
|
|
@@ -117,3 +118,18 @@ function TelegramChatsServiceControllerMethods() {
|
|
|
117
118
|
};
|
|
118
119
|
}
|
|
119
120
|
exports.TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
|
121
|
+
function BrandingServiceControllerMethods() {
|
|
122
|
+
return function (constructor) {
|
|
123
|
+
const grpcMethods = ["getBranding", "updateBranding"];
|
|
124
|
+
for (const method of grpcMethods) {
|
|
125
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
126
|
+
(0, microservices_1.GrpcMethod)("BrandingService", method)(constructor.prototype[method], method, descriptor);
|
|
127
|
+
}
|
|
128
|
+
const grpcStreamMethods = [];
|
|
129
|
+
for (const method of grpcStreamMethods) {
|
|
130
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
131
|
+
(0, microservices_1.GrpcStreamMethod)("BrandingService", method)(constructor.prototype[method], method, descriptor);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
exports.BRANDING_SERVICE_NAME = "BrandingService";
|
package/dist/gen/order.d.ts
CHANGED
|
@@ -33,6 +33,11 @@ export interface OrderDelivery {
|
|
|
33
33
|
trackingUrl: string;
|
|
34
34
|
estimatedDate: string;
|
|
35
35
|
shipmentStatus: string;
|
|
36
|
+
/**
|
|
37
|
+
* Адмін-облік: область/регіон з City.region від delivery-service.
|
|
38
|
+
* Старі замовлення можуть мати порожнє значення.
|
|
39
|
+
*/
|
|
40
|
+
region: string;
|
|
36
41
|
}
|
|
37
42
|
export interface OrderPayment {
|
|
38
43
|
provider: string;
|
|
@@ -45,6 +50,12 @@ export interface OrderPayment {
|
|
|
45
50
|
capturedAt: number;
|
|
46
51
|
cancelledAt: number;
|
|
47
52
|
refundedAt: number;
|
|
53
|
+
/**
|
|
54
|
+
* Денормалізовано з payment-service для відображення в адмінці
|
|
55
|
+
* без додаткового gRPC дзвінка. Оновлюється з payment-events listener.
|
|
56
|
+
*/
|
|
57
|
+
capturedAmount: number;
|
|
58
|
+
refundedAmount: number;
|
|
48
59
|
}
|
|
49
60
|
export interface OrderNote {
|
|
50
61
|
id: string;
|
|
@@ -106,6 +117,11 @@ export interface Order {
|
|
|
106
117
|
tags: string[];
|
|
107
118
|
createdAt: number;
|
|
108
119
|
updatedAt: number;
|
|
120
|
+
/**
|
|
121
|
+
* Внутрішні нотатки менеджерів (видимі тільки в адмінці).
|
|
122
|
+
* Сортуються від новіших до старіших — server-side.
|
|
123
|
+
*/
|
|
124
|
+
notes: OrderNote[];
|
|
109
125
|
}
|
|
110
126
|
export interface CreateOrderRequest {
|
|
111
127
|
idempotencyKey: string;
|
package/dist/gen/payment.d.ts
CHANGED
|
@@ -87,6 +87,10 @@ export interface RefundRequest {
|
|
|
87
87
|
export interface SyncStatusRequest {
|
|
88
88
|
id: string;
|
|
89
89
|
}
|
|
90
|
+
export interface RegenerateInvoiceRequest {
|
|
91
|
+
id: string;
|
|
92
|
+
actorId: string;
|
|
93
|
+
}
|
|
90
94
|
export interface ListProvidersRequest {
|
|
91
95
|
onlyEnabled: boolean;
|
|
92
96
|
}
|
|
@@ -122,6 +126,12 @@ export interface PaymentServiceClient {
|
|
|
122
126
|
refund(request: RefundRequest): Observable<PaymentResponse>;
|
|
123
127
|
/** SyncStatus — підтягує актуальний статус від провайдера (manual reconciliation). */
|
|
124
128
|
syncStatus(request: SyncStatusRequest): Observable<PaymentResponse>;
|
|
129
|
+
/**
|
|
130
|
+
* RegenerateInvoice — створює новий invoice у провайдера для існуючого Payment.
|
|
131
|
+
* Використовується коли paymentUrl застарів (TTL у Mono ≈ 24г) або клієнт
|
|
132
|
+
* загубив SMS — менеджер ділиться новим лінком через адмін UI.
|
|
133
|
+
*/
|
|
134
|
+
regenerateInvoice(request: RegenerateInvoiceRequest): Observable<PaymentResponse>;
|
|
125
135
|
listProviders(request: ListProvidersRequest): Observable<ListProvidersResponse>;
|
|
126
136
|
toggleProvider(request: ToggleProviderRequest): Observable<ToggleProviderResponse>;
|
|
127
137
|
}
|
|
@@ -139,6 +149,12 @@ export interface PaymentServiceController {
|
|
|
139
149
|
refund(request: RefundRequest): Promise<PaymentResponse> | Observable<PaymentResponse> | PaymentResponse;
|
|
140
150
|
/** SyncStatus — підтягує актуальний статус від провайдера (manual reconciliation). */
|
|
141
151
|
syncStatus(request: SyncStatusRequest): Promise<PaymentResponse> | Observable<PaymentResponse> | PaymentResponse;
|
|
152
|
+
/**
|
|
153
|
+
* RegenerateInvoice — створює новий invoice у провайдера для існуючого Payment.
|
|
154
|
+
* Використовується коли paymentUrl застарів (TTL у Mono ≈ 24г) або клієнт
|
|
155
|
+
* загубив SMS — менеджер ділиться новим лінком через адмін UI.
|
|
156
|
+
*/
|
|
157
|
+
regenerateInvoice(request: RegenerateInvoiceRequest): Promise<PaymentResponse> | Observable<PaymentResponse> | PaymentResponse;
|
|
142
158
|
listProviders(request: ListProvidersRequest): Promise<ListProvidersResponse> | Observable<ListProvidersResponse> | ListProvidersResponse;
|
|
143
159
|
toggleProvider(request: ToggleProviderRequest): Promise<ToggleProviderResponse> | Observable<ToggleProviderResponse> | ToggleProviderResponse;
|
|
144
160
|
}
|
package/dist/gen/payment.js
CHANGED
package/dist/proto/cart.proto
CHANGED
|
@@ -100,6 +100,9 @@ message DeliveryDraft {
|
|
|
100
100
|
string pickup_point_id = 7;
|
|
101
101
|
double cost = 8;
|
|
102
102
|
bool free_shipping = 9;
|
|
103
|
+
// Область з City.region — клієнт передає при виборі міста, щоб
|
|
104
|
+
// потім order-service зміг записати в snapshot замовлення.
|
|
105
|
+
string region = 10;
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
message PaymentDraft {
|
package/dist/proto/manager.proto
CHANGED
|
@@ -5,6 +5,10 @@ package manager.v1;
|
|
|
5
5
|
service ManagerService {
|
|
6
6
|
rpc ListManagers(ListManagersRequest) returns (ListManagersResponse);
|
|
7
7
|
rpc GetManager(GetManagerRequest) returns (ManagerProfileDto);
|
|
8
|
+
// Резолв account_id (з auth-service) → ManagerProfile. Використовується
|
|
9
|
+
// у gateway щоб з'ясувати ManagerProfile.id для логіну-під-менеджером —
|
|
10
|
+
// order.managerId зберігає ManagerProfile.id, а не Account.id.
|
|
11
|
+
rpc GetManagerByAccount(GetManagerByAccountRequest) returns (ManagerProfileDto);
|
|
8
12
|
rpc CreateManager(CreateManagerRequest) returns (ManagerProfileDto);
|
|
9
13
|
rpc UpdateManager(UpdateManagerRequest) returns (ManagerProfileDto);
|
|
10
14
|
rpc SetManagerActive(SetManagerActiveRequest) returns (ManagerProfileDto);
|
|
@@ -44,6 +48,8 @@ message ListManagersResponse {
|
|
|
44
48
|
|
|
45
49
|
message GetManagerRequest { string id = 1; }
|
|
46
50
|
|
|
51
|
+
message GetManagerByAccountRequest { string account_id = 1; }
|
|
52
|
+
|
|
47
53
|
message CreateManagerRequest {
|
|
48
54
|
string account_id = 1;
|
|
49
55
|
optional string display_name = 2;
|
|
@@ -29,6 +29,42 @@ service TelegramChatsService {
|
|
|
29
29
|
rpc TestSendTelegram (TestSendTelegramRequest) returns (TestSendTelegramResponse);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// Брендинг email-шаблонів — singleton редагується адміном.
|
|
33
|
+
service BrandingService {
|
|
34
|
+
rpc GetBranding (BrandingEmpty) returns (BrandingProfile);
|
|
35
|
+
rpc UpdateBranding (UpdateBrandingRequest) returns (BrandingProfile);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message BrandingEmpty {}
|
|
39
|
+
|
|
40
|
+
// Поля що поверталися з resolved-merge (DB ∪ env). Порожні рядки означають
|
|
41
|
+
// "взяти fallback з env" при наступному GET.
|
|
42
|
+
message BrandingProfile {
|
|
43
|
+
string logo_url = 1;
|
|
44
|
+
string brand_name = 2;
|
|
45
|
+
string brand_url = 3;
|
|
46
|
+
string support_email = 4;
|
|
47
|
+
string footer_html = 5;
|
|
48
|
+
int64 updated_at = 6;
|
|
49
|
+
string updated_by = 7;
|
|
50
|
+
// resolved: остаточні значення, що використовуються wrapper'ом
|
|
51
|
+
// (DB override → env fallback). Для UI щоб показати "поточне значення".
|
|
52
|
+
string resolved_logo_url = 8;
|
|
53
|
+
string resolved_brand_name = 9;
|
|
54
|
+
string resolved_brand_url = 10;
|
|
55
|
+
string resolved_support_email = 11;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message UpdateBrandingRequest {
|
|
59
|
+
// optional: відсутність → не оновлювати; порожній рядок → скинути до NULL у БД.
|
|
60
|
+
optional string logo_url = 1;
|
|
61
|
+
optional string brand_name = 2;
|
|
62
|
+
optional string brand_url = 3;
|
|
63
|
+
optional string support_email = 4;
|
|
64
|
+
optional string footer_html = 5;
|
|
65
|
+
string actor_id = 6;
|
|
66
|
+
}
|
|
67
|
+
|
|
32
68
|
|
|
33
69
|
enum NotificationChannel {
|
|
34
70
|
NOTIFICATION_CHANNEL_UNSPECIFIED = 0;
|
package/dist/proto/order.proto
CHANGED
|
@@ -69,6 +69,9 @@ message OrderDelivery {
|
|
|
69
69
|
string tracking_url = 10;
|
|
70
70
|
string estimated_date = 11;
|
|
71
71
|
string shipment_status = 12;
|
|
72
|
+
// Адмін-облік: область/регіон з City.region від delivery-service.
|
|
73
|
+
// Старі замовлення можуть мати порожнє значення.
|
|
74
|
+
string region = 13;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
message OrderPayment {
|
|
@@ -82,6 +85,10 @@ message OrderPayment {
|
|
|
82
85
|
int64 captured_at = 8;
|
|
83
86
|
int64 cancelled_at = 9;
|
|
84
87
|
int64 refunded_at = 10;
|
|
88
|
+
// Денормалізовано з payment-service для відображення в адмінці
|
|
89
|
+
// без додаткового gRPC дзвінка. Оновлюється з payment-events listener.
|
|
90
|
+
double captured_amount = 11;
|
|
91
|
+
double refunded_amount = 12;
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
message OrderNote {
|
|
@@ -153,6 +160,10 @@ message Order {
|
|
|
153
160
|
|
|
154
161
|
int64 created_at = 20;
|
|
155
162
|
int64 updated_at = 21;
|
|
163
|
+
|
|
164
|
+
// Внутрішні нотатки менеджерів (видимі тільки в адмінці).
|
|
165
|
+
// Сортуються від новіших до старіших — server-side.
|
|
166
|
+
repeated OrderNote notes = 22;
|
|
156
167
|
}
|
|
157
168
|
|
|
158
169
|
// ─── Requests ──────────────────────────────────────────────────
|
package/dist/proto/payment.proto
CHANGED
|
@@ -20,6 +20,11 @@ service PaymentService {
|
|
|
20
20
|
// SyncStatus — підтягує актуальний статус від провайдера (manual reconciliation).
|
|
21
21
|
rpc SyncStatus(SyncStatusRequest) returns (PaymentResponse);
|
|
22
22
|
|
|
23
|
+
// RegenerateInvoice — створює новий invoice у провайдера для існуючого Payment.
|
|
24
|
+
// Використовується коли paymentUrl застарів (TTL у Mono ≈ 24г) або клієнт
|
|
25
|
+
// загубив SMS — менеджер ділиться новим лінком через адмін UI.
|
|
26
|
+
rpc RegenerateInvoice(RegenerateInvoiceRequest) returns (PaymentResponse);
|
|
27
|
+
|
|
23
28
|
rpc ListProviders(ListProvidersRequest) returns (ListProvidersResponse);
|
|
24
29
|
rpc ToggleProvider(ToggleProviderRequest) returns (ToggleProviderResponse);
|
|
25
30
|
}
|
|
@@ -127,6 +132,11 @@ message SyncStatusRequest {
|
|
|
127
132
|
string id = 1;
|
|
128
133
|
}
|
|
129
134
|
|
|
135
|
+
message RegenerateInvoiceRequest {
|
|
136
|
+
string id = 1;
|
|
137
|
+
string actor_id = 2;
|
|
138
|
+
}
|
|
139
|
+
|
|
130
140
|
message ListProvidersRequest {
|
|
131
141
|
bool only_enabled = 1;
|
|
132
142
|
}
|
package/gen/cart.ts
CHANGED
|
@@ -73,6 +73,11 @@ export interface DeliveryDraft {
|
|
|
73
73
|
pickupPointId: string;
|
|
74
74
|
cost: number;
|
|
75
75
|
freeShipping: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Область з City.region — клієнт передає при виборі міста, щоб
|
|
78
|
+
* потім order-service зміг записати в snapshot замовлення.
|
|
79
|
+
*/
|
|
80
|
+
region: string;
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
export interface PaymentDraft {
|
package/gen/manager.ts
CHANGED
|
@@ -43,6 +43,10 @@ export interface GetManagerRequest {
|
|
|
43
43
|
id: string;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
export interface GetManagerByAccountRequest {
|
|
47
|
+
accountId: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
46
50
|
export interface CreateManagerRequest {
|
|
47
51
|
accountId: string;
|
|
48
52
|
displayName?: string | undefined;
|
|
@@ -108,6 +112,14 @@ export interface ManagerServiceClient {
|
|
|
108
112
|
|
|
109
113
|
getManager(request: GetManagerRequest): Observable<ManagerProfileDto>;
|
|
110
114
|
|
|
115
|
+
/**
|
|
116
|
+
* Резолв account_id (з auth-service) → ManagerProfile. Використовується
|
|
117
|
+
* у gateway щоб з'ясувати ManagerProfile.id для логіну-під-менеджером —
|
|
118
|
+
* order.managerId зберігає ManagerProfile.id, а не Account.id.
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
getManagerByAccount(request: GetManagerByAccountRequest): Observable<ManagerProfileDto>;
|
|
122
|
+
|
|
111
123
|
createManager(request: CreateManagerRequest): Observable<ManagerProfileDto>;
|
|
112
124
|
|
|
113
125
|
updateManager(request: UpdateManagerRequest): Observable<ManagerProfileDto>;
|
|
@@ -134,6 +146,16 @@ export interface ManagerServiceController {
|
|
|
134
146
|
request: GetManagerRequest,
|
|
135
147
|
): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
136
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Резолв account_id (з auth-service) → ManagerProfile. Використовується
|
|
151
|
+
* у gateway щоб з'ясувати ManagerProfile.id для логіну-під-менеджером —
|
|
152
|
+
* order.managerId зберігає ManagerProfile.id, а не Account.id.
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
getManagerByAccount(
|
|
156
|
+
request: GetManagerByAccountRequest,
|
|
157
|
+
): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
158
|
+
|
|
137
159
|
createManager(
|
|
138
160
|
request: CreateManagerRequest,
|
|
139
161
|
): Promise<ManagerProfileDto> | Observable<ManagerProfileDto> | ManagerProfileDto;
|
|
@@ -168,6 +190,7 @@ export function ManagerServiceControllerMethods() {
|
|
|
168
190
|
const grpcMethods: string[] = [
|
|
169
191
|
"listManagers",
|
|
170
192
|
"getManager",
|
|
193
|
+
"getManagerByAccount",
|
|
171
194
|
"createManager",
|
|
172
195
|
"updateManager",
|
|
173
196
|
"setManagerActive",
|
package/gen/notification.ts
CHANGED
|
@@ -59,6 +59,41 @@ export enum TelegramTopic {
|
|
|
59
59
|
UNRECOGNIZED = -1,
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
export interface BrandingEmpty {
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Поля що поверталися з resolved-merge (DB ∪ env). Порожні рядки означають
|
|
67
|
+
* "взяти fallback з env" при наступному GET.
|
|
68
|
+
*/
|
|
69
|
+
export interface BrandingProfile {
|
|
70
|
+
logoUrl: string;
|
|
71
|
+
brandName: string;
|
|
72
|
+
brandUrl: string;
|
|
73
|
+
supportEmail: string;
|
|
74
|
+
footerHtml: string;
|
|
75
|
+
updatedAt: number;
|
|
76
|
+
updatedBy: string;
|
|
77
|
+
/**
|
|
78
|
+
* resolved: остаточні значення, що використовуються wrapper'ом
|
|
79
|
+
* (DB override → env fallback). Для UI щоб показати "поточне значення".
|
|
80
|
+
*/
|
|
81
|
+
resolvedLogoUrl: string;
|
|
82
|
+
resolvedBrandName: string;
|
|
83
|
+
resolvedBrandUrl: string;
|
|
84
|
+
resolvedSupportEmail: string;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export interface UpdateBrandingRequest {
|
|
88
|
+
/** optional: відсутність → не оновлювати; порожній рядок → скинути до NULL у БД. */
|
|
89
|
+
logoUrl?: string | undefined;
|
|
90
|
+
brandName?: string | undefined;
|
|
91
|
+
brandUrl?: string | undefined;
|
|
92
|
+
supportEmail?: string | undefined;
|
|
93
|
+
footerHtml?: string | undefined;
|
|
94
|
+
actorId: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
62
97
|
export interface NotificationTemplate {
|
|
63
98
|
id: string;
|
|
64
99
|
key: string;
|
|
@@ -425,3 +460,38 @@ export function TelegramChatsServiceControllerMethods() {
|
|
|
425
460
|
}
|
|
426
461
|
|
|
427
462
|
export const TELEGRAM_CHATS_SERVICE_NAME = "TelegramChatsService";
|
|
463
|
+
|
|
464
|
+
/** Брендинг email-шаблонів — singleton редагується адміном. */
|
|
465
|
+
|
|
466
|
+
export interface BrandingServiceClient {
|
|
467
|
+
getBranding(request: BrandingEmpty): Observable<BrandingProfile>;
|
|
468
|
+
|
|
469
|
+
updateBranding(request: UpdateBrandingRequest): Observable<BrandingProfile>;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/** Брендинг email-шаблонів — singleton редагується адміном. */
|
|
473
|
+
|
|
474
|
+
export interface BrandingServiceController {
|
|
475
|
+
getBranding(request: BrandingEmpty): Promise<BrandingProfile> | Observable<BrandingProfile> | BrandingProfile;
|
|
476
|
+
|
|
477
|
+
updateBranding(
|
|
478
|
+
request: UpdateBrandingRequest,
|
|
479
|
+
): Promise<BrandingProfile> | Observable<BrandingProfile> | BrandingProfile;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export function BrandingServiceControllerMethods() {
|
|
483
|
+
return function (constructor: Function) {
|
|
484
|
+
const grpcMethods: string[] = ["getBranding", "updateBranding"];
|
|
485
|
+
for (const method of grpcMethods) {
|
|
486
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
487
|
+
GrpcMethod("BrandingService", method)(constructor.prototype[method], method, descriptor);
|
|
488
|
+
}
|
|
489
|
+
const grpcStreamMethods: string[] = [];
|
|
490
|
+
for (const method of grpcStreamMethods) {
|
|
491
|
+
const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
|
|
492
|
+
GrpcStreamMethod("BrandingService", method)(constructor.prototype[method], method, descriptor);
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
export const BRANDING_SERVICE_NAME = "BrandingService";
|
package/gen/order.ts
CHANGED
|
@@ -45,6 +45,11 @@ export interface OrderDelivery {
|
|
|
45
45
|
trackingUrl: string;
|
|
46
46
|
estimatedDate: string;
|
|
47
47
|
shipmentStatus: string;
|
|
48
|
+
/**
|
|
49
|
+
* Адмін-облік: область/регіон з City.region від delivery-service.
|
|
50
|
+
* Старі замовлення можуть мати порожнє значення.
|
|
51
|
+
*/
|
|
52
|
+
region: string;
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
export interface OrderPayment {
|
|
@@ -58,6 +63,12 @@ export interface OrderPayment {
|
|
|
58
63
|
capturedAt: number;
|
|
59
64
|
cancelledAt: number;
|
|
60
65
|
refundedAt: number;
|
|
66
|
+
/**
|
|
67
|
+
* Денормалізовано з payment-service для відображення в адмінці
|
|
68
|
+
* без додаткового gRPC дзвінка. Оновлюється з payment-events listener.
|
|
69
|
+
*/
|
|
70
|
+
capturedAmount: number;
|
|
71
|
+
refundedAmount: number;
|
|
61
72
|
}
|
|
62
73
|
|
|
63
74
|
export interface OrderNote {
|
|
@@ -125,6 +136,11 @@ export interface Order {
|
|
|
125
136
|
tags: string[];
|
|
126
137
|
createdAt: number;
|
|
127
138
|
updatedAt: number;
|
|
139
|
+
/**
|
|
140
|
+
* Внутрішні нотатки менеджерів (видимі тільки в адмінці).
|
|
141
|
+
* Сортуються від новіших до старіших — server-side.
|
|
142
|
+
*/
|
|
143
|
+
notes: OrderNote[];
|
|
128
144
|
}
|
|
129
145
|
|
|
130
146
|
export interface CreateOrderRequest {
|
package/gen/payment.ts
CHANGED
|
@@ -109,6 +109,11 @@ export interface SyncStatusRequest {
|
|
|
109
109
|
id: string;
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
export interface RegenerateInvoiceRequest {
|
|
113
|
+
id: string;
|
|
114
|
+
actorId: string;
|
|
115
|
+
}
|
|
116
|
+
|
|
112
117
|
export interface ListProvidersRequest {
|
|
113
118
|
onlyEnabled: boolean;
|
|
114
119
|
}
|
|
@@ -163,6 +168,14 @@ export interface PaymentServiceClient {
|
|
|
163
168
|
|
|
164
169
|
syncStatus(request: SyncStatusRequest): Observable<PaymentResponse>;
|
|
165
170
|
|
|
171
|
+
/**
|
|
172
|
+
* RegenerateInvoice — створює новий invoice у провайдера для існуючого Payment.
|
|
173
|
+
* Використовується коли paymentUrl застарів (TTL у Mono ≈ 24г) або клієнт
|
|
174
|
+
* загубив SMS — менеджер ділиться новим лінком через адмін UI.
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
regenerateInvoice(request: RegenerateInvoiceRequest): Observable<PaymentResponse>;
|
|
178
|
+
|
|
166
179
|
listProviders(request: ListProvidersRequest): Observable<ListProvidersResponse>;
|
|
167
180
|
|
|
168
181
|
toggleProvider(request: ToggleProviderRequest): Observable<ToggleProviderResponse>;
|
|
@@ -201,6 +214,16 @@ export interface PaymentServiceController {
|
|
|
201
214
|
|
|
202
215
|
syncStatus(request: SyncStatusRequest): Promise<PaymentResponse> | Observable<PaymentResponse> | PaymentResponse;
|
|
203
216
|
|
|
217
|
+
/**
|
|
218
|
+
* RegenerateInvoice — створює новий invoice у провайдера для існуючого Payment.
|
|
219
|
+
* Використовується коли paymentUrl застарів (TTL у Mono ≈ 24г) або клієнт
|
|
220
|
+
* загубив SMS — менеджер ділиться новим лінком через адмін UI.
|
|
221
|
+
*/
|
|
222
|
+
|
|
223
|
+
regenerateInvoice(
|
|
224
|
+
request: RegenerateInvoiceRequest,
|
|
225
|
+
): Promise<PaymentResponse> | Observable<PaymentResponse> | PaymentResponse;
|
|
226
|
+
|
|
204
227
|
listProviders(
|
|
205
228
|
request: ListProvidersRequest,
|
|
206
229
|
): Promise<ListProvidersResponse> | Observable<ListProvidersResponse> | ListProvidersResponse;
|
|
@@ -221,6 +244,7 @@ export function PaymentServiceControllerMethods() {
|
|
|
221
244
|
"cancel",
|
|
222
245
|
"refund",
|
|
223
246
|
"syncStatus",
|
|
247
|
+
"regenerateInvoice",
|
|
224
248
|
"listProviders",
|
|
225
249
|
"toggleProvider",
|
|
226
250
|
];
|
package/package.json
CHANGED
package/proto/cart.proto
CHANGED
|
@@ -100,6 +100,9 @@ message DeliveryDraft {
|
|
|
100
100
|
string pickup_point_id = 7;
|
|
101
101
|
double cost = 8;
|
|
102
102
|
bool free_shipping = 9;
|
|
103
|
+
// Область з City.region — клієнт передає при виборі міста, щоб
|
|
104
|
+
// потім order-service зміг записати в snapshot замовлення.
|
|
105
|
+
string region = 10;
|
|
103
106
|
}
|
|
104
107
|
|
|
105
108
|
message PaymentDraft {
|
package/proto/manager.proto
CHANGED
|
@@ -5,6 +5,10 @@ package manager.v1;
|
|
|
5
5
|
service ManagerService {
|
|
6
6
|
rpc ListManagers(ListManagersRequest) returns (ListManagersResponse);
|
|
7
7
|
rpc GetManager(GetManagerRequest) returns (ManagerProfileDto);
|
|
8
|
+
// Резолв account_id (з auth-service) → ManagerProfile. Використовується
|
|
9
|
+
// у gateway щоб з'ясувати ManagerProfile.id для логіну-під-менеджером —
|
|
10
|
+
// order.managerId зберігає ManagerProfile.id, а не Account.id.
|
|
11
|
+
rpc GetManagerByAccount(GetManagerByAccountRequest) returns (ManagerProfileDto);
|
|
8
12
|
rpc CreateManager(CreateManagerRequest) returns (ManagerProfileDto);
|
|
9
13
|
rpc UpdateManager(UpdateManagerRequest) returns (ManagerProfileDto);
|
|
10
14
|
rpc SetManagerActive(SetManagerActiveRequest) returns (ManagerProfileDto);
|
|
@@ -44,6 +48,8 @@ message ListManagersResponse {
|
|
|
44
48
|
|
|
45
49
|
message GetManagerRequest { string id = 1; }
|
|
46
50
|
|
|
51
|
+
message GetManagerByAccountRequest { string account_id = 1; }
|
|
52
|
+
|
|
47
53
|
message CreateManagerRequest {
|
|
48
54
|
string account_id = 1;
|
|
49
55
|
optional string display_name = 2;
|
package/proto/notification.proto
CHANGED
|
@@ -29,6 +29,42 @@ service TelegramChatsService {
|
|
|
29
29
|
rpc TestSendTelegram (TestSendTelegramRequest) returns (TestSendTelegramResponse);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// Брендинг email-шаблонів — singleton редагується адміном.
|
|
33
|
+
service BrandingService {
|
|
34
|
+
rpc GetBranding (BrandingEmpty) returns (BrandingProfile);
|
|
35
|
+
rpc UpdateBranding (UpdateBrandingRequest) returns (BrandingProfile);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
message BrandingEmpty {}
|
|
39
|
+
|
|
40
|
+
// Поля що поверталися з resolved-merge (DB ∪ env). Порожні рядки означають
|
|
41
|
+
// "взяти fallback з env" при наступному GET.
|
|
42
|
+
message BrandingProfile {
|
|
43
|
+
string logo_url = 1;
|
|
44
|
+
string brand_name = 2;
|
|
45
|
+
string brand_url = 3;
|
|
46
|
+
string support_email = 4;
|
|
47
|
+
string footer_html = 5;
|
|
48
|
+
int64 updated_at = 6;
|
|
49
|
+
string updated_by = 7;
|
|
50
|
+
// resolved: остаточні значення, що використовуються wrapper'ом
|
|
51
|
+
// (DB override → env fallback). Для UI щоб показати "поточне значення".
|
|
52
|
+
string resolved_logo_url = 8;
|
|
53
|
+
string resolved_brand_name = 9;
|
|
54
|
+
string resolved_brand_url = 10;
|
|
55
|
+
string resolved_support_email = 11;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
message UpdateBrandingRequest {
|
|
59
|
+
// optional: відсутність → не оновлювати; порожній рядок → скинути до NULL у БД.
|
|
60
|
+
optional string logo_url = 1;
|
|
61
|
+
optional string brand_name = 2;
|
|
62
|
+
optional string brand_url = 3;
|
|
63
|
+
optional string support_email = 4;
|
|
64
|
+
optional string footer_html = 5;
|
|
65
|
+
string actor_id = 6;
|
|
66
|
+
}
|
|
67
|
+
|
|
32
68
|
|
|
33
69
|
enum NotificationChannel {
|
|
34
70
|
NOTIFICATION_CHANNEL_UNSPECIFIED = 0;
|
package/proto/order.proto
CHANGED
|
@@ -69,6 +69,9 @@ message OrderDelivery {
|
|
|
69
69
|
string tracking_url = 10;
|
|
70
70
|
string estimated_date = 11;
|
|
71
71
|
string shipment_status = 12;
|
|
72
|
+
// Адмін-облік: область/регіон з City.region від delivery-service.
|
|
73
|
+
// Старі замовлення можуть мати порожнє значення.
|
|
74
|
+
string region = 13;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
message OrderPayment {
|
|
@@ -82,6 +85,10 @@ message OrderPayment {
|
|
|
82
85
|
int64 captured_at = 8;
|
|
83
86
|
int64 cancelled_at = 9;
|
|
84
87
|
int64 refunded_at = 10;
|
|
88
|
+
// Денормалізовано з payment-service для відображення в адмінці
|
|
89
|
+
// без додаткового gRPC дзвінка. Оновлюється з payment-events listener.
|
|
90
|
+
double captured_amount = 11;
|
|
91
|
+
double refunded_amount = 12;
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
message OrderNote {
|
|
@@ -153,6 +160,10 @@ message Order {
|
|
|
153
160
|
|
|
154
161
|
int64 created_at = 20;
|
|
155
162
|
int64 updated_at = 21;
|
|
163
|
+
|
|
164
|
+
// Внутрішні нотатки менеджерів (видимі тільки в адмінці).
|
|
165
|
+
// Сортуються від новіших до старіших — server-side.
|
|
166
|
+
repeated OrderNote notes = 22;
|
|
156
167
|
}
|
|
157
168
|
|
|
158
169
|
// ─── Requests ──────────────────────────────────────────────────
|
package/proto/payment.proto
CHANGED
|
@@ -20,6 +20,11 @@ service PaymentService {
|
|
|
20
20
|
// SyncStatus — підтягує актуальний статус від провайдера (manual reconciliation).
|
|
21
21
|
rpc SyncStatus(SyncStatusRequest) returns (PaymentResponse);
|
|
22
22
|
|
|
23
|
+
// RegenerateInvoice — створює новий invoice у провайдера для існуючого Payment.
|
|
24
|
+
// Використовується коли paymentUrl застарів (TTL у Mono ≈ 24г) або клієнт
|
|
25
|
+
// загубив SMS — менеджер ділиться новим лінком через адмін UI.
|
|
26
|
+
rpc RegenerateInvoice(RegenerateInvoiceRequest) returns (PaymentResponse);
|
|
27
|
+
|
|
23
28
|
rpc ListProviders(ListProvidersRequest) returns (ListProvidersResponse);
|
|
24
29
|
rpc ToggleProvider(ToggleProviderRequest) returns (ToggleProviderResponse);
|
|
25
30
|
}
|
|
@@ -127,6 +132,11 @@ message SyncStatusRequest {
|
|
|
127
132
|
string id = 1;
|
|
128
133
|
}
|
|
129
134
|
|
|
135
|
+
message RegenerateInvoiceRequest {
|
|
136
|
+
string id = 1;
|
|
137
|
+
string actor_id = 2;
|
|
138
|
+
}
|
|
139
|
+
|
|
130
140
|
message ListProvidersRequest {
|
|
131
141
|
bool only_enabled = 1;
|
|
132
142
|
}
|