@mamindom/contracts 1.0.80 → 1.0.82

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.
@@ -362,6 +362,22 @@ export interface ExportBundlesResponse {
362
362
  format: string;
363
363
  count: number;
364
364
  }
365
+ export interface GenerateBundleCollageRequest {
366
+ bundleId: string;
367
+ /** Optional: override cell pixel size (default 400) */
368
+ cellSize?: number | undefined;
369
+ }
370
+ export interface GenerateBundleCollageResponse {
371
+ /** Public CDN/S3 URL of the collage JPEG */
372
+ url: string;
373
+ /** S3 object key */
374
+ key: string;
375
+ /** Final image width in pixels */
376
+ width: number;
377
+ /** Final image height in pixels */
378
+ height: number;
379
+ bundleId: string;
380
+ }
365
381
  export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
366
382
  export interface BundleServiceClient {
367
383
  getBundles(request: GetBundlesRequest): Observable<GetBundlesResponse>;
@@ -383,6 +399,7 @@ export interface BundleServiceClient {
383
399
  cloneBundle(request: CloneBundleRequest): Observable<BundleDetailResponse>;
384
400
  exportBundles(request: ExportBundlesRequest): Observable<ExportBundlesResponse>;
385
401
  addCrossSellLink(request: AddCrossSellLinkRequest): Observable<SuccessResponse>;
402
+ generateBundleCollage(request: GenerateBundleCollageRequest): Observable<GenerateBundleCollageResponse>;
386
403
  }
387
404
  export interface BundleServiceController {
388
405
  getBundles(request: GetBundlesRequest): Promise<GetBundlesResponse> | Observable<GetBundlesResponse> | GetBundlesResponse;
@@ -404,6 +421,7 @@ export interface BundleServiceController {
404
421
  cloneBundle(request: CloneBundleRequest): Promise<BundleDetailResponse> | Observable<BundleDetailResponse> | BundleDetailResponse;
405
422
  exportBundles(request: ExportBundlesRequest): Promise<ExportBundlesResponse> | Observable<ExportBundlesResponse> | ExportBundlesResponse;
406
423
  addCrossSellLink(request: AddCrossSellLinkRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
424
+ generateBundleCollage(request: GenerateBundleCollageRequest): Promise<GenerateBundleCollageResponse> | Observable<GenerateBundleCollageResponse> | GenerateBundleCollageResponse;
407
425
  }
408
426
  export declare function BundleServiceControllerMethods(): (constructor: Function) => void;
409
427
  export declare const BUNDLE_SERVICE_NAME = "BundleService";
@@ -71,6 +71,7 @@ function BundleServiceControllerMethods() {
71
71
  "cloneBundle",
72
72
  "exportBundles",
73
73
  "addCrossSellLink",
74
+ "generateBundleCollage",
74
75
  ];
75
76
  for (const method of grpcMethods) {
76
77
  const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
@@ -0,0 +1,125 @@
1
+ import { Observable } from "rxjs";
2
+ import { DeleteResponse, SuccessResponse } from "./common";
3
+ export declare const protobufPackage = "catalog.v1";
4
+ export interface PickupPointResponse {
5
+ id: string;
6
+ name: string;
7
+ address: string;
8
+ city: string;
9
+ phone?: string | undefined;
10
+ lat?: number | undefined;
11
+ lng?: number | undefined;
12
+ isActive: boolean;
13
+ code1c?: string | undefined;
14
+ }
15
+ export interface GetPickupPointsRequest {
16
+ isActive?: boolean | undefined;
17
+ city?: string | undefined;
18
+ }
19
+ export interface GetPickupPointsResponse {
20
+ items: PickupPointResponse[];
21
+ }
22
+ export interface GetPickupPointRequest {
23
+ id: string;
24
+ }
25
+ export interface CreatePickupPointRequest {
26
+ name: string;
27
+ address: string;
28
+ city: string;
29
+ phone?: string | undefined;
30
+ lat?: number | undefined;
31
+ lng?: number | undefined;
32
+ isActive?: boolean | undefined;
33
+ code1c?: string | undefined;
34
+ }
35
+ export interface UpdatePickupPointRequest {
36
+ id: string;
37
+ name?: string | undefined;
38
+ address?: string | undefined;
39
+ city?: string | undefined;
40
+ phone?: string | undefined;
41
+ lat?: number | undefined;
42
+ lng?: number | undefined;
43
+ isActive?: boolean | undefined;
44
+ code1c?: string | undefined;
45
+ }
46
+ export interface DeletePickupPointRequest {
47
+ id: string;
48
+ }
49
+ export interface PickupStockItemResponse {
50
+ pickupPointId: string;
51
+ productId: string;
52
+ variantId?: string | undefined;
53
+ qty: number;
54
+ /** "MANUAL" | "SYNC_1C" */
55
+ source: string;
56
+ updatedAt: string;
57
+ pickupPointName?: string | undefined;
58
+ }
59
+ export interface GetPickupStockRequest {
60
+ productId?: string | undefined;
61
+ variantId?: string | undefined;
62
+ pickupPointId?: string | undefined;
63
+ }
64
+ export interface GetPickupStockResponse {
65
+ items: PickupStockItemResponse[];
66
+ }
67
+ export interface SetPickupStockRequest {
68
+ pickupPointId: string;
69
+ productId: string;
70
+ variantId?: string | undefined;
71
+ qty: number;
72
+ /** default MANUAL */
73
+ source?: string | undefined;
74
+ }
75
+ export interface AdjustPickupStockRequest {
76
+ pickupPointId: string;
77
+ productId: string;
78
+ variantId?: string | undefined;
79
+ /** positive = add, negative = subtract */
80
+ delta: number;
81
+ }
82
+ export interface BulkSetPickupStockRequest {
83
+ items: SetPickupStockRequest[];
84
+ }
85
+ /** Масова синхронізація з 1С: масив рядків вигляду "code1c:productGuid1c:variantGuid1c?:qty" */
86
+ export interface BulkSyncFromOnecRequest {
87
+ entries: OnecStockEntry[];
88
+ }
89
+ export interface OnecStockEntry {
90
+ code1c: string;
91
+ productGuid: string;
92
+ variantGuid?: string | undefined;
93
+ qty: number;
94
+ }
95
+ export declare const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
96
+ export interface PickupPointServiceClient {
97
+ /** Pickup points CRUD */
98
+ getPickupPoints(request: GetPickupPointsRequest): Observable<GetPickupPointsResponse>;
99
+ getPickupPoint(request: GetPickupPointRequest): Observable<PickupPointResponse>;
100
+ createPickupPoint(request: CreatePickupPointRequest): Observable<PickupPointResponse>;
101
+ updatePickupPoint(request: UpdatePickupPointRequest): Observable<PickupPointResponse>;
102
+ deletePickupPoint(request: DeletePickupPointRequest): Observable<DeleteResponse>;
103
+ /** Stock per pickup point */
104
+ getPickupStock(request: GetPickupStockRequest): Observable<GetPickupStockResponse>;
105
+ setPickupStock(request: SetPickupStockRequest): Observable<PickupStockItemResponse>;
106
+ adjustPickupStock(request: AdjustPickupStockRequest): Observable<PickupStockItemResponse>;
107
+ bulkSetPickupStock(request: BulkSetPickupStockRequest): Observable<SuccessResponse>;
108
+ bulkSyncFromOnec(request: BulkSyncFromOnecRequest): Observable<SuccessResponse>;
109
+ }
110
+ export interface PickupPointServiceController {
111
+ /** Pickup points CRUD */
112
+ getPickupPoints(request: GetPickupPointsRequest): Promise<GetPickupPointsResponse> | Observable<GetPickupPointsResponse> | GetPickupPointsResponse;
113
+ getPickupPoint(request: GetPickupPointRequest): Promise<PickupPointResponse> | Observable<PickupPointResponse> | PickupPointResponse;
114
+ createPickupPoint(request: CreatePickupPointRequest): Promise<PickupPointResponse> | Observable<PickupPointResponse> | PickupPointResponse;
115
+ updatePickupPoint(request: UpdatePickupPointRequest): Promise<PickupPointResponse> | Observable<PickupPointResponse> | PickupPointResponse;
116
+ deletePickupPoint(request: DeletePickupPointRequest): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
117
+ /** Stock per pickup point */
118
+ getPickupStock(request: GetPickupStockRequest): Promise<GetPickupStockResponse> | Observable<GetPickupStockResponse> | GetPickupStockResponse;
119
+ setPickupStock(request: SetPickupStockRequest): Promise<PickupStockItemResponse> | Observable<PickupStockItemResponse> | PickupStockItemResponse;
120
+ adjustPickupStock(request: AdjustPickupStockRequest): Promise<PickupStockItemResponse> | Observable<PickupStockItemResponse> | PickupStockItemResponse;
121
+ bulkSetPickupStock(request: BulkSetPickupStockRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
122
+ bulkSyncFromOnec(request: BulkSyncFromOnecRequest): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
123
+ }
124
+ export declare function PickupPointServiceControllerMethods(): (constructor: Function) => void;
125
+ export declare const PICKUP_POINT_SERVICE_NAME = "PickupPointService";
@@ -0,0 +1,39 @@
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: pickup.proto
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.PICKUP_POINT_SERVICE_NAME = exports.CATALOG_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
9
+ exports.PickupPointServiceControllerMethods = PickupPointServiceControllerMethods;
10
+ /* eslint-disable */
11
+ const microservices_1 = require("@nestjs/microservices");
12
+ exports.protobufPackage = "catalog.v1";
13
+ exports.CATALOG_V1_PACKAGE_NAME = "catalog.v1";
14
+ function PickupPointServiceControllerMethods() {
15
+ return function (constructor) {
16
+ const grpcMethods = [
17
+ "getPickupPoints",
18
+ "getPickupPoint",
19
+ "createPickupPoint",
20
+ "updatePickupPoint",
21
+ "deletePickupPoint",
22
+ "getPickupStock",
23
+ "setPickupStock",
24
+ "adjustPickupStock",
25
+ "bulkSetPickupStock",
26
+ "bulkSyncFromOnec",
27
+ ];
28
+ for (const method of grpcMethods) {
29
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
30
+ (0, microservices_1.GrpcMethod)("PickupPointService", method)(constructor.prototype[method], method, descriptor);
31
+ }
32
+ const grpcStreamMethods = [];
33
+ for (const method of grpcStreamMethods) {
34
+ const descriptor = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
35
+ (0, microservices_1.GrpcStreamMethod)("PickupPointService", method)(constructor.prototype[method], method, descriptor);
36
+ }
37
+ };
38
+ }
39
+ exports.PICKUP_POINT_SERVICE_NAME = "PickupPointService";
@@ -31,6 +31,8 @@ service BundleService {
31
31
  rpc ExportBundles (ExportBundlesRequest) returns (ExportBundlesResponse);
32
32
 
33
33
  rpc AddCrossSellLink (AddCrossSellLinkRequest) returns (SuccessResponse);
34
+
35
+ rpc GenerateBundleCollage (GenerateBundleCollageRequest) returns (GenerateBundleCollageResponse);
34
36
  }
35
37
 
36
38
 
@@ -347,3 +349,17 @@ message ExportBundlesResponse {
347
349
  string format = 2;
348
350
  int32 count = 3;
349
351
  }
352
+
353
+ message GenerateBundleCollageRequest {
354
+ string bundle_id = 1;
355
+ // Optional: override cell pixel size (default 400)
356
+ optional int32 cell_size = 2;
357
+ }
358
+
359
+ message GenerateBundleCollageResponse {
360
+ string url = 1; // Public CDN/S3 URL of the collage JPEG
361
+ string key = 2; // S3 object key
362
+ int32 width = 3; // Final image width in pixels
363
+ int32 height = 4; // Final image height in pixels
364
+ string bundle_id = 5;
365
+ }
@@ -0,0 +1,128 @@
1
+ syntax = "proto3";
2
+
3
+ package catalog.v1;
4
+
5
+ import "common.proto";
6
+
7
+ service PickupPointService {
8
+ // Pickup points CRUD
9
+ rpc GetPickupPoints (GetPickupPointsRequest) returns (GetPickupPointsResponse);
10
+ rpc GetPickupPoint (GetPickupPointRequest) returns (PickupPointResponse);
11
+ rpc CreatePickupPoint (CreatePickupPointRequest) returns (PickupPointResponse);
12
+ rpc UpdatePickupPoint (UpdatePickupPointRequest) returns (PickupPointResponse);
13
+ rpc DeletePickupPoint (DeletePickupPointRequest) returns (DeleteResponse);
14
+
15
+ // Stock per pickup point
16
+ rpc GetPickupStock (GetPickupStockRequest) returns (GetPickupStockResponse);
17
+ rpc SetPickupStock (SetPickupStockRequest) returns (PickupStockItemResponse);
18
+ rpc AdjustPickupStock (AdjustPickupStockRequest) returns (PickupStockItemResponse);
19
+ rpc BulkSetPickupStock (BulkSetPickupStockRequest) returns (SuccessResponse);
20
+ rpc BulkSyncFromOnec (BulkSyncFromOnecRequest) returns (SuccessResponse);
21
+ }
22
+
23
+ // ── Pickup Point ──────────────────────────────────────────────
24
+
25
+ message PickupPointResponse {
26
+ string id = 1;
27
+ string name = 2;
28
+ string address = 3;
29
+ string city = 4;
30
+ optional string phone = 5;
31
+ optional double lat = 6;
32
+ optional double lng = 7;
33
+ bool is_active = 8;
34
+ optional string code_1c = 9;
35
+ }
36
+
37
+ message GetPickupPointsRequest {
38
+ optional bool is_active = 1;
39
+ optional string city = 2;
40
+ }
41
+
42
+ message GetPickupPointsResponse {
43
+ repeated PickupPointResponse items = 1;
44
+ }
45
+
46
+ message GetPickupPointRequest {
47
+ string id = 1;
48
+ }
49
+
50
+ message CreatePickupPointRequest {
51
+ string name = 1;
52
+ string address = 2;
53
+ string city = 3;
54
+ optional string phone = 4;
55
+ optional double lat = 5;
56
+ optional double lng = 6;
57
+ optional bool is_active = 7;
58
+ optional string code_1c = 8;
59
+ }
60
+
61
+ message UpdatePickupPointRequest {
62
+ string id = 1;
63
+ optional string name = 2;
64
+ optional string address = 3;
65
+ optional string city = 4;
66
+ optional string phone = 5;
67
+ optional double lat = 6;
68
+ optional double lng = 7;
69
+ optional bool is_active = 8;
70
+ optional string code_1c = 9;
71
+ }
72
+
73
+ message DeletePickupPointRequest {
74
+ string id = 1;
75
+ }
76
+
77
+ // ── Pickup Stock ──────────────────────────────────────────────
78
+
79
+ message PickupStockItemResponse {
80
+ string pickup_point_id = 1;
81
+ string product_id = 2;
82
+ optional string variant_id = 3;
83
+ int32 qty = 4;
84
+ string source = 5; // "MANUAL" | "SYNC_1C"
85
+ string updated_at = 6;
86
+ optional string pickup_point_name = 7;
87
+ }
88
+
89
+ message GetPickupStockRequest {
90
+ optional string product_id = 1;
91
+ optional string variant_id = 2;
92
+ optional string pickup_point_id = 3;
93
+ }
94
+
95
+ message GetPickupStockResponse {
96
+ repeated PickupStockItemResponse items = 1;
97
+ }
98
+
99
+ message SetPickupStockRequest {
100
+ string pickup_point_id = 1;
101
+ string product_id = 2;
102
+ optional string variant_id = 3;
103
+ int32 qty = 4;
104
+ optional string source = 5; // default MANUAL
105
+ }
106
+
107
+ message AdjustPickupStockRequest {
108
+ string pickup_point_id = 1;
109
+ string product_id = 2;
110
+ optional string variant_id = 3;
111
+ int32 delta = 4; // positive = add, negative = subtract
112
+ }
113
+
114
+ message BulkSetPickupStockRequest {
115
+ repeated SetPickupStockRequest items = 1;
116
+ }
117
+
118
+ // Масова синхронізація з 1С: масив рядків вигляду "code1c:productGuid1c:variantGuid1c?:qty"
119
+ message BulkSyncFromOnecRequest {
120
+ repeated OnecStockEntry entries = 1;
121
+ }
122
+
123
+ message OnecStockEntry {
124
+ string code_1c = 1;
125
+ string product_guid = 2;
126
+ optional string variant_guid = 3;
127
+ int32 qty = 4;
128
+ }
package/gen/bundle.ts CHANGED
@@ -389,6 +389,24 @@ export interface ExportBundlesResponse {
389
389
  count: number;
390
390
  }
391
391
 
392
+ export interface GenerateBundleCollageRequest {
393
+ bundleId: string;
394
+ /** Optional: override cell pixel size (default 400) */
395
+ cellSize?: number | undefined;
396
+ }
397
+
398
+ export interface GenerateBundleCollageResponse {
399
+ /** Public CDN/S3 URL of the collage JPEG */
400
+ url: string;
401
+ /** S3 object key */
402
+ key: string;
403
+ /** Final image width in pixels */
404
+ width: number;
405
+ /** Final image height in pixels */
406
+ height: number;
407
+ bundleId: string;
408
+ }
409
+
392
410
  export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
393
411
 
394
412
  export interface BundleServiceClient {
@@ -429,6 +447,8 @@ export interface BundleServiceClient {
429
447
  exportBundles(request: ExportBundlesRequest): Observable<ExportBundlesResponse>;
430
448
 
431
449
  addCrossSellLink(request: AddCrossSellLinkRequest): Observable<SuccessResponse>;
450
+
451
+ generateBundleCollage(request: GenerateBundleCollageRequest): Observable<GenerateBundleCollageResponse>;
432
452
  }
433
453
 
434
454
  export interface BundleServiceController {
@@ -505,6 +525,10 @@ export interface BundleServiceController {
505
525
  addCrossSellLink(
506
526
  request: AddCrossSellLinkRequest,
507
527
  ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
528
+
529
+ generateBundleCollage(
530
+ request: GenerateBundleCollageRequest,
531
+ ): Promise<GenerateBundleCollageResponse> | Observable<GenerateBundleCollageResponse> | GenerateBundleCollageResponse;
508
532
  }
509
533
 
510
534
  export function BundleServiceControllerMethods() {
@@ -529,6 +553,7 @@ export function BundleServiceControllerMethods() {
529
553
  "cloneBundle",
530
554
  "exportBundles",
531
555
  "addCrossSellLink",
556
+ "generateBundleCollage",
532
557
  ];
533
558
  for (const method of grpcMethods) {
534
559
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/gen/pickup.ts ADDED
@@ -0,0 +1,222 @@
1
+ // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
+ // versions:
3
+ // protoc-gen-ts_proto v2.11.4
4
+ // protoc v3.21.12
5
+ // source: pickup.proto
6
+
7
+ /* eslint-disable */
8
+ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
+ import { Observable } from "rxjs";
10
+ import { DeleteResponse, SuccessResponse } from "./common";
11
+
12
+ export const protobufPackage = "catalog.v1";
13
+
14
+ export interface PickupPointResponse {
15
+ id: string;
16
+ name: string;
17
+ address: string;
18
+ city: string;
19
+ phone?: string | undefined;
20
+ lat?: number | undefined;
21
+ lng?: number | undefined;
22
+ isActive: boolean;
23
+ code1c?: string | undefined;
24
+ }
25
+
26
+ export interface GetPickupPointsRequest {
27
+ isActive?: boolean | undefined;
28
+ city?: string | undefined;
29
+ }
30
+
31
+ export interface GetPickupPointsResponse {
32
+ items: PickupPointResponse[];
33
+ }
34
+
35
+ export interface GetPickupPointRequest {
36
+ id: string;
37
+ }
38
+
39
+ export interface CreatePickupPointRequest {
40
+ name: string;
41
+ address: string;
42
+ city: string;
43
+ phone?: string | undefined;
44
+ lat?: number | undefined;
45
+ lng?: number | undefined;
46
+ isActive?: boolean | undefined;
47
+ code1c?: string | undefined;
48
+ }
49
+
50
+ export interface UpdatePickupPointRequest {
51
+ id: string;
52
+ name?: string | undefined;
53
+ address?: string | undefined;
54
+ city?: string | undefined;
55
+ phone?: string | undefined;
56
+ lat?: number | undefined;
57
+ lng?: number | undefined;
58
+ isActive?: boolean | undefined;
59
+ code1c?: string | undefined;
60
+ }
61
+
62
+ export interface DeletePickupPointRequest {
63
+ id: string;
64
+ }
65
+
66
+ export interface PickupStockItemResponse {
67
+ pickupPointId: string;
68
+ productId: string;
69
+ variantId?: string | undefined;
70
+ qty: number;
71
+ /** "MANUAL" | "SYNC_1C" */
72
+ source: string;
73
+ updatedAt: string;
74
+ pickupPointName?: string | undefined;
75
+ }
76
+
77
+ export interface GetPickupStockRequest {
78
+ productId?: string | undefined;
79
+ variantId?: string | undefined;
80
+ pickupPointId?: string | undefined;
81
+ }
82
+
83
+ export interface GetPickupStockResponse {
84
+ items: PickupStockItemResponse[];
85
+ }
86
+
87
+ export interface SetPickupStockRequest {
88
+ pickupPointId: string;
89
+ productId: string;
90
+ variantId?: string | undefined;
91
+ qty: number;
92
+ /** default MANUAL */
93
+ source?: string | undefined;
94
+ }
95
+
96
+ export interface AdjustPickupStockRequest {
97
+ pickupPointId: string;
98
+ productId: string;
99
+ variantId?:
100
+ | string
101
+ | undefined;
102
+ /** positive = add, negative = subtract */
103
+ delta: number;
104
+ }
105
+
106
+ export interface BulkSetPickupStockRequest {
107
+ items: SetPickupStockRequest[];
108
+ }
109
+
110
+ /** Масова синхронізація з 1С: масив рядків вигляду "code1c:productGuid1c:variantGuid1c?:qty" */
111
+ export interface BulkSyncFromOnecRequest {
112
+ entries: OnecStockEntry[];
113
+ }
114
+
115
+ export interface OnecStockEntry {
116
+ code1c: string;
117
+ productGuid: string;
118
+ variantGuid?: string | undefined;
119
+ qty: number;
120
+ }
121
+
122
+ export const CATALOG_V1_PACKAGE_NAME = "catalog.v1";
123
+
124
+ export interface PickupPointServiceClient {
125
+ /** Pickup points CRUD */
126
+
127
+ getPickupPoints(request: GetPickupPointsRequest): Observable<GetPickupPointsResponse>;
128
+
129
+ getPickupPoint(request: GetPickupPointRequest): Observable<PickupPointResponse>;
130
+
131
+ createPickupPoint(request: CreatePickupPointRequest): Observable<PickupPointResponse>;
132
+
133
+ updatePickupPoint(request: UpdatePickupPointRequest): Observable<PickupPointResponse>;
134
+
135
+ deletePickupPoint(request: DeletePickupPointRequest): Observable<DeleteResponse>;
136
+
137
+ /** Stock per pickup point */
138
+
139
+ getPickupStock(request: GetPickupStockRequest): Observable<GetPickupStockResponse>;
140
+
141
+ setPickupStock(request: SetPickupStockRequest): Observable<PickupStockItemResponse>;
142
+
143
+ adjustPickupStock(request: AdjustPickupStockRequest): Observable<PickupStockItemResponse>;
144
+
145
+ bulkSetPickupStock(request: BulkSetPickupStockRequest): Observable<SuccessResponse>;
146
+
147
+ bulkSyncFromOnec(request: BulkSyncFromOnecRequest): Observable<SuccessResponse>;
148
+ }
149
+
150
+ export interface PickupPointServiceController {
151
+ /** Pickup points CRUD */
152
+
153
+ getPickupPoints(
154
+ request: GetPickupPointsRequest,
155
+ ): Promise<GetPickupPointsResponse> | Observable<GetPickupPointsResponse> | GetPickupPointsResponse;
156
+
157
+ getPickupPoint(
158
+ request: GetPickupPointRequest,
159
+ ): Promise<PickupPointResponse> | Observable<PickupPointResponse> | PickupPointResponse;
160
+
161
+ createPickupPoint(
162
+ request: CreatePickupPointRequest,
163
+ ): Promise<PickupPointResponse> | Observable<PickupPointResponse> | PickupPointResponse;
164
+
165
+ updatePickupPoint(
166
+ request: UpdatePickupPointRequest,
167
+ ): Promise<PickupPointResponse> | Observable<PickupPointResponse> | PickupPointResponse;
168
+
169
+ deletePickupPoint(
170
+ request: DeletePickupPointRequest,
171
+ ): Promise<DeleteResponse> | Observable<DeleteResponse> | DeleteResponse;
172
+
173
+ /** Stock per pickup point */
174
+
175
+ getPickupStock(
176
+ request: GetPickupStockRequest,
177
+ ): Promise<GetPickupStockResponse> | Observable<GetPickupStockResponse> | GetPickupStockResponse;
178
+
179
+ setPickupStock(
180
+ request: SetPickupStockRequest,
181
+ ): Promise<PickupStockItemResponse> | Observable<PickupStockItemResponse> | PickupStockItemResponse;
182
+
183
+ adjustPickupStock(
184
+ request: AdjustPickupStockRequest,
185
+ ): Promise<PickupStockItemResponse> | Observable<PickupStockItemResponse> | PickupStockItemResponse;
186
+
187
+ bulkSetPickupStock(
188
+ request: BulkSetPickupStockRequest,
189
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
190
+
191
+ bulkSyncFromOnec(
192
+ request: BulkSyncFromOnecRequest,
193
+ ): Promise<SuccessResponse> | Observable<SuccessResponse> | SuccessResponse;
194
+ }
195
+
196
+ export function PickupPointServiceControllerMethods() {
197
+ return function (constructor: Function) {
198
+ const grpcMethods: string[] = [
199
+ "getPickupPoints",
200
+ "getPickupPoint",
201
+ "createPickupPoint",
202
+ "updatePickupPoint",
203
+ "deletePickupPoint",
204
+ "getPickupStock",
205
+ "setPickupStock",
206
+ "adjustPickupStock",
207
+ "bulkSetPickupStock",
208
+ "bulkSyncFromOnec",
209
+ ];
210
+ for (const method of grpcMethods) {
211
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
212
+ GrpcMethod("PickupPointService", method)(constructor.prototype[method], method, descriptor);
213
+ }
214
+ const grpcStreamMethods: string[] = [];
215
+ for (const method of grpcStreamMethods) {
216
+ const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
217
+ GrpcStreamMethod("PickupPointService", method)(constructor.prototype[method], method, descriptor);
218
+ }
219
+ };
220
+ }
221
+
222
+ export const PICKUP_POINT_SERVICE_NAME = "PickupPointService";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mamindom/contracts",
3
3
  "description": "proto",
4
- "version": "1.0.80",
4
+ "version": "1.0.82",
5
5
  "main": "./dist/src/index.js",
6
6
  "types": "./dist/src/index.d.ts",
7
7
  "exports": {
@@ -31,6 +31,8 @@ service BundleService {
31
31
  rpc ExportBundles (ExportBundlesRequest) returns (ExportBundlesResponse);
32
32
 
33
33
  rpc AddCrossSellLink (AddCrossSellLinkRequest) returns (SuccessResponse);
34
+
35
+ rpc GenerateBundleCollage (GenerateBundleCollageRequest) returns (GenerateBundleCollageResponse);
34
36
  }
35
37
 
36
38
 
@@ -347,3 +349,17 @@ message ExportBundlesResponse {
347
349
  string format = 2;
348
350
  int32 count = 3;
349
351
  }
352
+
353
+ message GenerateBundleCollageRequest {
354
+ string bundle_id = 1;
355
+ // Optional: override cell pixel size (default 400)
356
+ optional int32 cell_size = 2;
357
+ }
358
+
359
+ message GenerateBundleCollageResponse {
360
+ string url = 1; // Public CDN/S3 URL of the collage JPEG
361
+ string key = 2; // S3 object key
362
+ int32 width = 3; // Final image width in pixels
363
+ int32 height = 4; // Final image height in pixels
364
+ string bundle_id = 5;
365
+ }
@@ -0,0 +1,128 @@
1
+ syntax = "proto3";
2
+
3
+ package catalog.v1;
4
+
5
+ import "common.proto";
6
+
7
+ service PickupPointService {
8
+ // Pickup points CRUD
9
+ rpc GetPickupPoints (GetPickupPointsRequest) returns (GetPickupPointsResponse);
10
+ rpc GetPickupPoint (GetPickupPointRequest) returns (PickupPointResponse);
11
+ rpc CreatePickupPoint (CreatePickupPointRequest) returns (PickupPointResponse);
12
+ rpc UpdatePickupPoint (UpdatePickupPointRequest) returns (PickupPointResponse);
13
+ rpc DeletePickupPoint (DeletePickupPointRequest) returns (DeleteResponse);
14
+
15
+ // Stock per pickup point
16
+ rpc GetPickupStock (GetPickupStockRequest) returns (GetPickupStockResponse);
17
+ rpc SetPickupStock (SetPickupStockRequest) returns (PickupStockItemResponse);
18
+ rpc AdjustPickupStock (AdjustPickupStockRequest) returns (PickupStockItemResponse);
19
+ rpc BulkSetPickupStock (BulkSetPickupStockRequest) returns (SuccessResponse);
20
+ rpc BulkSyncFromOnec (BulkSyncFromOnecRequest) returns (SuccessResponse);
21
+ }
22
+
23
+ // ── Pickup Point ──────────────────────────────────────────────
24
+
25
+ message PickupPointResponse {
26
+ string id = 1;
27
+ string name = 2;
28
+ string address = 3;
29
+ string city = 4;
30
+ optional string phone = 5;
31
+ optional double lat = 6;
32
+ optional double lng = 7;
33
+ bool is_active = 8;
34
+ optional string code_1c = 9;
35
+ }
36
+
37
+ message GetPickupPointsRequest {
38
+ optional bool is_active = 1;
39
+ optional string city = 2;
40
+ }
41
+
42
+ message GetPickupPointsResponse {
43
+ repeated PickupPointResponse items = 1;
44
+ }
45
+
46
+ message GetPickupPointRequest {
47
+ string id = 1;
48
+ }
49
+
50
+ message CreatePickupPointRequest {
51
+ string name = 1;
52
+ string address = 2;
53
+ string city = 3;
54
+ optional string phone = 4;
55
+ optional double lat = 5;
56
+ optional double lng = 6;
57
+ optional bool is_active = 7;
58
+ optional string code_1c = 8;
59
+ }
60
+
61
+ message UpdatePickupPointRequest {
62
+ string id = 1;
63
+ optional string name = 2;
64
+ optional string address = 3;
65
+ optional string city = 4;
66
+ optional string phone = 5;
67
+ optional double lat = 6;
68
+ optional double lng = 7;
69
+ optional bool is_active = 8;
70
+ optional string code_1c = 9;
71
+ }
72
+
73
+ message DeletePickupPointRequest {
74
+ string id = 1;
75
+ }
76
+
77
+ // ── Pickup Stock ──────────────────────────────────────────────
78
+
79
+ message PickupStockItemResponse {
80
+ string pickup_point_id = 1;
81
+ string product_id = 2;
82
+ optional string variant_id = 3;
83
+ int32 qty = 4;
84
+ string source = 5; // "MANUAL" | "SYNC_1C"
85
+ string updated_at = 6;
86
+ optional string pickup_point_name = 7;
87
+ }
88
+
89
+ message GetPickupStockRequest {
90
+ optional string product_id = 1;
91
+ optional string variant_id = 2;
92
+ optional string pickup_point_id = 3;
93
+ }
94
+
95
+ message GetPickupStockResponse {
96
+ repeated PickupStockItemResponse items = 1;
97
+ }
98
+
99
+ message SetPickupStockRequest {
100
+ string pickup_point_id = 1;
101
+ string product_id = 2;
102
+ optional string variant_id = 3;
103
+ int32 qty = 4;
104
+ optional string source = 5; // default MANUAL
105
+ }
106
+
107
+ message AdjustPickupStockRequest {
108
+ string pickup_point_id = 1;
109
+ string product_id = 2;
110
+ optional string variant_id = 3;
111
+ int32 delta = 4; // positive = add, negative = subtract
112
+ }
113
+
114
+ message BulkSetPickupStockRequest {
115
+ repeated SetPickupStockRequest items = 1;
116
+ }
117
+
118
+ // Масова синхронізація з 1С: масив рядків вигляду "code1c:productGuid1c:variantGuid1c?:qty"
119
+ message BulkSyncFromOnecRequest {
120
+ repeated OnecStockEntry entries = 1;
121
+ }
122
+
123
+ message OnecStockEntry {
124
+ string code_1c = 1;
125
+ string product_guid = 2;
126
+ optional string variant_guid = 3;
127
+ int32 qty = 4;
128
+ }