@aepstore-dev/contracts 1.14.0 → 1.16.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/support.ts CHANGED
@@ -19,31 +19,192 @@ export interface PingResponse {
19
19
  message: string;
20
20
  }
21
21
 
22
+ export interface Ticket {
23
+ id: string;
24
+ authorId: string;
25
+ subject: string;
26
+ /** GENERAL|PAYMENT|WITHDRAWAL|PRODUCT|ACCOUNT|ABUSE|OTHER */
27
+ category: string;
28
+ /** OPEN|PENDING|IN_PROGRESS|RESOLVED|CLOSED */
29
+ status: string;
30
+ /** LOW|NORMAL|HIGH|URGENT */
31
+ priority: string;
32
+ purchaseId: string;
33
+ withdrawalId: string;
34
+ assigneeId: string;
35
+ lastMessageAt: string;
36
+ createdAt: string;
37
+ updatedAt: string;
38
+ messagesCount: number;
39
+ }
40
+
41
+ export interface TicketMessage {
42
+ id: string;
43
+ ticketId: string;
44
+ authorId: string;
45
+ body: string;
46
+ isStaff: boolean;
47
+ isInternal: boolean;
48
+ createdAt: string;
49
+ }
50
+
51
+ export interface TicketWithMessages {
52
+ ticket: Ticket | undefined;
53
+ messages: TicketMessage[];
54
+ }
55
+
56
+ export interface CreateTicketRequest {
57
+ authorId: string;
58
+ subject: string;
59
+ category: string;
60
+ /** first message */
61
+ body: string;
62
+ /** optional */
63
+ purchaseId: string;
64
+ /** optional */
65
+ withdrawalId: string;
66
+ }
67
+
68
+ export interface GetTicketRequest {
69
+ id: string;
70
+ requesterId: string;
71
+ /** staff see internal notes + any ticket */
72
+ isStaff: boolean;
73
+ }
74
+
75
+ export interface ListMyTicketsRequest {
76
+ authorId: string;
77
+ status: string;
78
+ page: number;
79
+ limit: number;
80
+ }
81
+
82
+ export interface ReplyTicketRequest {
83
+ ticketId: string;
84
+ authorId: string;
85
+ body: string;
86
+ isStaff: boolean;
87
+ /** staff-only note */
88
+ isInternal: boolean;
89
+ }
90
+
91
+ export interface CloseTicketRequest {
92
+ ticketId: string;
93
+ requesterId: string;
94
+ isStaff: boolean;
95
+ }
96
+
97
+ export interface ListTicketsRequest {
98
+ status: string;
99
+ category: string;
100
+ assigneeId: string;
101
+ page: number;
102
+ limit: number;
103
+ }
104
+
105
+ export interface AssignTicketRequest {
106
+ ticketId: string;
107
+ /** empty = unassign */
108
+ assigneeId: string;
109
+ adminId: string;
110
+ }
111
+
112
+ export interface SetTicketStatusRequest {
113
+ ticketId: string;
114
+ status: string;
115
+ adminId: string;
116
+ }
117
+
118
+ export interface TicketsListResponse {
119
+ items: Ticket[];
120
+ total: number;
121
+ page: number;
122
+ limit: number;
123
+ }
124
+
22
125
  export const SUPPORT_V1_PACKAGE_NAME = "support.v1";
23
126
 
24
127
  /**
25
- * Placeholder service. Legacy support-service was an empty stub; this keeps a
26
- * valid gRPC contract so the service boots and is ready to grow into a tickets
27
- * API later. Replace Ping with real RPCs when support functionality is built.
128
+ * Support ticket system (G1). Enums as strings matching the DB
129
+ * (status OPEN|PENDING|IN_PROGRESS|RESOLVED|CLOSED; category/priority).
28
130
  */
29
131
 
30
132
  export interface SupportServiceClient {
133
+ /** health */
134
+
31
135
  ping(request: PingRequest): Observable<PingResponse>;
136
+
137
+ /** user */
138
+
139
+ createTicket(request: CreateTicketRequest): Observable<Ticket>;
140
+
141
+ getTicket(request: GetTicketRequest): Observable<TicketWithMessages>;
142
+
143
+ listMyTickets(request: ListMyTicketsRequest): Observable<TicketsListResponse>;
144
+
145
+ replyTicket(request: ReplyTicketRequest): Observable<TicketMessage>;
146
+
147
+ closeTicket(request: CloseTicketRequest): Observable<Ticket>;
148
+
149
+ /** staff/admin */
150
+
151
+ listTickets(request: ListTicketsRequest): Observable<TicketsListResponse>;
152
+
153
+ assignTicket(request: AssignTicketRequest): Observable<Ticket>;
154
+
155
+ setTicketStatus(request: SetTicketStatusRequest): Observable<Ticket>;
32
156
  }
33
157
 
34
158
  /**
35
- * Placeholder service. Legacy support-service was an empty stub; this keeps a
36
- * valid gRPC contract so the service boots and is ready to grow into a tickets
37
- * API later. Replace Ping with real RPCs when support functionality is built.
159
+ * Support ticket system (G1). Enums as strings matching the DB
160
+ * (status OPEN|PENDING|IN_PROGRESS|RESOLVED|CLOSED; category/priority).
38
161
  */
39
162
 
40
163
  export interface SupportServiceController {
164
+ /** health */
165
+
41
166
  ping(request: PingRequest): Promise<PingResponse> | Observable<PingResponse> | PingResponse;
167
+
168
+ /** user */
169
+
170
+ createTicket(request: CreateTicketRequest): Promise<Ticket> | Observable<Ticket> | Ticket;
171
+
172
+ getTicket(
173
+ request: GetTicketRequest,
174
+ ): Promise<TicketWithMessages> | Observable<TicketWithMessages> | TicketWithMessages;
175
+
176
+ listMyTickets(
177
+ request: ListMyTicketsRequest,
178
+ ): Promise<TicketsListResponse> | Observable<TicketsListResponse> | TicketsListResponse;
179
+
180
+ replyTicket(request: ReplyTicketRequest): Promise<TicketMessage> | Observable<TicketMessage> | TicketMessage;
181
+
182
+ closeTicket(request: CloseTicketRequest): Promise<Ticket> | Observable<Ticket> | Ticket;
183
+
184
+ /** staff/admin */
185
+
186
+ listTickets(
187
+ request: ListTicketsRequest,
188
+ ): Promise<TicketsListResponse> | Observable<TicketsListResponse> | TicketsListResponse;
189
+
190
+ assignTicket(request: AssignTicketRequest): Promise<Ticket> | Observable<Ticket> | Ticket;
191
+
192
+ setTicketStatus(request: SetTicketStatusRequest): Promise<Ticket> | Observable<Ticket> | Ticket;
42
193
  }
43
194
 
44
195
  export function SupportServiceControllerMethods() {
45
196
  return function (constructor: Function) {
46
- const grpcMethods: string[] = ["ping"];
197
+ const grpcMethods: string[] = [
198
+ "ping",
199
+ "createTicket",
200
+ "getTicket",
201
+ "listMyTickets",
202
+ "replyTicket",
203
+ "closeTicket",
204
+ "listTickets",
205
+ "assignTicket",
206
+ "setTicketStatus",
207
+ ];
47
208
  for (const method of grpcMethods) {
48
209
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
49
210
  GrpcMethod("SupportService", method)(constructor.prototype[method], method, descriptor);
package/gen/users.ts CHANGED
@@ -30,6 +30,23 @@ export interface User {
30
30
  /** ISO 8601 */
31
31
  createdAt: string;
32
32
  updatedAt: string;
33
+ isBanned: boolean;
34
+ /** ISO 8601, empty = permanent/none */
35
+ bannedUntil: string;
36
+ banReason: string;
37
+ }
38
+
39
+ export interface BanUserRequest {
40
+ adminId: string;
41
+ userId: string;
42
+ reason: string;
43
+ /** ISO 8601; empty = permanent ban */
44
+ until: string;
45
+ }
46
+
47
+ export interface UnbanUserRequest {
48
+ adminId: string;
49
+ userId: string;
33
50
  }
34
51
 
35
52
  export interface Country {
@@ -239,6 +256,10 @@ export interface UsersServiceClient {
239
256
  createSubscription(request: SubscriptionRequest): Observable<SubscriptionResponse>;
240
257
 
241
258
  deleteSubscription(request: SubscriptionRequest): Observable<SubscriptionResponse>;
259
+
260
+ banUser(request: BanUserRequest): Observable<UserResponse>;
261
+
262
+ unbanUser(request: UnbanUserRequest): Observable<UserResponse>;
242
263
  }
243
264
 
244
265
  export interface UsersServiceController {
@@ -275,6 +296,10 @@ export interface UsersServiceController {
275
296
  deleteSubscription(
276
297
  request: SubscriptionRequest,
277
298
  ): Promise<SubscriptionResponse> | Observable<SubscriptionResponse> | SubscriptionResponse;
299
+
300
+ banUser(request: BanUserRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
301
+
302
+ unbanUser(request: UnbanUserRequest): Promise<UserResponse> | Observable<UserResponse> | UserResponse;
278
303
  }
279
304
 
280
305
  export function UsersServiceControllerMethods() {
@@ -290,6 +315,8 @@ export function UsersServiceControllerMethods() {
290
315
  "getUserFields",
291
316
  "createSubscription",
292
317
  "deleteSubscription",
318
+ "banUser",
319
+ "unbanUser",
293
320
  ];
294
321
  for (const method of grpcMethods) {
295
322
  const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aepstore-dev/contracts",
3
- "version": "1.14.0",
3
+ "version": "1.16.0",
4
4
  "description": "Protobuf definitions for aepstore microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -2,18 +2,117 @@ syntax = "proto3";
2
2
 
3
3
  package support.v1;
4
4
 
5
- // Placeholder service. Legacy support-service was an empty stub; this keeps a
6
- // valid gRPC contract so the service boots and is ready to grow into a tickets
7
- // API later. Replace Ping with real RPCs when support functionality is built.
5
+ // Support ticket system (G1). Enums as strings matching the DB
6
+ // (status OPEN|PENDING|IN_PROGRESS|RESOLVED|CLOSED; category/priority).
8
7
  service SupportService {
9
- rpc Ping(PingRequest) returns (PingResponse);
8
+ rpc Ping(PingRequest) returns (PingResponse); // health
9
+
10
+ // user
11
+ rpc CreateTicket(CreateTicketRequest) returns (Ticket);
12
+ rpc GetTicket(GetTicketRequest) returns (TicketWithMessages);
13
+ rpc ListMyTickets(ListMyTicketsRequest) returns (TicketsListResponse);
14
+ rpc ReplyTicket(ReplyTicketRequest) returns (TicketMessage);
15
+ rpc CloseTicket(CloseTicketRequest) returns (Ticket);
16
+
17
+ // staff/admin
18
+ rpc ListTickets(ListTicketsRequest) returns (TicketsListResponse);
19
+ rpc AssignTicket(AssignTicketRequest) returns (Ticket);
20
+ rpc SetTicketStatus(SetTicketStatusRequest) returns (Ticket);
21
+ }
22
+
23
+ message PingRequest { string message = 1; }
24
+ message PingResponse { bool ok = 1; string message = 2; }
25
+
26
+ message Ticket {
27
+ string id = 1;
28
+ string author_id = 2;
29
+ string subject = 3;
30
+ string category = 4; // GENERAL|PAYMENT|WITHDRAWAL|PRODUCT|ACCOUNT|ABUSE|OTHER
31
+ string status = 5; // OPEN|PENDING|IN_PROGRESS|RESOLVED|CLOSED
32
+ string priority = 6; // LOW|NORMAL|HIGH|URGENT
33
+ string purchase_id = 7;
34
+ string withdrawal_id = 8;
35
+ string assignee_id = 9;
36
+ string last_message_at = 10;
37
+ string created_at = 11;
38
+ string updated_at = 12;
39
+ int32 messages_count = 13;
40
+ }
41
+
42
+ message TicketMessage {
43
+ string id = 1;
44
+ string ticket_id = 2;
45
+ string author_id = 3;
46
+ string body = 4;
47
+ bool is_staff = 5;
48
+ bool is_internal = 6;
49
+ string created_at = 7;
50
+ }
51
+
52
+ message TicketWithMessages {
53
+ Ticket ticket = 1;
54
+ repeated TicketMessage messages = 2;
55
+ }
56
+
57
+ message CreateTicketRequest {
58
+ string author_id = 1;
59
+ string subject = 2;
60
+ string category = 3;
61
+ string body = 4; // first message
62
+ string purchase_id = 5; // optional
63
+ string withdrawal_id = 6; // optional
64
+ }
65
+
66
+ message GetTicketRequest {
67
+ string id = 1;
68
+ string requester_id = 2;
69
+ bool is_staff = 3; // staff see internal notes + any ticket
70
+ }
71
+
72
+ message ListMyTicketsRequest {
73
+ string author_id = 1;
74
+ string status = 2;
75
+ int32 page = 3;
76
+ int32 limit = 4;
77
+ }
78
+
79
+ message ReplyTicketRequest {
80
+ string ticket_id = 1;
81
+ string author_id = 2;
82
+ string body = 3;
83
+ bool is_staff = 4;
84
+ bool is_internal = 5; // staff-only note
85
+ }
86
+
87
+ message CloseTicketRequest {
88
+ string ticket_id = 1;
89
+ string requester_id = 2;
90
+ bool is_staff = 3;
91
+ }
92
+
93
+ message ListTicketsRequest {
94
+ string status = 1;
95
+ string category = 2;
96
+ string assignee_id = 3;
97
+ int32 page = 4;
98
+ int32 limit = 5;
99
+ }
100
+
101
+ message AssignTicketRequest {
102
+ string ticket_id = 1;
103
+ string assignee_id = 2; // empty = unassign
104
+ string admin_id = 3;
10
105
  }
11
106
 
12
- message PingRequest {
13
- string message = 1;
107
+ message SetTicketStatusRequest {
108
+ string ticket_id = 1;
109
+ string status = 2;
110
+ string admin_id = 3;
14
111
  }
15
112
 
16
- message PingResponse {
17
- bool ok = 1;
18
- string message = 2;
113
+ message TicketsListResponse {
114
+ repeated Ticket items = 1;
115
+ int32 total = 2;
116
+ int32 page = 3;
117
+ int32 limit = 4;
19
118
  }
package/proto/users.proto CHANGED
@@ -14,6 +14,9 @@ service UsersService {
14
14
 
15
15
  rpc CreateSubscription(SubscriptionRequest) returns (SubscriptionResponse);
16
16
  rpc DeleteSubscription(SubscriptionRequest) returns (SubscriptionResponse);
17
+
18
+ rpc BanUser(BanUserRequest) returns (UserResponse);
19
+ rpc UnbanUser(UnbanUserRequest) returns (UserResponse);
17
20
  }
18
21
 
19
22
  // =================================================================
@@ -29,6 +32,21 @@ message User {
29
32
  string role = 6; // primary role for backwards compat
30
33
  string created_at = 7; // ISO 8601
31
34
  string updated_at = 8;
35
+ bool is_banned = 9;
36
+ string banned_until = 10; // ISO 8601, empty = permanent/none
37
+ string ban_reason = 11;
38
+ }
39
+
40
+ message BanUserRequest {
41
+ string admin_id = 1;
42
+ string user_id = 2;
43
+ string reason = 3;
44
+ string until = 4; // ISO 8601; empty = permanent ban
45
+ }
46
+
47
+ message UnbanUserRequest {
48
+ string admin_id = 1;
49
+ string user_id = 2;
32
50
  }
33
51
 
34
52
  message Country {