@mamindom/contracts 1.0.81 → 1.0.83
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/pickup.d.ts +125 -0
- package/dist/gen/pickup.js +39 -0
- package/dist/proto/pickup.proto +128 -0
- package/dist/src/proto/paths.d.ts +1 -0
- package/dist/src/proto/paths.js +1 -0
- package/gen/pickup.ts +222 -0
- package/package.json +1 -1
- package/proto/pickup.proto +128 -0
|
@@ -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";
|
|
@@ -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/dist/src/proto/paths.js
CHANGED
|
@@ -17,6 +17,7 @@ exports.PROTO_PATHS = {
|
|
|
17
17
|
STOCK: (0, node_path_1.join)(__dirname, '../../proto/stock.proto'),
|
|
18
18
|
BUNDLE: (0, node_path_1.join)(__dirname, '../../proto/bundle.proto'),
|
|
19
19
|
FILTER: (0, node_path_1.join)(__dirname, '../../proto/shop_filters.proto'),
|
|
20
|
+
PICKUP: (0, node_path_1.join)(__dirname, '../../proto/pickup.proto'),
|
|
20
21
|
COMMON_PROMO: (0, node_path_1.join)(__dirname, '../../proto/common_promo.proto'),
|
|
21
22
|
CALCULATION: (0, node_path_1.join)(__dirname, '../../proto/calculation.proto'),
|
|
22
23
|
COUPON: (0, node_path_1.join)(__dirname, '../../proto/coupon.proto'),
|
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
|
@@ -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
|
+
}
|