@prodoctors/contracts 1.0.8 → 1.1.0

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.
@@ -7,4 +7,5 @@ export declare const PROTO_PATHS: {
7
7
  readonly PARTNER: string;
8
8
  readonly PURCHASE: string;
9
9
  readonly SALES: string;
10
+ readonly SHIFT: string;
10
11
  };
@@ -11,4 +11,5 @@ exports.PROTO_PATHS = {
11
11
  PARTNER: (0, path_1.join)(__dirname, "../../proto/partner.proto"),
12
12
  PURCHASE: (0, path_1.join)(__dirname, "../../proto/purchase.proto"),
13
13
  SALES: (0, path_1.join)(__dirname, "../../proto/sales.proto"),
14
+ SHIFT: (0, path_1.join)(__dirname, "../../proto/shift.proto"),
14
15
  };
package/gen/inventory.ts CHANGED
@@ -97,6 +97,10 @@ export interface Product {
97
97
  createdAt: Timestamp | undefined;
98
98
  updatedAt: Timestamp | undefined;
99
99
  imageUrl?: string | undefined;
100
+ baseUnit: UnitType;
101
+ packageUnit: UnitType;
102
+ unitsPerPackage: number;
103
+ allowFractionalSale: boolean;
100
104
  }
101
105
 
102
106
  export interface ProductBarcode {
@@ -126,6 +130,9 @@ export interface ProductBatch {
126
130
  product?: Product | undefined;
127
131
  createdAt: Timestamp | undefined;
128
132
  updatedAt: Timestamp | undefined;
133
+ purchasePackageQuantity: number;
134
+ unitsPerPackage: number;
135
+ sellingPricePerBaseUnit?: string | undefined;
129
136
  }
130
137
 
131
138
  export interface StockMovement {
@@ -161,6 +168,10 @@ export interface CreateProductRequest {
161
168
  price: string;
162
169
  costPrice?: string | undefined;
163
170
  imageUrl?: string | undefined;
171
+ baseUnit?: UnitType | undefined;
172
+ packageUnit?: UnitType | undefined;
173
+ unitsPerPackage?: number | undefined;
174
+ allowFractionalSale?: boolean | undefined;
164
175
  }
165
176
 
166
177
  export interface UpdateProductRequest {
@@ -181,6 +192,10 @@ export interface UpdateProductRequest {
181
192
  price?: string | undefined;
182
193
  costPrice?: string | undefined;
183
194
  imageUrl?: string | undefined;
195
+ baseUnit?: UnitType | undefined;
196
+ packageUnit?: UnitType | undefined;
197
+ unitsPerPackage?: number | undefined;
198
+ allowFractionalSale?: boolean | undefined;
184
199
  }
185
200
 
186
201
  export interface ListProductsRequest {
@@ -230,6 +245,9 @@ export interface CreateProductBatchRequest {
230
245
  remainingQuantity?: number | undefined;
231
246
  status?: BatchStatus | undefined;
232
247
  purchaseItemId?: string | undefined;
248
+ purchasePackageQuantity?: number | undefined;
249
+ unitsPerPackage?: number | undefined;
250
+ sellingPricePerBaseUnit?: string | undefined;
233
251
  }
234
252
 
235
253
  export interface UpdateProductBatchRequest {
@@ -242,6 +260,9 @@ export interface UpdateProductBatchRequest {
242
260
  initialQuantity?: number | undefined;
243
261
  remainingQuantity?: number | undefined;
244
262
  status?: BatchStatus | undefined;
263
+ purchasePackageQuantity?: number | undefined;
264
+ unitsPerPackage?: number | undefined;
265
+ sellingPricePerBaseUnit?: string | undefined;
245
266
  }
246
267
 
247
268
  export interface ListProductBatchesRequest {
package/gen/sales.ts CHANGED
@@ -9,7 +9,7 @@ import { GrpcMethod, GrpcStreamMethod } from "@nestjs/microservices";
9
9
  import { Observable } from "rxjs";
10
10
  import { BoolResponse, IdRequest, PaginationMeta, PaginationRequest } from "./common";
11
11
  import { Timestamp } from "./google/protobuf/timestamp";
12
- import { Product, ProductBatch } from "./inventory";
12
+ import { Product, ProductBatch, UnitType } from "./inventory";
13
13
  import { Customer } from "./partner";
14
14
 
15
15
  export const protobufPackage = "sales.v1";
@@ -56,6 +56,8 @@ export interface SaleItem {
56
56
  productBatch?: ProductBatch | undefined;
57
57
  createdAt: Timestamp | undefined;
58
58
  updatedAt: Timestamp | undefined;
59
+ saleUnit: UnitType;
60
+ baseQuantity: number;
59
61
  }
60
62
 
61
63
  export interface SaleOrder {
@@ -92,6 +94,8 @@ export interface SaleReturnItem {
92
94
  productBatch?: ProductBatch | undefined;
93
95
  createdAt: Timestamp | undefined;
94
96
  updatedAt: Timestamp | undefined;
97
+ returnUnit: UnitType;
98
+ baseQuantity: number;
95
99
  }
96
100
 
97
101
  export interface SaleReturn {
@@ -123,6 +127,8 @@ export interface WriteOffItem {
123
127
  productBatch?: ProductBatch | undefined;
124
128
  createdAt: Timestamp | undefined;
125
129
  updatedAt: Timestamp | undefined;
130
+ writeOffUnit: UnitType;
131
+ baseQuantity: number;
126
132
  }
127
133
 
128
134
  export interface WriteOff {
@@ -144,6 +150,8 @@ export interface CreateSaleItemInput {
144
150
  unitPrice: string;
145
151
  discountAmount?: string | undefined;
146
152
  totalAmount: string;
153
+ saleUnit?: UnitType | undefined;
154
+ baseQuantity?: number | undefined;
147
155
  }
148
156
 
149
157
  export interface CreateSaleOrderRequest {
@@ -202,6 +210,8 @@ export interface CreateSaleReturnItemInput {
202
210
  quantity: number;
203
211
  unitPrice: string;
204
212
  totalAmount: string;
213
+ returnUnit?: UnitType | undefined;
214
+ baseQuantity?: number | undefined;
205
215
  }
206
216
 
207
217
  export interface CreateSaleReturnRequest {
@@ -245,6 +255,8 @@ export interface CreateWriteOffItemInput {
245
255
  unitPrice: string;
246
256
  totalAmount: string;
247
257
  note?: string | undefined;
258
+ writeOffUnit?: UnitType | undefined;
259
+ baseQuantity?: number | undefined;
248
260
  }
249
261
 
250
262
  export interface CreateWriteOffRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prodoctors/contracts",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
4
4
  "description": "Protobuf definitions and generated Typescript types for ProDoctors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -85,6 +85,10 @@ message Product {
85
85
  google.protobuf.Timestamp created_at = 21;
86
86
  google.protobuf.Timestamp updated_at = 22;
87
87
  optional string image_url = 23;
88
+ UnitType base_unit = 24;
89
+ UnitType package_unit = 25;
90
+ int32 units_per_package = 26;
91
+ bool allow_fractional_sale = 27;
88
92
  }
89
93
 
90
94
  message ProductBarcode {
@@ -114,6 +118,9 @@ message ProductBatch {
114
118
  optional Product product = 13;
115
119
  google.protobuf.Timestamp created_at = 14;
116
120
  google.protobuf.Timestamp updated_at = 15;
121
+ int32 purchase_package_quantity = 16;
122
+ int32 units_per_package = 17;
123
+ optional string selling_price_per_base_unit = 18;
117
124
  }
118
125
 
119
126
  message StockMovement {
@@ -149,6 +156,10 @@ message CreateProductRequest {
149
156
  string price = 14;
150
157
  optional string cost_price = 15;
151
158
  optional string image_url = 16;
159
+ optional UnitType base_unit = 17;
160
+ optional UnitType package_unit = 18;
161
+ optional int32 units_per_package = 19;
162
+ optional bool allow_fractional_sale = 20;
152
163
  }
153
164
 
154
165
  message UpdateProductRequest {
@@ -169,6 +180,10 @@ message UpdateProductRequest {
169
180
  optional string price = 15;
170
181
  optional string cost_price = 16;
171
182
  optional string image_url = 17;
183
+ optional UnitType base_unit = 18;
184
+ optional UnitType package_unit = 19;
185
+ optional int32 units_per_package = 20;
186
+ optional bool allow_fractional_sale = 21;
172
187
  }
173
188
 
174
189
  message ListProductsRequest {
@@ -218,6 +233,9 @@ message CreateProductBatchRequest {
218
233
  optional int32 remaining_quantity = 9;
219
234
  optional BatchStatus status = 10;
220
235
  optional string purchase_item_id = 11;
236
+ optional int32 purchase_package_quantity = 12;
237
+ optional int32 units_per_package = 13;
238
+ optional string selling_price_per_base_unit = 14;
221
239
  }
222
240
 
223
241
  message UpdateProductBatchRequest {
@@ -230,6 +248,9 @@ message UpdateProductBatchRequest {
230
248
  optional int32 initial_quantity = 7;
231
249
  optional int32 remaining_quantity = 8;
232
250
  optional BatchStatus status = 9;
251
+ optional int32 purchase_package_quantity = 10;
252
+ optional int32 units_per_package = 11;
253
+ optional string selling_price_per_base_unit = 12;
233
254
  }
234
255
 
235
256
  message ListProductBatchesRequest {
package/proto/sales.proto CHANGED
@@ -46,6 +46,8 @@ message SaleItem {
46
46
  optional inventory.v1.ProductBatch product_batch = 10;
47
47
  google.protobuf.Timestamp created_at = 11;
48
48
  google.protobuf.Timestamp updated_at = 12;
49
+ inventory.v1.UnitType sale_unit = 13;
50
+ int32 base_quantity = 14;
49
51
  }
50
52
 
51
53
  message SaleOrder {
@@ -82,6 +84,8 @@ message SaleReturnItem {
82
84
  optional inventory.v1.ProductBatch product_batch = 9;
83
85
  google.protobuf.Timestamp created_at = 10;
84
86
  google.protobuf.Timestamp updated_at = 11;
87
+ inventory.v1.UnitType return_unit = 12;
88
+ int32 base_quantity = 13;
85
89
  }
86
90
 
87
91
  message SaleReturn {
@@ -113,6 +117,8 @@ message WriteOffItem {
113
117
  optional inventory.v1.ProductBatch product_batch = 10;
114
118
  google.protobuf.Timestamp created_at = 11;
115
119
  google.protobuf.Timestamp updated_at = 12;
120
+ inventory.v1.UnitType write_off_unit = 13;
121
+ int32 base_quantity = 14;
116
122
  }
117
123
 
118
124
  message WriteOff {
@@ -134,6 +140,8 @@ message CreateSaleItemInput {
134
140
  string unit_price = 4;
135
141
  optional string discount_amount = 5;
136
142
  string total_amount = 6;
143
+ optional inventory.v1.UnitType sale_unit = 7;
144
+ optional int32 base_quantity = 8;
137
145
  }
138
146
 
139
147
  message CreateSaleOrderRequest {
@@ -192,6 +200,8 @@ message CreateSaleReturnItemInput {
192
200
  int32 quantity = 3;
193
201
  string unit_price = 4;
194
202
  string total_amount = 5;
203
+ optional inventory.v1.UnitType return_unit = 6;
204
+ optional int32 base_quantity = 7;
195
205
  }
196
206
 
197
207
  message CreateSaleReturnRequest {
@@ -235,6 +245,8 @@ message CreateWriteOffItemInput {
235
245
  string unit_price = 4;
236
246
  string total_amount = 5;
237
247
  optional string note = 6;
248
+ optional inventory.v1.UnitType write_off_unit = 7;
249
+ optional int32 base_quantity = 8;
238
250
  }
239
251
 
240
252
  message CreateWriteOffRequest {