@aepstore-dev/contracts 1.59.0 → 1.61.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/payments.d.ts +25 -1
- package/gen/payments.js +3 -1
- package/gen/payments.ts +38 -2
- package/package.json +35 -35
- package/proto/activity.proto +200 -200
- package/proto/auth.proto +198 -198
- package/proto/mail.proto +54 -54
- package/proto/payments.proto +438 -423
- package/proto/products.proto +402 -402
- package/proto/support.proto +144 -144
- package/proto/taxonomy.proto +105 -105
- package/proto/upload.proto +171 -171
- package/proto/users.proto +690 -690
package/gen/payments.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface TopupRequest {
|
|
|
29
29
|
/** >= 10.00 */
|
|
30
30
|
amount: string;
|
|
31
31
|
returnUrl: string;
|
|
32
|
-
/** YOOKASSA | SAVED_CARD (default YOOKASSA) */
|
|
32
|
+
/** YOOKASSA | SAVED_CARD | CRYPTO (default YOOKASSA) */
|
|
33
33
|
paymentMethod: string;
|
|
34
34
|
/** required when payment_method=SAVED_CARD */
|
|
35
35
|
savedCardId: string;
|
|
@@ -271,6 +271,12 @@ export interface PaymentEventRequest {
|
|
|
271
271
|
event: string;
|
|
272
272
|
paymentId: string;
|
|
273
273
|
}
|
|
274
|
+
export interface ProviderCallbackRequest {
|
|
275
|
+
/** yookassa | heleket | … */
|
|
276
|
+
provider: string;
|
|
277
|
+
/** exact raw JSON body as received (signature input) */
|
|
278
|
+
rawBody: string;
|
|
279
|
+
}
|
|
274
280
|
/**
|
|
275
281
|
* ---------------------------------------------------------------------------
|
|
276
282
|
* Admin
|
|
@@ -490,6 +496,10 @@ export interface GetMyPremiumPaymentsRequest {
|
|
|
490
496
|
page: number;
|
|
491
497
|
limit: number;
|
|
492
498
|
}
|
|
499
|
+
export interface GetPremiumPaymentRequest {
|
|
500
|
+
userId: string;
|
|
501
|
+
paymentId: string;
|
|
502
|
+
}
|
|
493
503
|
export interface PremiumPaymentsListResponse {
|
|
494
504
|
items: PremiumPaymentRow[];
|
|
495
505
|
total: number;
|
|
@@ -576,6 +586,12 @@ export interface PaymentsServiceClient {
|
|
|
576
586
|
processWithdrawal(request: ProcessWithdrawalRequest): Observable<Withdrawal>;
|
|
577
587
|
/** ----- provider webhook (gateway forwards a verified event) ----- */
|
|
578
588
|
handlePaymentEvent(request: PaymentEventRequest): Observable<Ok>;
|
|
589
|
+
/**
|
|
590
|
+
* Generalized per-provider callback (POST /payments/webhook/:provider).
|
|
591
|
+
* Carries the EXACT raw JSON body: signed providers (Heleket) hash the
|
|
592
|
+
* byte-exact payload, so re-serializing a parsed body would break the sign.
|
|
593
|
+
*/
|
|
594
|
+
handleProviderCallback(request: ProviderCallbackRequest): Observable<Ok>;
|
|
579
595
|
/** ----- premium ----- */
|
|
580
596
|
getPremiumPlans(request: GetPremiumPlansRequest): Observable<PremiumPlansResponse>;
|
|
581
597
|
purchasePremium(request: PurchasePremiumRequest): Observable<PurchasePremiumResponse>;
|
|
@@ -586,6 +602,7 @@ export interface PaymentsServiceClient {
|
|
|
586
602
|
*/
|
|
587
603
|
refundPremium(request: RefundPremiumRequest): Observable<RefundPremiumResponse>;
|
|
588
604
|
getMyPremiumPayments(request: GetMyPremiumPaymentsRequest): Observable<PremiumPaymentsListResponse>;
|
|
605
|
+
getPremiumPayment(request: GetPremiumPaymentRequest): Observable<PremiumPaymentRow>;
|
|
589
606
|
/**
|
|
590
607
|
* Internal — InternalServiceGuard. tasks-service cron triggers due renewals;
|
|
591
608
|
* payments-service iterates ACTIVE subscriptions with autoRenew+savedCard.
|
|
@@ -639,6 +656,12 @@ export interface PaymentsServiceController {
|
|
|
639
656
|
processWithdrawal(request: ProcessWithdrawalRequest): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
|
|
640
657
|
/** ----- provider webhook (gateway forwards a verified event) ----- */
|
|
641
658
|
handlePaymentEvent(request: PaymentEventRequest): Promise<Ok> | Observable<Ok> | Ok;
|
|
659
|
+
/**
|
|
660
|
+
* Generalized per-provider callback (POST /payments/webhook/:provider).
|
|
661
|
+
* Carries the EXACT raw JSON body: signed providers (Heleket) hash the
|
|
662
|
+
* byte-exact payload, so re-serializing a parsed body would break the sign.
|
|
663
|
+
*/
|
|
664
|
+
handleProviderCallback(request: ProviderCallbackRequest): Promise<Ok> | Observable<Ok> | Ok;
|
|
642
665
|
/** ----- premium ----- */
|
|
643
666
|
getPremiumPlans(request: GetPremiumPlansRequest): Promise<PremiumPlansResponse> | Observable<PremiumPlansResponse> | PremiumPlansResponse;
|
|
644
667
|
purchasePremium(request: PurchasePremiumRequest): Promise<PurchasePremiumResponse> | Observable<PurchasePremiumResponse> | PurchasePremiumResponse;
|
|
@@ -649,6 +672,7 @@ export interface PaymentsServiceController {
|
|
|
649
672
|
*/
|
|
650
673
|
refundPremium(request: RefundPremiumRequest): Promise<RefundPremiumResponse> | Observable<RefundPremiumResponse> | RefundPremiumResponse;
|
|
651
674
|
getMyPremiumPayments(request: GetMyPremiumPaymentsRequest): Promise<PremiumPaymentsListResponse> | Observable<PremiumPaymentsListResponse> | PremiumPaymentsListResponse;
|
|
675
|
+
getPremiumPayment(request: GetPremiumPaymentRequest): Promise<PremiumPaymentRow> | Observable<PremiumPaymentRow> | PremiumPaymentRow;
|
|
652
676
|
/**
|
|
653
677
|
* Internal — InternalServiceGuard. tasks-service cron triggers due renewals;
|
|
654
678
|
* payments-service iterates ACTIVE subscriptions with autoRenew+savedCard.
|
package/gen/payments.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
3
3
|
// versions:
|
|
4
4
|
// protoc-gen-ts_proto v2.10.1
|
|
5
|
-
// protoc v7.35.
|
|
5
|
+
// protoc v7.35.0
|
|
6
6
|
// source: payments.proto
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
8
|
exports.PAYMENTS_SERVICE_NAME = exports.PAYMENTS_V1_PACKAGE_NAME = exports.protobufPackage = void 0;
|
|
@@ -26,11 +26,13 @@ function PaymentsServiceControllerMethods() {
|
|
|
26
26
|
"listWithdrawals",
|
|
27
27
|
"processWithdrawal",
|
|
28
28
|
"handlePaymentEvent",
|
|
29
|
+
"handleProviderCallback",
|
|
29
30
|
"getPremiumPlans",
|
|
30
31
|
"purchasePremium",
|
|
31
32
|
"setPremiumPaymentMethod",
|
|
32
33
|
"refundPremium",
|
|
33
34
|
"getMyPremiumPayments",
|
|
35
|
+
"getPremiumPayment",
|
|
34
36
|
"runPremiumRenewals",
|
|
35
37
|
"listSavedCards",
|
|
36
38
|
"deleteSavedCard",
|
package/gen/payments.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
2
|
// versions:
|
|
3
3
|
// protoc-gen-ts_proto v2.10.1
|
|
4
|
-
// protoc v7.35.
|
|
4
|
+
// protoc v7.35.0
|
|
5
5
|
// source: payments.proto
|
|
6
6
|
|
|
7
7
|
/* eslint-disable */
|
|
@@ -41,7 +41,7 @@ export interface TopupRequest {
|
|
|
41
41
|
/** >= 10.00 */
|
|
42
42
|
amount: string;
|
|
43
43
|
returnUrl: string;
|
|
44
|
-
/** YOOKASSA | SAVED_CARD (default YOOKASSA) */
|
|
44
|
+
/** YOOKASSA | SAVED_CARD | CRYPTO (default YOOKASSA) */
|
|
45
45
|
paymentMethod: string;
|
|
46
46
|
/** required when payment_method=SAVED_CARD */
|
|
47
47
|
savedCardId: string;
|
|
@@ -306,6 +306,13 @@ export interface PaymentEventRequest {
|
|
|
306
306
|
paymentId: string;
|
|
307
307
|
}
|
|
308
308
|
|
|
309
|
+
export interface ProviderCallbackRequest {
|
|
310
|
+
/** yookassa | heleket | … */
|
|
311
|
+
provider: string;
|
|
312
|
+
/** exact raw JSON body as received (signature input) */
|
|
313
|
+
rawBody: string;
|
|
314
|
+
}
|
|
315
|
+
|
|
309
316
|
/**
|
|
310
317
|
* ---------------------------------------------------------------------------
|
|
311
318
|
* Admin
|
|
@@ -554,6 +561,11 @@ export interface GetMyPremiumPaymentsRequest {
|
|
|
554
561
|
limit: number;
|
|
555
562
|
}
|
|
556
563
|
|
|
564
|
+
export interface GetPremiumPaymentRequest {
|
|
565
|
+
userId: string;
|
|
566
|
+
paymentId: string;
|
|
567
|
+
}
|
|
568
|
+
|
|
557
569
|
export interface PremiumPaymentsListResponse {
|
|
558
570
|
items: PremiumPaymentRow[];
|
|
559
571
|
total: number;
|
|
@@ -668,6 +680,14 @@ export interface PaymentsServiceClient {
|
|
|
668
680
|
|
|
669
681
|
handlePaymentEvent(request: PaymentEventRequest): Observable<Ok>;
|
|
670
682
|
|
|
683
|
+
/**
|
|
684
|
+
* Generalized per-provider callback (POST /payments/webhook/:provider).
|
|
685
|
+
* Carries the EXACT raw JSON body: signed providers (Heleket) hash the
|
|
686
|
+
* byte-exact payload, so re-serializing a parsed body would break the sign.
|
|
687
|
+
*/
|
|
688
|
+
|
|
689
|
+
handleProviderCallback(request: ProviderCallbackRequest): Observable<Ok>;
|
|
690
|
+
|
|
671
691
|
/** ----- premium ----- */
|
|
672
692
|
|
|
673
693
|
getPremiumPlans(request: GetPremiumPlansRequest): Observable<PremiumPlansResponse>;
|
|
@@ -685,6 +705,8 @@ export interface PaymentsServiceClient {
|
|
|
685
705
|
|
|
686
706
|
getMyPremiumPayments(request: GetMyPremiumPaymentsRequest): Observable<PremiumPaymentsListResponse>;
|
|
687
707
|
|
|
708
|
+
getPremiumPayment(request: GetPremiumPaymentRequest): Observable<PremiumPaymentRow>;
|
|
709
|
+
|
|
688
710
|
/**
|
|
689
711
|
* Internal — InternalServiceGuard. tasks-service cron triggers due renewals;
|
|
690
712
|
* payments-service iterates ACTIVE subscriptions with autoRenew+savedCard.
|
|
@@ -785,6 +807,14 @@ export interface PaymentsServiceController {
|
|
|
785
807
|
|
|
786
808
|
handlePaymentEvent(request: PaymentEventRequest): Promise<Ok> | Observable<Ok> | Ok;
|
|
787
809
|
|
|
810
|
+
/**
|
|
811
|
+
* Generalized per-provider callback (POST /payments/webhook/:provider).
|
|
812
|
+
* Carries the EXACT raw JSON body: signed providers (Heleket) hash the
|
|
813
|
+
* byte-exact payload, so re-serializing a parsed body would break the sign.
|
|
814
|
+
*/
|
|
815
|
+
|
|
816
|
+
handleProviderCallback(request: ProviderCallbackRequest): Promise<Ok> | Observable<Ok> | Ok;
|
|
817
|
+
|
|
788
818
|
/** ----- premium ----- */
|
|
789
819
|
|
|
790
820
|
getPremiumPlans(
|
|
@@ -812,6 +842,10 @@ export interface PaymentsServiceController {
|
|
|
812
842
|
request: GetMyPremiumPaymentsRequest,
|
|
813
843
|
): Promise<PremiumPaymentsListResponse> | Observable<PremiumPaymentsListResponse> | PremiumPaymentsListResponse;
|
|
814
844
|
|
|
845
|
+
getPremiumPayment(
|
|
846
|
+
request: GetPremiumPaymentRequest,
|
|
847
|
+
): Promise<PremiumPaymentRow> | Observable<PremiumPaymentRow> | PremiumPaymentRow;
|
|
848
|
+
|
|
815
849
|
/**
|
|
816
850
|
* Internal — InternalServiceGuard. tasks-service cron triggers due renewals;
|
|
817
851
|
* payments-service iterates ACTIVE subscriptions with autoRenew+savedCard.
|
|
@@ -896,11 +930,13 @@ export function PaymentsServiceControllerMethods() {
|
|
|
896
930
|
"listWithdrawals",
|
|
897
931
|
"processWithdrawal",
|
|
898
932
|
"handlePaymentEvent",
|
|
933
|
+
"handleProviderCallback",
|
|
899
934
|
"getPremiumPlans",
|
|
900
935
|
"purchasePremium",
|
|
901
936
|
"setPremiumPaymentMethod",
|
|
902
937
|
"refundPremium",
|
|
903
938
|
"getMyPremiumPayments",
|
|
939
|
+
"getPremiumPayment",
|
|
904
940
|
"runPremiumRenewals",
|
|
905
941
|
"listSavedCards",
|
|
906
942
|
"deleteSavedCard",
|
package/package.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@aepstore-dev/contracts",
|
|
3
|
-
"version": "1.
|
|
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 && tsc -p tsconfig.gen.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.61.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 && tsc -p tsconfig.gen.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
|
+
}
|
package/proto/activity.proto
CHANGED
|
@@ -1,200 +1,200 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package activity.v1;
|
|
4
|
-
|
|
5
|
-
service ActivityService {
|
|
6
|
-
// Reports
|
|
7
|
-
rpc ReportCreate(CreateReportRequest) returns (ReportResponse);
|
|
8
|
-
rpc ReportList(ListReportsRequest) returns (ReportsListResponse);
|
|
9
|
-
rpc ReportGet(ReportIdRequest) returns (ReportResponse);
|
|
10
|
-
rpc ReportModerate(ModerateReportRequest) returns (ReportResponse);
|
|
11
|
-
|
|
12
|
-
// Report categories
|
|
13
|
-
rpc ReportCategoryCreate(CreateReportCategoryRequest) returns (ReportCategoryResponse);
|
|
14
|
-
rpc ReportCategoryList(ListReportCategoriesRequest) returns (ReportCategoriesListResponse);
|
|
15
|
-
rpc ReportCategoryGet(ReportCategoryIdRequest) returns (ReportCategoryResponse);
|
|
16
|
-
rpc ReportCategoryUpdate(UpdateReportCategoryRequest) returns (ReportCategoryResponse);
|
|
17
|
-
rpc ReportCategoryDelete(ReportCategoryIdRequest) returns (Ok);
|
|
18
|
-
|
|
19
|
-
// Reviews
|
|
20
|
-
rpc ReviewCreate(CreateReviewRequest) returns (ReviewResponse);
|
|
21
|
-
rpc GetProductReviews(GetProductReviewsRequest) returns (ReviewsListResponse);
|
|
22
|
-
|
|
23
|
-
// NOTE: subscriptions live in users-service (CreateSubscription/DeleteSubscription).
|
|
24
|
-
// The former activity.ToggleSubscription was a duplicate write path — removed.
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// =================================================================
|
|
28
|
-
// Enums
|
|
29
|
-
// =================================================================
|
|
30
|
-
|
|
31
|
-
// Member names match the DB enum string values exactly (enums: String on the
|
|
32
|
-
// wire), so DB values pass straight through with no mapping. UNSPECIFIED=0
|
|
33
|
-
// represents "no value / not provided" (e.g. an optional list filter).
|
|
34
|
-
enum ReportType {
|
|
35
|
-
REPORT_TYPE_UNSPECIFIED = 0;
|
|
36
|
-
PRODUCT = 1;
|
|
37
|
-
PROFILE = 2;
|
|
38
|
-
REVIEW = 3;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
enum ReportStatus {
|
|
42
|
-
REPORT_STATUS_UNSPECIFIED = 0;
|
|
43
|
-
PENDING = 1;
|
|
44
|
-
IN_PROGRESS = 2;
|
|
45
|
-
RESOLVED = 3;
|
|
46
|
-
DISMISSED = 4;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// =================================================================
|
|
50
|
-
// Reports
|
|
51
|
-
// =================================================================
|
|
52
|
-
|
|
53
|
-
message Report {
|
|
54
|
-
string id = 1;
|
|
55
|
-
ReportType type = 2;
|
|
56
|
-
string object_id = 3;
|
|
57
|
-
string user_id = 4;
|
|
58
|
-
string product_id = 5;
|
|
59
|
-
repeated ReportCategory categories = 6;
|
|
60
|
-
string message = 7;
|
|
61
|
-
ReportStatus status = 8;
|
|
62
|
-
string created_at = 9;
|
|
63
|
-
string updated_at = 10;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
message ReportResponse {
|
|
67
|
-
Report report = 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
message CreateReportRequest {
|
|
71
|
-
string user_id = 1;
|
|
72
|
-
ReportType type = 2;
|
|
73
|
-
string object_id = 3;
|
|
74
|
-
repeated string categories = 4; // names
|
|
75
|
-
string message = 5;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
message ListReportsRequest {
|
|
79
|
-
ReportType type = 1;
|
|
80
|
-
ReportStatus status = 2;
|
|
81
|
-
string user_id = 3;
|
|
82
|
-
string object_id = 4;
|
|
83
|
-
int32 page = 5;
|
|
84
|
-
int32 limit = 6;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
message ReportsListResponse {
|
|
88
|
-
repeated Report items = 1;
|
|
89
|
-
int32 total = 2;
|
|
90
|
-
int32 page = 3;
|
|
91
|
-
int32 limit = 4;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
message ReportIdRequest {
|
|
95
|
-
string id = 1;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
message ModerateReportRequest {
|
|
99
|
-
string id = 1;
|
|
100
|
-
string action = 2; // 'accept' | 'reject'
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// =================================================================
|
|
104
|
-
// Report categories
|
|
105
|
-
// =================================================================
|
|
106
|
-
|
|
107
|
-
message ReportCategory {
|
|
108
|
-
string id = 1;
|
|
109
|
-
string name = 2;
|
|
110
|
-
ReportType type = 3;
|
|
111
|
-
string icon = 4;
|
|
112
|
-
string description = 5;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
message ReportCategoryResponse {
|
|
116
|
-
ReportCategory category = 1;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
message CreateReportCategoryRequest {
|
|
120
|
-
string name = 1;
|
|
121
|
-
ReportType type = 2;
|
|
122
|
-
string icon = 3;
|
|
123
|
-
string description = 4;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
message UpdateReportCategoryRequest {
|
|
127
|
-
string id = 1;
|
|
128
|
-
string name = 2;
|
|
129
|
-
string icon = 3;
|
|
130
|
-
string description = 4;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
message ListReportCategoriesRequest {
|
|
134
|
-
ReportType type = 1;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
message ReportCategoriesListResponse {
|
|
138
|
-
repeated ReportCategory items = 1;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
message ReportCategoryIdRequest {
|
|
142
|
-
string id = 1;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
// =================================================================
|
|
146
|
-
// Reviews
|
|
147
|
-
// =================================================================
|
|
148
|
-
|
|
149
|
-
message ReviewUser {
|
|
150
|
-
string id = 1;
|
|
151
|
-
string username = 2;
|
|
152
|
-
string avatar_url = 3;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
message Review {
|
|
156
|
-
reserved 4, 8, 9; // retired flat user_id / user_username / user_avatar_url
|
|
157
|
-
string id = 1;
|
|
158
|
-
int32 rating = 2;
|
|
159
|
-
string text = 3;
|
|
160
|
-
string product_id = 5;
|
|
161
|
-
string created_at = 6;
|
|
162
|
-
string updated_at = 7;
|
|
163
|
-
ReviewUser user = 10;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
message ReviewResponse {
|
|
167
|
-
Review review = 1;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
message CreateReviewRequest {
|
|
171
|
-
string user_id = 1;
|
|
172
|
-
string product_id = 2;
|
|
173
|
-
int32 rating = 3;
|
|
174
|
-
string text = 4;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
message GetProductReviewsRequest {
|
|
178
|
-
string product_id = 1;
|
|
179
|
-
int32 page = 2;
|
|
180
|
-
int32 limit = 3;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
message ReviewsListResponse {
|
|
184
|
-
repeated Review items = 1;
|
|
185
|
-
int32 total = 2;
|
|
186
|
-
int32 page = 3;
|
|
187
|
-
int32 limit = 4;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
// =================================================================
|
|
191
|
-
// Subscriptions
|
|
192
|
-
// =================================================================
|
|
193
|
-
|
|
194
|
-
// =================================================================
|
|
195
|
-
// Misc
|
|
196
|
-
// =================================================================
|
|
197
|
-
|
|
198
|
-
message Ok {
|
|
199
|
-
bool ok = 1;
|
|
200
|
-
}
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package activity.v1;
|
|
4
|
+
|
|
5
|
+
service ActivityService {
|
|
6
|
+
// Reports
|
|
7
|
+
rpc ReportCreate(CreateReportRequest) returns (ReportResponse);
|
|
8
|
+
rpc ReportList(ListReportsRequest) returns (ReportsListResponse);
|
|
9
|
+
rpc ReportGet(ReportIdRequest) returns (ReportResponse);
|
|
10
|
+
rpc ReportModerate(ModerateReportRequest) returns (ReportResponse);
|
|
11
|
+
|
|
12
|
+
// Report categories
|
|
13
|
+
rpc ReportCategoryCreate(CreateReportCategoryRequest) returns (ReportCategoryResponse);
|
|
14
|
+
rpc ReportCategoryList(ListReportCategoriesRequest) returns (ReportCategoriesListResponse);
|
|
15
|
+
rpc ReportCategoryGet(ReportCategoryIdRequest) returns (ReportCategoryResponse);
|
|
16
|
+
rpc ReportCategoryUpdate(UpdateReportCategoryRequest) returns (ReportCategoryResponse);
|
|
17
|
+
rpc ReportCategoryDelete(ReportCategoryIdRequest) returns (Ok);
|
|
18
|
+
|
|
19
|
+
// Reviews
|
|
20
|
+
rpc ReviewCreate(CreateReviewRequest) returns (ReviewResponse);
|
|
21
|
+
rpc GetProductReviews(GetProductReviewsRequest) returns (ReviewsListResponse);
|
|
22
|
+
|
|
23
|
+
// NOTE: subscriptions live in users-service (CreateSubscription/DeleteSubscription).
|
|
24
|
+
// The former activity.ToggleSubscription was a duplicate write path — removed.
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// =================================================================
|
|
28
|
+
// Enums
|
|
29
|
+
// =================================================================
|
|
30
|
+
|
|
31
|
+
// Member names match the DB enum string values exactly (enums: String on the
|
|
32
|
+
// wire), so DB values pass straight through with no mapping. UNSPECIFIED=0
|
|
33
|
+
// represents "no value / not provided" (e.g. an optional list filter).
|
|
34
|
+
enum ReportType {
|
|
35
|
+
REPORT_TYPE_UNSPECIFIED = 0;
|
|
36
|
+
PRODUCT = 1;
|
|
37
|
+
PROFILE = 2;
|
|
38
|
+
REVIEW = 3;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
enum ReportStatus {
|
|
42
|
+
REPORT_STATUS_UNSPECIFIED = 0;
|
|
43
|
+
PENDING = 1;
|
|
44
|
+
IN_PROGRESS = 2;
|
|
45
|
+
RESOLVED = 3;
|
|
46
|
+
DISMISSED = 4;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// =================================================================
|
|
50
|
+
// Reports
|
|
51
|
+
// =================================================================
|
|
52
|
+
|
|
53
|
+
message Report {
|
|
54
|
+
string id = 1;
|
|
55
|
+
ReportType type = 2;
|
|
56
|
+
string object_id = 3;
|
|
57
|
+
string user_id = 4;
|
|
58
|
+
string product_id = 5;
|
|
59
|
+
repeated ReportCategory categories = 6;
|
|
60
|
+
string message = 7;
|
|
61
|
+
ReportStatus status = 8;
|
|
62
|
+
string created_at = 9;
|
|
63
|
+
string updated_at = 10;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
message ReportResponse {
|
|
67
|
+
Report report = 1;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
message CreateReportRequest {
|
|
71
|
+
string user_id = 1;
|
|
72
|
+
ReportType type = 2;
|
|
73
|
+
string object_id = 3;
|
|
74
|
+
repeated string categories = 4; // names
|
|
75
|
+
string message = 5;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
message ListReportsRequest {
|
|
79
|
+
ReportType type = 1;
|
|
80
|
+
ReportStatus status = 2;
|
|
81
|
+
string user_id = 3;
|
|
82
|
+
string object_id = 4;
|
|
83
|
+
int32 page = 5;
|
|
84
|
+
int32 limit = 6;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message ReportsListResponse {
|
|
88
|
+
repeated Report items = 1;
|
|
89
|
+
int32 total = 2;
|
|
90
|
+
int32 page = 3;
|
|
91
|
+
int32 limit = 4;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
message ReportIdRequest {
|
|
95
|
+
string id = 1;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
message ModerateReportRequest {
|
|
99
|
+
string id = 1;
|
|
100
|
+
string action = 2; // 'accept' | 'reject'
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// =================================================================
|
|
104
|
+
// Report categories
|
|
105
|
+
// =================================================================
|
|
106
|
+
|
|
107
|
+
message ReportCategory {
|
|
108
|
+
string id = 1;
|
|
109
|
+
string name = 2;
|
|
110
|
+
ReportType type = 3;
|
|
111
|
+
string icon = 4;
|
|
112
|
+
string description = 5;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
message ReportCategoryResponse {
|
|
116
|
+
ReportCategory category = 1;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
message CreateReportCategoryRequest {
|
|
120
|
+
string name = 1;
|
|
121
|
+
ReportType type = 2;
|
|
122
|
+
string icon = 3;
|
|
123
|
+
string description = 4;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
message UpdateReportCategoryRequest {
|
|
127
|
+
string id = 1;
|
|
128
|
+
string name = 2;
|
|
129
|
+
string icon = 3;
|
|
130
|
+
string description = 4;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
message ListReportCategoriesRequest {
|
|
134
|
+
ReportType type = 1;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
message ReportCategoriesListResponse {
|
|
138
|
+
repeated ReportCategory items = 1;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
message ReportCategoryIdRequest {
|
|
142
|
+
string id = 1;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// =================================================================
|
|
146
|
+
// Reviews
|
|
147
|
+
// =================================================================
|
|
148
|
+
|
|
149
|
+
message ReviewUser {
|
|
150
|
+
string id = 1;
|
|
151
|
+
string username = 2;
|
|
152
|
+
string avatar_url = 3;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
message Review {
|
|
156
|
+
reserved 4, 8, 9; // retired flat user_id / user_username / user_avatar_url
|
|
157
|
+
string id = 1;
|
|
158
|
+
int32 rating = 2;
|
|
159
|
+
string text = 3;
|
|
160
|
+
string product_id = 5;
|
|
161
|
+
string created_at = 6;
|
|
162
|
+
string updated_at = 7;
|
|
163
|
+
ReviewUser user = 10;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
message ReviewResponse {
|
|
167
|
+
Review review = 1;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
message CreateReviewRequest {
|
|
171
|
+
string user_id = 1;
|
|
172
|
+
string product_id = 2;
|
|
173
|
+
int32 rating = 3;
|
|
174
|
+
string text = 4;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
message GetProductReviewsRequest {
|
|
178
|
+
string product_id = 1;
|
|
179
|
+
int32 page = 2;
|
|
180
|
+
int32 limit = 3;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
message ReviewsListResponse {
|
|
184
|
+
repeated Review items = 1;
|
|
185
|
+
int32 total = 2;
|
|
186
|
+
int32 page = 3;
|
|
187
|
+
int32 limit = 4;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// =================================================================
|
|
191
|
+
// Subscriptions
|
|
192
|
+
// =================================================================
|
|
193
|
+
|
|
194
|
+
// =================================================================
|
|
195
|
+
// Misc
|
|
196
|
+
// =================================================================
|
|
197
|
+
|
|
198
|
+
message Ok {
|
|
199
|
+
bool ok = 1;
|
|
200
|
+
}
|