@aepstore-dev/contracts 1.31.0 → 1.33.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.
@@ -1,393 +1,404 @@
1
- syntax = "proto3";
2
-
3
- package products.v1;
4
-
5
- service ProductsService {
6
- rpc Create(CreateProductRequest) returns (ProductResponse);
7
- rpc FindAll(QueryProductsRequest) returns (ProductsListResponse);
8
- rpc FindAllApproved(QueryProductsRequest) returns (ProductsListResponse);
9
- rpc FindMy(FindMyRequest) returns (ProductsListResponse);
10
- rpc FindOne(FindOneRequest) returns (ProductResponse);
11
- rpc Update(UpdateProductRequest) returns (ProductResponse);
12
- rpc Remove(RemoveProductRequest) returns (Ok);
13
- rpc SubmitForModeration(SubmitForModerationRequest) returns (ProductResponse);
14
- rpc GetPriceRange(Empty) returns (PriceRangeResponse);
15
-
16
- rpc AddToFavorites(FavoriteRequest) returns (Ok);
17
- rpc RemoveFromFavorites(FavoriteRequest) returns (Ok);
18
-
19
- rpc SaveMediaMetadata(SaveMediaMetadataRequest) returns (ProductResponse);
20
- rpc SaveAttachmentMetadata(SaveAttachmentMetadataRequest) returns (ProductResponse);
21
- rpc RemoveMedia(RemoveMediaRequest) returns (ProductResponse);
22
- rpc RemoveAttachment(RemoveAttachmentRequest) returns (ProductResponse);
23
-
24
- rpc GetProductsForModeration(ProductModerationQueryRequest) returns (ProductsListResponse);
25
- rpc ModerateProduct(ModerateProductRequest) returns (ModerationResponse);
26
- rpc ResubmitProduct(ResubmitProductRequest) returns (ProductResponse);
27
-
28
- rpc GetSecureDownloadLinks(GetSecureDownloadLinksRequest) returns (SecureDownloadLinksResponse);
29
- rpc GetAttachmentDownloadInfo(GetAttachmentDownloadInfoRequest) returns (AttachmentDownloadInfoResponse);
30
- // Single presigned GET URL for one attachment (after purchase/access check).
31
- // Bytes never traverse the backend — see upload-service.
32
- rpc GetAttachmentDownloadUrl(GetAttachmentDownloadUrlRequest) returns (AttachmentDownloadUrlResponse);
33
-
34
- rpc GetTopProduct(TopProductRequest) returns (ProductResponse);
35
- rpc GetPopularProducts(QueryProductsRequest) returns (ProductsListResponse);
36
- }
37
-
38
- // =================================================================
39
- // Enums
40
- // =================================================================
41
-
42
- // Member names match the DB enum string values exactly (enums: String on the
43
- // wire) so values pass straight through with no mapping. UNSPECIFIED=0 covers
44
- // null/optional (e.g. nullable moderation_status, missing list filters).
45
- enum ProductStatus {
46
- PRODUCT_STATUS_UNSPECIFIED = 0;
47
- ACTIVE = 1;
48
- DRAFT = 2;
49
- }
50
-
51
- enum ModerationStatus {
52
- MODERATION_STATUS_UNSPECIFIED = 0;
53
- PENDING = 1;
54
- APPROVED = 2;
55
- REJECTED = 3;
56
- }
57
-
58
- enum MediaType {
59
- MEDIA_TYPE_UNSPECIFIED = 0;
60
- IMAGE = 1;
61
- VIDEO = 2;
62
- }
63
-
64
- // =================================================================
65
- // Nested entities
66
- // =================================================================
67
-
68
- message Category {
69
- string id = 1;
70
- string name = 2;
71
- }
72
-
73
- message Application {
74
- string id = 1;
75
- string name = 2;
76
- }
77
-
78
- message Tag {
79
- string id = 1;
80
- string name = 2;
81
- }
82
-
83
- message ProductMedia {
84
- string id = 1;
85
- string url = 2;
86
- MediaType type = 3;
87
- }
88
-
89
- message Attachment {
90
- string id = 1;
91
- string url = 2;
92
- string file_key = 3;
93
- string file_name = 4;
94
- double file_size = 5;
95
- string created_at = 6;
96
- }
97
-
98
- message ProductUser {
99
- string id = 1;
100
- string username = 2;
101
- string avatar_url = 3;
102
- }
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
-
113
- message Product {
114
- reserved 9, 10, 11, 12; // retired flat moderation fields → see `moderation`
115
- string id = 1;
116
- string name = 2;
117
- string description = 3;
118
- string price = 4; // Decimal as string (D7)
119
- string discount_percent = 5; // Decimal as string
120
- string final_price = 6; // Decimal as string
121
- string average_rating = 7; // double as string for consistency
122
- ProductStatus status = 8;
123
- ProductModeration moderation = 32; // null while DRAFT / not yet submitted
124
- string created_at = 13;
125
- string updated_at = 14;
126
- string preview = 15;
127
- string video = 16;
128
- ProductUser user = 17;
129
- repeated ProductMedia media = 18;
130
- repeated Category categories = 19;
131
- repeated Application applications = 20;
132
- repeated Tag tags = 21;
133
-
134
- // Aggregate counts (populated where the query includes _count).
135
- int32 favorites_count = 22;
136
- int32 views_count = 23;
137
- int32 reviews_count = 24;
138
-
139
- // Viewer-contextual flags (populated by FindOne when a viewer is known).
140
- bool owner = 25;
141
- bool is_favorite = 26;
142
- bool is_viewed = 27;
143
- string revenue = 28; // owner-only, current-month revenue (Decimal as string)
144
- bool is_buyed = 30; // viewer has a COMPLETED purchase of this product
145
- bool is_reviewed = 31; // viewer has already left a review on this product
146
-
147
- // Popularity (populated by GetTopProduct / GetPopularProducts).
148
- string popularity_score = 29; // double as string
149
- }
150
-
151
- // Compact product shape for "related products" only the fields a card needs.
152
- message RelatedProduct {
153
- string id = 1;
154
- string name = 2;
155
- string price = 3; // Decimal as string
156
- string discount_percent = 4; // Decimal as string
157
- string final_price = 5; // Decimal as string
158
- string preview = 6;
159
- ProductUser user = 7;
160
- repeated Category categories = 8;
161
- }
162
-
163
- message ProductResponse {
164
- Product product = 1;
165
- // Populated only by FindOne: up to 2 other approved products by the same author.
166
- repeated RelatedProduct related_products = 2;
167
- }
168
-
169
- message TopProductRequest {
170
- // Optional. If set, the top product is searched only among this seller's products.
171
- string user_id = 1;
172
- }
173
-
174
- message ProductsListResponse {
175
- repeated Product items = 1;
176
- int32 total = 2;
177
- int32 page = 3;
178
- int32 limit = 4;
179
- }
180
-
181
- message Ok {
182
- bool ok = 1;
183
- }
184
-
185
- message Empty {}
186
-
187
- // =================================================================
188
- // Create / Update / Query
189
- // =================================================================
190
-
191
- message CreateProductRequest {
192
- string user_id = 1;
193
- string name = 2;
194
- string price = 3; // Decimal as string
195
- repeated string category_ids = 4;
196
- repeated string application_ids = 5;
197
- repeated string tags = 6;
198
- string discount_percent = 7; // optional
199
- string final_price = 8; // optional
200
- string video = 9;
201
- string description = 10;
202
- ProductStatus status = 11;
203
- }
204
-
205
- message UpdateProductRequest {
206
- string user_id = 1;
207
- string id = 2;
208
- string name = 3;
209
- string description = 4;
210
- string price = 5;
211
- string discount_percent = 6;
212
- string final_price = 7;
213
- repeated string tags = 8;
214
- repeated string category_ids = 9;
215
- repeated string application_ids = 10;
216
- }
217
-
218
- message QueryProductsRequest {
219
- string search = 1;
220
- repeated string category_ids = 2;
221
- repeated string application_ids = 3;
222
- repeated string tags = 4;
223
- string min_price = 5;
224
- string max_price = 6;
225
- int32 page = 7;
226
- int32 limit = 8;
227
- string sort_by = 9; // createdAt | price | name | updatedAt | finalPrice
228
- string sort_order = 10; // asc | desc
229
- ProductStatus status = 11;
230
- ModerationStatus moderation_status = 12;
231
- }
232
-
233
- message FindMyRequest {
234
- string user_id = 1;
235
- QueryProductsRequest query = 2;
236
- }
237
-
238
- message FindOneRequest {
239
- string id = 1;
240
- string viewer_user_id = 2; // optional — to compute is_favorited etc.
241
- string viewer_key = 3; // dedup key for view counting (userId or hashed ip+ua)
242
- }
243
-
244
- message RemoveProductRequest {
245
- string id = 1;
246
- string user_id = 2;
247
- }
248
-
249
- message SubmitForModerationRequest {
250
- string id = 1;
251
- string user_id = 2;
252
- }
253
-
254
- message PriceRangeResponse {
255
- string min = 1; // Decimal as string
256
- string max = 2;
257
- }
258
-
259
- // =================================================================
260
- // Favorites
261
- // =================================================================
262
-
263
- message FavoriteRequest {
264
- string user_id = 1;
265
- string product_id = 2;
266
- }
267
-
268
- // =================================================================
269
- // Media / Attachments metadata
270
- // =================================================================
271
-
272
- message MediaFile {
273
- string url = 1;
274
- MediaType type = 2;
275
- }
276
-
277
- message SaveMediaMetadataRequest {
278
- string id = 1;
279
- string user_id = 2;
280
- repeated MediaFile files = 3;
281
- string upload_id = 4;
282
- }
283
-
284
- message AttachmentMeta {
285
- string url = 1;
286
- string file_key = 2;
287
- string file_name = 3;
288
- double file_size = 4;
289
- }
290
-
291
- message SaveAttachmentMetadataRequest {
292
- string id = 1;
293
- string user_id = 2;
294
- AttachmentMeta attachment = 3;
295
- string upload_id = 4;
296
- }
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
-
310
- // =================================================================
311
- // Moderation
312
- // =================================================================
313
-
314
- message ProductModerationQueryRequest {
315
- ModerationStatus status = 1;
316
- int32 page = 2;
317
- int32 limit = 3;
318
- string sort_by = 4;
319
- string sort_order = 5;
320
- }
321
-
322
- message ModerateProductRequest {
323
- string product_id = 1;
324
- string moderator_id = 2;
325
- string action = 3; // 'approve' | 'reject'
326
- string comment = 4;
327
- }
328
-
329
- message ModerationResponse {
330
- bool success = 1;
331
- string message = 2;
332
- Product product = 3;
333
- ModerationStatus moderation_status = 4;
334
- string moderation_comment = 5;
335
- string moderated_by = 6;
336
- string moderated_at = 7;
337
- }
338
-
339
- message ResubmitProductRequest {
340
- string product_id = 1;
341
- string user_id = 2;
342
- string comment = 3;
343
- // Free-form payload of changes — serialized as JSON string to keep the
344
- // legacy `any` shape without forcing a strict schema on a free-form patch.
345
- string changes_json = 4;
346
- }
347
-
348
- // =================================================================
349
- // Secure downloads
350
- // =================================================================
351
-
352
- message GetSecureDownloadLinksRequest {
353
- string product_id = 1;
354
- string user_id = 2;
355
- int32 expires_in = 3;
356
- }
357
-
358
- message SecureDownloadLink {
359
- string download_url = 1;
360
- int32 expires_in = 2;
361
- string file_name = 3;
362
- double file_size = 4;
363
- string attachment_id = 5;
364
- }
365
-
366
- message SecureDownloadLinksResponse {
367
- repeated SecureDownloadLink links = 1;
368
- }
369
-
370
- message GetAttachmentDownloadInfoRequest {
371
- string product_id = 1;
372
- string attachment_id = 2;
373
- string user_id = 3;
374
- }
375
-
376
- message AttachmentDownloadInfoResponse {
377
- string file_name = 1;
378
- double file_size = 2;
379
- string content_type = 3;
380
- }
381
-
382
- message GetAttachmentDownloadUrlRequest {
383
- string product_id = 1;
384
- string attachment_id = 2;
385
- string user_id = 3;
386
- }
387
-
388
- message AttachmentDownloadUrlResponse {
389
- string download_url = 1;
390
- int32 expires_in = 2;
391
- string file_name = 3;
392
- double file_size = 4;
393
- }
1
+ syntax = "proto3";
2
+
3
+ package products.v1;
4
+
5
+ service ProductsService {
6
+ rpc Create(CreateProductRequest) returns (ProductResponse);
7
+ rpc FindAll(QueryProductsRequest) returns (ProductsListResponse);
8
+ rpc FindAllApproved(QueryProductsRequest) returns (ProductsListResponse);
9
+ rpc FindMy(FindMyRequest) returns (ProductsListResponse);
10
+ rpc FindOne(FindOneRequest) returns (ProductResponse);
11
+ rpc Update(UpdateProductRequest) returns (ProductResponse);
12
+ rpc Remove(RemoveProductRequest) returns (Ok);
13
+ rpc SubmitForModeration(SubmitForModerationRequest) returns (ProductResponse);
14
+ rpc GetPriceRange(Empty) returns (PriceRangeResponse);
15
+
16
+ rpc AddToFavorites(FavoriteRequest) returns (Ok);
17
+ rpc RemoveFromFavorites(FavoriteRequest) returns (Ok);
18
+
19
+ rpc SaveMediaMetadata(SaveMediaMetadataRequest) returns (ProductResponse);
20
+ rpc SaveAttachmentMetadata(SaveAttachmentMetadataRequest) returns (ProductResponse);
21
+ rpc RemoveMedia(RemoveMediaRequest) returns (ProductResponse);
22
+ rpc RemoveAttachment(RemoveAttachmentRequest) returns (ProductResponse);
23
+
24
+ rpc GetProductsForModeration(ProductModerationQueryRequest) returns (ProductsListResponse);
25
+ rpc ModerateProduct(ModerateProductRequest) returns (ModerationResponse);
26
+ rpc ResubmitProduct(ResubmitProductRequest) returns (ProductResponse);
27
+
28
+ rpc GetSecureDownloadLinks(GetSecureDownloadLinksRequest) returns (SecureDownloadLinksResponse);
29
+ rpc GetAttachmentDownloadInfo(GetAttachmentDownloadInfoRequest) returns (AttachmentDownloadInfoResponse);
30
+ // Single presigned GET URL for one attachment (after purchase/access check).
31
+ // Bytes never traverse the backend — see upload-service.
32
+ rpc GetAttachmentDownloadUrl(GetAttachmentDownloadUrlRequest) returns (AttachmentDownloadUrlResponse);
33
+
34
+ rpc GetTopProduct(TopProductRequest) returns (ProductResponse);
35
+ rpc GetPopularProducts(QueryProductsRequest) returns (ProductsListResponse);
36
+ }
37
+
38
+ // =================================================================
39
+ // Enums
40
+ // =================================================================
41
+
42
+ // Member names match the DB enum string values exactly (enums: String on the
43
+ // wire) so values pass straight through with no mapping. UNSPECIFIED=0 covers
44
+ // null/optional (e.g. nullable moderation_status, missing list filters).
45
+ enum ProductStatus {
46
+ PRODUCT_STATUS_UNSPECIFIED = 0;
47
+ ACTIVE = 1;
48
+ DRAFT = 2;
49
+ }
50
+
51
+ enum ModerationStatus {
52
+ MODERATION_STATUS_UNSPECIFIED = 0;
53
+ PENDING = 1;
54
+ APPROVED = 2;
55
+ REJECTED = 3;
56
+ }
57
+
58
+ enum MediaType {
59
+ MEDIA_TYPE_UNSPECIFIED = 0;
60
+ IMAGE = 1;
61
+ VIDEO = 2;
62
+ }
63
+
64
+ // =================================================================
65
+ // Nested entities
66
+ // =================================================================
67
+
68
+ message Category {
69
+ string id = 1;
70
+ string name = 2;
71
+ }
72
+
73
+ message Application {
74
+ string id = 1;
75
+ string name = 2;
76
+ }
77
+
78
+ message Tag {
79
+ string id = 1;
80
+ string name = 2;
81
+ }
82
+
83
+ message ProductMedia {
84
+ string id = 1;
85
+ string url = 2;
86
+ MediaType type = 3;
87
+ }
88
+
89
+ message Attachment {
90
+ string id = 1;
91
+ string url = 2;
92
+ string file_key = 3;
93
+ string file_name = 4;
94
+ double file_size = 5;
95
+ string created_at = 6;
96
+ }
97
+
98
+ message ProductUser {
99
+ string id = 1;
100
+ string username = 2;
101
+ string avatar_url = 3;
102
+ }
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
+
113
+ message Product {
114
+ reserved 9, 10, 11, 12; // retired flat moderation fields → see `moderation`
115
+ string id = 1;
116
+ string name = 2;
117
+ string description = 3;
118
+ string price = 4; // Decimal as string (D7)
119
+ string discount_percent = 5; // Decimal as string
120
+ string final_price = 6; // Decimal as string
121
+ string average_rating = 7; // double as string for consistency
122
+ ProductStatus status = 8;
123
+ ProductModeration moderation = 32; // null while DRAFT / not yet submitted
124
+ string created_at = 13;
125
+ string updated_at = 14;
126
+ string preview = 15;
127
+ string video = 16;
128
+ ProductUser user = 17;
129
+ repeated ProductMedia media = 18;
130
+ repeated Category categories = 19;
131
+ repeated Application applications = 20;
132
+ repeated Tag tags = 21;
133
+
134
+ // Aggregate counts (populated where the query includes _count).
135
+ int32 favorites_count = 22;
136
+ int32 views_count = 23;
137
+ int32 reviews_count = 24;
138
+
139
+ // Viewer-contextual flags (populated by FindOne when a viewer is known).
140
+ bool owner = 25;
141
+ bool is_favorite = 26;
142
+ bool is_viewed = 27;
143
+ string revenue = 28; // owner-only, current-month revenue (Decimal as string)
144
+ bool is_buyed = 30; // viewer has a COMPLETED purchase of this product
145
+ bool is_reviewed = 31; // viewer has already left a review on this product
146
+
147
+ // Popularity (populated by GetTopProduct / GetPopularProducts).
148
+ string popularity_score = 29; // double as string
149
+
150
+ // OWNER-ONLY: the product's deliverable files. Populated by FindOne only
151
+ // when the viewer is the product owner; empty for everyone else (never
152
+ // exposes private attachment metadata to non-owners).
153
+ repeated ProductAttachment attachments = 33;
154
+ }
155
+
156
+ message ProductAttachment {
157
+ string id = 1;
158
+ string file_name = 2;
159
+ double file_size = 3;
160
+ }
161
+
162
+ // Compact product shape for "related products" — only the fields a card needs.
163
+ message RelatedProduct {
164
+ string id = 1;
165
+ string name = 2;
166
+ string price = 3; // Decimal as string
167
+ string discount_percent = 4; // Decimal as string
168
+ string final_price = 5; // Decimal as string
169
+ string preview = 6;
170
+ ProductUser user = 7;
171
+ repeated Category categories = 8;
172
+ }
173
+
174
+ message ProductResponse {
175
+ Product product = 1;
176
+ // Populated only by FindOne: up to 2 other approved products by the same author.
177
+ repeated RelatedProduct related_products = 2;
178
+ }
179
+
180
+ message TopProductRequest {
181
+ // Optional. If set, the top product is searched only among this seller's products.
182
+ string user_id = 1;
183
+ }
184
+
185
+ message ProductsListResponse {
186
+ repeated Product items = 1;
187
+ int32 total = 2;
188
+ int32 page = 3;
189
+ int32 limit = 4;
190
+ }
191
+
192
+ message Ok {
193
+ bool ok = 1;
194
+ }
195
+
196
+ message Empty {}
197
+
198
+ // =================================================================
199
+ // Create / Update / Query
200
+ // =================================================================
201
+
202
+ message CreateProductRequest {
203
+ string user_id = 1;
204
+ string name = 2;
205
+ string price = 3; // Decimal as string
206
+ repeated string category_ids = 4;
207
+ repeated string application_ids = 5;
208
+ repeated string tags = 6;
209
+ string discount_percent = 7; // optional
210
+ string final_price = 8; // optional
211
+ string video = 9;
212
+ string description = 10;
213
+ ProductStatus status = 11;
214
+ }
215
+
216
+ message UpdateProductRequest {
217
+ string user_id = 1;
218
+ string id = 2;
219
+ string name = 3;
220
+ string description = 4;
221
+ string price = 5;
222
+ string discount_percent = 6;
223
+ string final_price = 7;
224
+ repeated string tags = 8;
225
+ repeated string category_ids = 9;
226
+ repeated string application_ids = 10;
227
+ }
228
+
229
+ message QueryProductsRequest {
230
+ string search = 1;
231
+ repeated string category_ids = 2;
232
+ repeated string application_ids = 3;
233
+ repeated string tags = 4;
234
+ string min_price = 5;
235
+ string max_price = 6;
236
+ int32 page = 7;
237
+ int32 limit = 8;
238
+ string sort_by = 9; // createdAt | price | name | updatedAt | finalPrice
239
+ string sort_order = 10; // asc | desc
240
+ ProductStatus status = 11;
241
+ ModerationStatus moderation_status = 12;
242
+ }
243
+
244
+ message FindMyRequest {
245
+ string user_id = 1;
246
+ QueryProductsRequest query = 2;
247
+ }
248
+
249
+ message FindOneRequest {
250
+ string id = 1;
251
+ string viewer_user_id = 2; // optional — to compute is_favorited etc.
252
+ string viewer_key = 3; // dedup key for view counting (userId or hashed ip+ua)
253
+ }
254
+
255
+ message RemoveProductRequest {
256
+ string id = 1;
257
+ string user_id = 2;
258
+ }
259
+
260
+ message SubmitForModerationRequest {
261
+ string id = 1;
262
+ string user_id = 2;
263
+ }
264
+
265
+ message PriceRangeResponse {
266
+ string min = 1; // Decimal as string
267
+ string max = 2;
268
+ }
269
+
270
+ // =================================================================
271
+ // Favorites
272
+ // =================================================================
273
+
274
+ message FavoriteRequest {
275
+ string user_id = 1;
276
+ string product_id = 2;
277
+ }
278
+
279
+ // =================================================================
280
+ // Media / Attachments metadata
281
+ // =================================================================
282
+
283
+ message MediaFile {
284
+ string url = 1;
285
+ MediaType type = 2;
286
+ }
287
+
288
+ message SaveMediaMetadataRequest {
289
+ string id = 1;
290
+ string user_id = 2;
291
+ repeated MediaFile files = 3;
292
+ string upload_id = 4;
293
+ }
294
+
295
+ message AttachmentMeta {
296
+ string url = 1;
297
+ string file_key = 2;
298
+ string file_name = 3;
299
+ double file_size = 4;
300
+ }
301
+
302
+ message SaveAttachmentMetadataRequest {
303
+ string id = 1;
304
+ string user_id = 2;
305
+ AttachmentMeta attachment = 3;
306
+ string upload_id = 4;
307
+ }
308
+
309
+ message RemoveMediaRequest {
310
+ string id = 1; // product id
311
+ string user_id = 2;
312
+ string media_id = 3;
313
+ }
314
+
315
+ message RemoveAttachmentRequest {
316
+ string id = 1; // product id
317
+ string user_id = 2;
318
+ string attachment_id = 3;
319
+ }
320
+
321
+ // =================================================================
322
+ // Moderation
323
+ // =================================================================
324
+
325
+ message ProductModerationQueryRequest {
326
+ ModerationStatus status = 1;
327
+ int32 page = 2;
328
+ int32 limit = 3;
329
+ string sort_by = 4;
330
+ string sort_order = 5;
331
+ }
332
+
333
+ message ModerateProductRequest {
334
+ string product_id = 1;
335
+ string moderator_id = 2;
336
+ string action = 3; // 'approve' | 'reject'
337
+ string comment = 4;
338
+ }
339
+
340
+ message ModerationResponse {
341
+ bool success = 1;
342
+ string message = 2;
343
+ Product product = 3;
344
+ ModerationStatus moderation_status = 4;
345
+ string moderation_comment = 5;
346
+ string moderated_by = 6;
347
+ string moderated_at = 7;
348
+ }
349
+
350
+ message ResubmitProductRequest {
351
+ string product_id = 1;
352
+ string user_id = 2;
353
+ string comment = 3;
354
+ // Free-form payload of changes — serialized as JSON string to keep the
355
+ // legacy `any` shape without forcing a strict schema on a free-form patch.
356
+ string changes_json = 4;
357
+ }
358
+
359
+ // =================================================================
360
+ // Secure downloads
361
+ // =================================================================
362
+
363
+ message GetSecureDownloadLinksRequest {
364
+ string product_id = 1;
365
+ string user_id = 2;
366
+ int32 expires_in = 3;
367
+ }
368
+
369
+ message SecureDownloadLink {
370
+ string download_url = 1;
371
+ int32 expires_in = 2;
372
+ string file_name = 3;
373
+ double file_size = 4;
374
+ string attachment_id = 5;
375
+ }
376
+
377
+ message SecureDownloadLinksResponse {
378
+ repeated SecureDownloadLink links = 1;
379
+ }
380
+
381
+ message GetAttachmentDownloadInfoRequest {
382
+ string product_id = 1;
383
+ string attachment_id = 2;
384
+ string user_id = 3;
385
+ }
386
+
387
+ message AttachmentDownloadInfoResponse {
388
+ string file_name = 1;
389
+ double file_size = 2;
390
+ string content_type = 3;
391
+ }
392
+
393
+ message GetAttachmentDownloadUrlRequest {
394
+ string product_id = 1;
395
+ string attachment_id = 2;
396
+ string user_id = 3;
397
+ }
398
+
399
+ message AttachmentDownloadUrlResponse {
400
+ string download_url = 1;
401
+ int32 expires_in = 2;
402
+ string file_name = 3;
403
+ double file_size = 4;
404
+ }