@aepstore-dev/contracts 1.29.0 → 1.31.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.
package/gen/products.ts CHANGED
@@ -73,6 +73,20 @@ export interface ProductUser {
73
73
  avatarUrl: string;
74
74
  }
75
75
 
76
+ /**
77
+ * Moderation block — null on the product while it's a DRAFT / never submitted.
78
+ * status is one of PENDING | APPROVED | REJECTED (never UNSPECIFIED here).
79
+ */
80
+ export interface ProductModeration {
81
+ status: ModerationStatus;
82
+ /** moderator note (mainly on REJECTED) */
83
+ comment: string;
84
+ /** moderator user id */
85
+ moderatedBy: string;
86
+ /** ISO 8601 */
87
+ moderatedAt: string;
88
+ }
89
+
76
90
  export interface Product {
77
91
  id: string;
78
92
  name: string;
@@ -86,10 +100,8 @@ export interface Product {
86
100
  /** double as string for consistency */
87
101
  averageRating: string;
88
102
  status: ProductStatus;
89
- moderationStatus: ModerationStatus;
90
- moderationComment: string;
91
- moderatedBy: string;
92
- moderatedAt: string;
103
+ /** null while DRAFT / not yet submitted */
104
+ moderation: ProductModeration | undefined;
93
105
  createdAt: string;
94
106
  updatedAt: string;
95
107
  preview: string;
@@ -266,6 +278,20 @@ export interface SaveAttachmentMetadataRequest {
266
278
  uploadId: string;
267
279
  }
268
280
 
281
+ export interface RemoveMediaRequest {
282
+ /** product id */
283
+ id: string;
284
+ userId: string;
285
+ mediaId: string;
286
+ }
287
+
288
+ export interface RemoveAttachmentRequest {
289
+ /** product id */
290
+ id: string;
291
+ userId: string;
292
+ attachmentId: string;
293
+ }
294
+
269
295
  export interface ProductModerationQueryRequest {
270
296
  status: ModerationStatus;
271
297
  page: number;
@@ -375,6 +401,10 @@ export interface ProductsServiceClient {
375
401
 
376
402
  saveAttachmentMetadata(request: SaveAttachmentMetadataRequest): Observable<ProductResponse>;
377
403
 
404
+ removeMedia(request: RemoveMediaRequest): Observable<ProductResponse>;
405
+
406
+ removeAttachment(request: RemoveAttachmentRequest): Observable<ProductResponse>;
407
+
378
408
  getProductsForModeration(request: ProductModerationQueryRequest): Observable<ProductsListResponse>;
379
409
 
380
410
  moderateProduct(request: ModerateProductRequest): Observable<ModerationResponse>;
@@ -436,6 +466,12 @@ export interface ProductsServiceController {
436
466
  request: SaveAttachmentMetadataRequest,
437
467
  ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
438
468
 
469
+ removeMedia(request: RemoveMediaRequest): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
470
+
471
+ removeAttachment(
472
+ request: RemoveAttachmentRequest,
473
+ ): Promise<ProductResponse> | Observable<ProductResponse> | ProductResponse;
474
+
439
475
  getProductsForModeration(
440
476
  request: ProductModerationQueryRequest,
441
477
  ): Promise<ProductsListResponse> | Observable<ProductsListResponse> | ProductsListResponse;
@@ -491,6 +527,8 @@ export function ProductsServiceControllerMethods() {
491
527
  "removeFromFavorites",
492
528
  "saveMediaMetadata",
493
529
  "saveAttachmentMetadata",
530
+ "removeMedia",
531
+ "removeAttachment",
494
532
  "getProductsForModeration",
495
533
  "moderateProduct",
496
534
  "resubmitProduct",
package/package.json CHANGED
@@ -1,35 +1,35 @@
1
- {
2
- "name": "@aepstore-dev/contracts",
3
- "version": "1.29.0",
4
- "description": "Protobuf definitions for aepstore microservices",
5
- "main": "./dist/index.js",
6
- "types": "./dist/index.d.ts",
7
- "scripts": {
8
- "generate": "node scripts/generate.cjs",
9
- "build": "tsc -p tsconfig.build.json"
10
- },
11
- "files": [
12
- "dist",
13
- "proto",
14
- "gen"
15
- ],
16
- "publishConfig": {
17
- "access": "public"
18
- },
19
- "author": {
20
- "name": "torroixq",
21
- "email": "cato.ixq@gmail.com"
22
- },
23
- "peerDependencies": {
24
- "@nestjs/microservices": "^11.1.11",
25
- "rxjs": "^7.8.2"
26
- },
27
- "devDependencies": {
28
- "@nestjs/microservices": "^11.1.11",
29
- "@protobuf-ts/protoc": "^2.9.4",
30
- "@types/node": "^25.0.3",
31
- "rxjs": "^7.8.2",
32
- "ts-proto": "^2.10.1",
33
- "typescript": "^5.9.3"
34
- }
35
- }
1
+ {
2
+ "name": "@aepstore-dev/contracts",
3
+ "version": "1.31.0",
4
+ "description": "Protobuf definitions for aepstore microservices",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
+ "scripts": {
8
+ "generate": "node scripts/generate.cjs",
9
+ "build": "tsc -p tsconfig.build.json"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "proto",
14
+ "gen"
15
+ ],
16
+ "publishConfig": {
17
+ "access": "public"
18
+ },
19
+ "author": {
20
+ "name": "torroixq",
21
+ "email": "cato.ixq@gmail.com"
22
+ },
23
+ "peerDependencies": {
24
+ "@nestjs/microservices": "^11.1.11",
25
+ "rxjs": "^7.8.2"
26
+ },
27
+ "devDependencies": {
28
+ "@nestjs/microservices": "^11.1.11",
29
+ "@protobuf-ts/protoc": "^2.9.4",
30
+ "@types/node": "^25.0.3",
31
+ "rxjs": "^7.8.2",
32
+ "ts-proto": "^2.10.1",
33
+ "typescript": "^5.9.3"
34
+ }
35
+ }
@@ -18,6 +18,8 @@ service ProductsService {
18
18
 
19
19
  rpc SaveMediaMetadata(SaveMediaMetadataRequest) returns (ProductResponse);
20
20
  rpc SaveAttachmentMetadata(SaveAttachmentMetadataRequest) returns (ProductResponse);
21
+ rpc RemoveMedia(RemoveMediaRequest) returns (ProductResponse);
22
+ rpc RemoveAttachment(RemoveAttachmentRequest) returns (ProductResponse);
21
23
 
22
24
  rpc GetProductsForModeration(ProductModerationQueryRequest) returns (ProductsListResponse);
23
25
  rpc ModerateProduct(ModerateProductRequest) returns (ModerationResponse);
@@ -99,7 +101,17 @@ message ProductUser {
99
101
  string avatar_url = 3;
100
102
  }
101
103
 
104
+ // Moderation block — null on the product while it's a DRAFT / never submitted.
105
+ // status is one of PENDING | APPROVED | REJECTED (never UNSPECIFIED here).
106
+ message ProductModeration {
107
+ ModerationStatus status = 1;
108
+ string comment = 2; // moderator note (mainly on REJECTED)
109
+ string moderated_by = 3; // moderator user id
110
+ string moderated_at = 4; // ISO 8601
111
+ }
112
+
102
113
  message Product {
114
+ reserved 9, 10, 11, 12; // retired flat moderation fields → see `moderation`
103
115
  string id = 1;
104
116
  string name = 2;
105
117
  string description = 3;
@@ -108,10 +120,7 @@ message Product {
108
120
  string final_price = 6; // Decimal as string
109
121
  string average_rating = 7; // double as string for consistency
110
122
  ProductStatus status = 8;
111
- ModerationStatus moderation_status = 9;
112
- string moderation_comment = 10;
113
- string moderated_by = 11;
114
- string moderated_at = 12;
123
+ ProductModeration moderation = 32; // null while DRAFT / not yet submitted
115
124
  string created_at = 13;
116
125
  string updated_at = 14;
117
126
  string preview = 15;
@@ -286,6 +295,18 @@ message SaveAttachmentMetadataRequest {
286
295
  string upload_id = 4;
287
296
  }
288
297
 
298
+ message RemoveMediaRequest {
299
+ string id = 1; // product id
300
+ string user_id = 2;
301
+ string media_id = 3;
302
+ }
303
+
304
+ message RemoveAttachmentRequest {
305
+ string id = 1; // product id
306
+ string user_id = 2;
307
+ string attachment_id = 3;
308
+ }
309
+
289
310
  // =================================================================
290
311
  // Moderation
291
312
  // =================================================================