@aepstore-dev/contracts 1.35.0 → 1.36.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.ts CHANGED
@@ -109,25 +109,66 @@ export interface WalletResponse {
109
109
 
110
110
  export interface ListTransactionsRequest {
111
111
  userId: string;
112
- /** optional filter (TOPUP|PURCHASE|SALE_CLEAR|WITHDRAWAL|REFUND|ADJUSTMENT) */
112
+ /**
113
+ * Legacy low-level filter (one of LedgerTxType). Kept for backward
114
+ * compatibility — admin tooling still uses it directly.
115
+ */
113
116
  type: string;
114
117
  page: number;
115
118
  limit: number;
119
+ /**
120
+ * ↓ added for the wallet statement page (Round 3)
121
+ * UI-semantic filter mapped onto displayKind:
122
+ * ALL | INCOME | OUTCOME | REFUND | WITHDRAWAL | PREMIUM
123
+ */
124
+ flow: string;
125
+ /**
126
+ * Period selection. `month` is the convenience form (YYYY-MM) used by the
127
+ * month dropdown; from/to override it for an arbitrary range.
128
+ */
129
+ month: string;
130
+ from: string;
131
+ to: string;
132
+ /**
133
+ * Filter wallet to purchases/refunds of a specific Product category. Has
134
+ * no effect on TOPUP/WITHDRAWAL/PREMIUM/ADJUSTMENT entries (they have no
135
+ * product).
136
+ */
137
+ productCategoryId: string;
138
+ /** sort_by ∈ { date | amount | type }. Default: date. */
139
+ sortBy: string;
140
+ /** order ∈ { asc | desc }. Default: desc. */
141
+ order: string;
116
142
  }
117
143
 
118
144
  export interface StatementEntry {
119
- /** ledger entry id */
120
145
  id: string;
121
146
  txId: string;
122
- /** tx type */
147
+ /** raw tx type (TOPUP|PURCHASE|...) */
123
148
  type: string;
124
- /** which of the user's accounts */
125
149
  accountKind: string;
126
150
  /** DEBIT | CREDIT */
127
151
  direction: string;
128
152
  amount: string;
129
153
  description: string;
130
154
  createdAt: string;
155
+ /**
156
+ * ↓ added for the wallet statement page (Round 3)
157
+ * UI-friendly classification computed server-side:
158
+ * TOPUP | PURCHASE | REFUND | PREMIUM | WITHDRAWAL | SALE_CLEAR | ADJUSTMENT
159
+ * PREMIUM is split out of PURCHASE/REFUND so the UI can show
160
+ * "Продление Premium" / refund-of-premium in their own filter bucket.
161
+ */
162
+ displayKind: string;
163
+ /** running USER_SPENDING-style balance, Decimal-as-string */
164
+ balanceAfter: string;
165
+ /** empty for non-product entries */
166
+ productId: string;
167
+ productName: string;
168
+ /** "Assets" | "Project File" | "Templates" */
169
+ productCategory: string;
170
+ /** optional thumbnail URL for richer rows */
171
+ productPreview: string;
131
172
  }
132
173
 
133
174
  export interface TransactionsListResponse {
@@ -137,6 +178,18 @@ export interface TransactionsListResponse {
137
178
  limit: number;
138
179
  }
139
180
 
181
+ export interface GetTransactionMonthsRequest {
182
+ userId: string;
183
+ }
184
+
185
+ export interface GetTransactionMonthsResponse {
186
+ /**
187
+ * Newest first. "YYYY-MM" strings; the dropdown renders them
188
+ * localized client-side.
189
+ */
190
+ months: string[];
191
+ }
192
+
140
193
  /**
141
194
  * ---------------------------------------------------------------------------
142
195
  * Withdrawals
@@ -522,6 +575,8 @@ export interface PaymentsServiceClient {
522
575
 
523
576
  listTransactions(request: ListTransactionsRequest): Observable<TransactionsListResponse>;
524
577
 
578
+ getTransactionMonths(request: GetTransactionMonthsRequest): Observable<GetTransactionMonthsResponse>;
579
+
525
580
  /** ----- withdrawals ----- */
526
581
 
527
582
  requestWithdrawal(request: RequestWithdrawalRequest): Observable<Withdrawal>;
@@ -616,6 +671,10 @@ export interface PaymentsServiceController {
616
671
  request: ListTransactionsRequest,
617
672
  ): Promise<TransactionsListResponse> | Observable<TransactionsListResponse> | TransactionsListResponse;
618
673
 
674
+ getTransactionMonths(
675
+ request: GetTransactionMonthsRequest,
676
+ ): Promise<GetTransactionMonthsResponse> | Observable<GetTransactionMonthsResponse> | GetTransactionMonthsResponse;
677
+
619
678
  /** ----- withdrawals ----- */
620
679
 
621
680
  requestWithdrawal(request: RequestWithdrawalRequest): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
@@ -715,6 +774,7 @@ export function PaymentsServiceControllerMethods() {
715
774
  "refundPurchase",
716
775
  "getWallet",
717
776
  "listTransactions",
777
+ "getTransactionMonths",
718
778
  "requestWithdrawal",
719
779
  "listWithdrawals",
720
780
  "processWithdrawal",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aepstore-dev/contracts",
3
- "version": "1.35.0",
3
+ "version": "1.36.0",
4
4
  "description": "Protobuf definitions for aepstore microservices",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -16,6 +16,7 @@ service PaymentsService {
16
16
  // ----- wallet -----
17
17
  rpc GetWallet(GetWalletRequest) returns (WalletResponse);
18
18
  rpc ListTransactions(ListTransactionsRequest) returns (TransactionsListResponse);
19
+ rpc GetTransactionMonths(GetTransactionMonthsRequest) returns (GetTransactionMonthsResponse);
19
20
 
20
21
  // ----- withdrawals -----
21
22
  rpc RequestWithdrawal(RequestWithdrawalRequest) returns (Withdrawal);
@@ -116,22 +117,59 @@ message WalletResponse {
116
117
 
117
118
  message ListTransactionsRequest {
118
119
  string user_id = 1;
119
- string type = 2; // optional filter (TOPUP|PURCHASE|SALE_CLEAR|WITHDRAWAL|REFUND|ADJUSTMENT)
120
+ // Legacy low-level filter (one of LedgerTxType). Kept for backward
121
+ // compatibility — admin tooling still uses it directly.
122
+ string type = 2;
120
123
  int32 page = 3;
121
124
  int32 limit = 4;
125
+ // ↓ added for the wallet statement page (Round 3)
126
+ // UI-semantic filter mapped onto displayKind:
127
+ // ALL | INCOME | OUTCOME | REFUND | WITHDRAWAL | PREMIUM
128
+ string flow = 5;
129
+ // Period selection. `month` is the convenience form (YYYY-MM) used by the
130
+ // month dropdown; from/to override it for an arbitrary range.
131
+ string month = 6;
132
+ string from = 7;
133
+ string to = 8;
134
+ // Filter wallet to purchases/refunds of a specific Product category. Has
135
+ // no effect on TOPUP/WITHDRAWAL/PREMIUM/ADJUSTMENT entries (they have no
136
+ // product).
137
+ string product_category_id = 9;
138
+ // sort_by ∈ { date | amount | type }. Default: date.
139
+ string sort_by = 10;
140
+ // order ∈ { asc | desc }. Default: desc.
141
+ string order = 11;
122
142
  }
123
143
  message StatementEntry {
124
- string id = 1; // ledger entry id
144
+ string id = 1;
125
145
  string tx_id = 2;
126
- string type = 3; // tx type
127
- string account_kind = 4; // which of the user's accounts
146
+ string type = 3; // raw tx type (TOPUP|PURCHASE|...)
147
+ string account_kind = 4;
128
148
  string direction = 5; // DEBIT | CREDIT
129
149
  string amount = 6;
130
150
  string description = 7;
131
151
  string created_at = 8;
152
+ // ↓ added for the wallet statement page (Round 3)
153
+ // UI-friendly classification computed server-side:
154
+ // TOPUP | PURCHASE | REFUND | PREMIUM | WITHDRAWAL | SALE_CLEAR | ADJUSTMENT
155
+ // PREMIUM is split out of PURCHASE/REFUND so the UI can show
156
+ // "Продление Premium" / refund-of-premium in their own filter bucket.
157
+ string display_kind = 9;
158
+ string balance_after = 10; // running USER_SPENDING-style balance, Decimal-as-string
159
+ string product_id = 11; // empty for non-product entries
160
+ string product_name = 12;
161
+ string product_category = 13; // "Assets" | "Project File" | "Templates"
162
+ string product_preview = 14; // optional thumbnail URL for richer rows
132
163
  }
133
164
  message TransactionsListResponse { repeated StatementEntry items = 1; int32 total = 2; int32 page = 3; int32 limit = 4; }
134
165
 
166
+ message GetTransactionMonthsRequest { string user_id = 1; }
167
+ message GetTransactionMonthsResponse {
168
+ // Newest first. "YYYY-MM" strings; the dropdown renders them
169
+ // localized client-side.
170
+ repeated string months = 1;
171
+ }
172
+
135
173
  // ---------------------------------------------------------------------------
136
174
  // Withdrawals
137
175
  // ---------------------------------------------------------------------------