@aepstore-dev/contracts 1.38.0 → 1.39.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,83 @@ 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 | SALES | INCOME | OUTCOME | REFUND | WITHDRAWAL | PREMIUM
123
+ * SALES = the seller's earnings on this account (USER_PENDING credits from
124
+ * PURCHASE transactions); these stay separate from INCOME (TOPUP).
125
+ */
126
+ flow: string;
127
+ /**
128
+ * Period selection. `month` is the convenience form (YYYY-MM) used by the
129
+ * month dropdown; from/to override it for an arbitrary range.
130
+ */
131
+ month: string;
132
+ from: string;
133
+ to: string;
134
+ /**
135
+ * Filter wallet to purchases/refunds of a specific Product category. Has
136
+ * no effect on TOPUP/WITHDRAWAL/PREMIUM/ADJUSTMENT entries (they have no
137
+ * product).
138
+ */
139
+ productCategoryId: string;
140
+ /** sort_by ∈ { date | amount | type }. Default: date. */
141
+ sortBy: string;
142
+ /** order ∈ { asc | desc }. Default: desc. */
143
+ order: string;
116
144
  }
117
145
 
118
146
  export interface StatementEntry {
119
- /** ledger entry id */
120
147
  id: string;
121
148
  txId: string;
122
- /** tx type */
149
+ /** raw tx type (TOPUP|PURCHASE|...) */
123
150
  type: string;
124
- /** which of the user's accounts */
125
151
  accountKind: string;
126
152
  /** DEBIT | CREDIT */
127
153
  direction: string;
128
154
  amount: string;
129
155
  description: string;
130
156
  createdAt: string;
157
+ /**
158
+ * ↓ added for the wallet statement page (Round 3)
159
+ * UI-friendly classification computed server-side:
160
+ * TOPUP | PURCHASE | SALE | REFUND | PREMIUM | WITHDRAWAL | ADJUSTMENT
161
+ * SALE is the seller's view of someone else's PURCHASE (CREDIT to their
162
+ * USER_PENDING) — distinct from PURCHASE which is the buyer's DEBIT.
163
+ * PREMIUM is split out of PURCHASE/REFUND so the UI can show
164
+ * "Продление Premium" / refund-of-premium in their own filter bucket.
165
+ * SALE_CLEAR transactions are excluded from the wallet view — the maturity
166
+ * event is surfaced via sale_status on the original SALE row instead.
167
+ */
168
+ displayKind: string;
169
+ /** affected-account running balance, Decimal-as-string */
170
+ balanceAfter: string;
171
+ /** empty for non-product entries */
172
+ productId: string;
173
+ productName: string;
174
+ /** "Assets" | "Project File" | "Templates" */
175
+ productCategory: string;
176
+ /** optional thumbnail URL for richer rows */
177
+ productPreview: string;
178
+ /**
179
+ * Sale lifecycle. Populated only when display_kind=SALE.
180
+ * PENDING — held in USER_PENDING, not yet withdrawable.
181
+ * MATURED — SALE_CLEAR has fired; money is in USER_PAYOUT.
182
+ */
183
+ saleStatus: string;
184
+ /**
185
+ * ISO 8601 when the sale becomes withdrawable (sale_completed_at +
186
+ * GRACE_DAYS). Empty for non-sale rows.
187
+ */
188
+ maturesAt: string;
131
189
  }
132
190
 
133
191
  export interface TransactionsListResponse {
@@ -137,6 +195,18 @@ export interface TransactionsListResponse {
137
195
  limit: number;
138
196
  }
139
197
 
198
+ export interface GetTransactionMonthsRequest {
199
+ userId: string;
200
+ }
201
+
202
+ export interface GetTransactionMonthsResponse {
203
+ /**
204
+ * Newest first. "YYYY-MM" strings; the dropdown renders them
205
+ * localized client-side.
206
+ */
207
+ months: string[];
208
+ }
209
+
140
210
  /**
141
211
  * ---------------------------------------------------------------------------
142
212
  * Withdrawals
@@ -522,6 +592,8 @@ export interface PaymentsServiceClient {
522
592
 
523
593
  listTransactions(request: ListTransactionsRequest): Observable<TransactionsListResponse>;
524
594
 
595
+ getTransactionMonths(request: GetTransactionMonthsRequest): Observable<GetTransactionMonthsResponse>;
596
+
525
597
  /** ----- withdrawals ----- */
526
598
 
527
599
  requestWithdrawal(request: RequestWithdrawalRequest): Observable<Withdrawal>;
@@ -616,6 +688,10 @@ export interface PaymentsServiceController {
616
688
  request: ListTransactionsRequest,
617
689
  ): Promise<TransactionsListResponse> | Observable<TransactionsListResponse> | TransactionsListResponse;
618
690
 
691
+ getTransactionMonths(
692
+ request: GetTransactionMonthsRequest,
693
+ ): Promise<GetTransactionMonthsResponse> | Observable<GetTransactionMonthsResponse> | GetTransactionMonthsResponse;
694
+
619
695
  /** ----- withdrawals ----- */
620
696
 
621
697
  requestWithdrawal(request: RequestWithdrawalRequest): Promise<Withdrawal> | Observable<Withdrawal> | Withdrawal;
@@ -715,6 +791,7 @@ export function PaymentsServiceControllerMethods() {
715
791
  "refundPurchase",
716
792
  "getWallet",
717
793
  "listTransactions",
794
+ "getTransactionMonths",
718
795
  "requestWithdrawal",
719
796
  "listWithdrawals",
720
797
  "processWithdrawal",
package/gen/products.ts CHANGED
@@ -228,6 +228,8 @@ export interface QueryProductsRequest {
228
228
  sortOrder: string;
229
229
  status: ProductStatus;
230
230
  moderationStatus: ModerationStatus;
231
+ /** owner-only list filter; used by /products/my?status=deleted */
232
+ deletedOnly: boolean;
231
233
  }
232
234
 
233
235
  export interface FindMyRequest {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aepstore-dev/contracts",
3
- "version": "1.38.0",
3
+ "version": "1.39.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,72 @@ 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 | SALES | INCOME | OUTCOME | REFUND | WITHDRAWAL | PREMIUM
128
+ // SALES = the seller's earnings on this account (USER_PENDING credits from
129
+ // PURCHASE transactions); these stay separate from INCOME (TOPUP).
130
+ string flow = 5;
131
+ // Period selection. `month` is the convenience form (YYYY-MM) used by the
132
+ // month dropdown; from/to override it for an arbitrary range.
133
+ string month = 6;
134
+ string from = 7;
135
+ string to = 8;
136
+ // Filter wallet to purchases/refunds of a specific Product category. Has
137
+ // no effect on TOPUP/WITHDRAWAL/PREMIUM/ADJUSTMENT entries (they have no
138
+ // product).
139
+ string product_category_id = 9;
140
+ // sort_by ∈ { date | amount | type }. Default: date.
141
+ string sort_by = 10;
142
+ // order ∈ { asc | desc }. Default: desc.
143
+ string order = 11;
122
144
  }
123
145
  message StatementEntry {
124
- string id = 1; // ledger entry id
146
+ string id = 1;
125
147
  string tx_id = 2;
126
- string type = 3; // tx type
127
- string account_kind = 4; // which of the user's accounts
148
+ string type = 3; // raw tx type (TOPUP|PURCHASE|...)
149
+ string account_kind = 4;
128
150
  string direction = 5; // DEBIT | CREDIT
129
151
  string amount = 6;
130
152
  string description = 7;
131
153
  string created_at = 8;
154
+ // ↓ added for the wallet statement page (Round 3)
155
+ // UI-friendly classification computed server-side:
156
+ // TOPUP | PURCHASE | SALE | REFUND | PREMIUM | WITHDRAWAL | ADJUSTMENT
157
+ // SALE is the seller's view of someone else's PURCHASE (CREDIT to their
158
+ // USER_PENDING) — distinct from PURCHASE which is the buyer's DEBIT.
159
+ // PREMIUM is split out of PURCHASE/REFUND so the UI can show
160
+ // "Продление Premium" / refund-of-premium in their own filter bucket.
161
+ // SALE_CLEAR transactions are excluded from the wallet view — the maturity
162
+ // event is surfaced via sale_status on the original SALE row instead.
163
+ string display_kind = 9;
164
+ string balance_after = 10; // affected-account running balance, Decimal-as-string
165
+ string product_id = 11; // empty for non-product entries
166
+ string product_name = 12;
167
+ string product_category = 13; // "Assets" | "Project File" | "Templates"
168
+ string product_preview = 14; // optional thumbnail URL for richer rows
169
+ // Sale lifecycle. Populated only when display_kind=SALE.
170
+ // PENDING — held in USER_PENDING, not yet withdrawable.
171
+ // MATURED — SALE_CLEAR has fired; money is in USER_PAYOUT.
172
+ string sale_status = 15;
173
+ // ISO 8601 when the sale becomes withdrawable (sale_completed_at +
174
+ // GRACE_DAYS). Empty for non-sale rows.
175
+ string matures_at = 16;
132
176
  }
133
177
  message TransactionsListResponse { repeated StatementEntry items = 1; int32 total = 2; int32 page = 3; int32 limit = 4; }
134
178
 
179
+ message GetTransactionMonthsRequest { string user_id = 1; }
180
+ message GetTransactionMonthsResponse {
181
+ // Newest first. "YYYY-MM" strings; the dropdown renders them
182
+ // localized client-side.
183
+ repeated string months = 1;
184
+ }
185
+
135
186
  // ---------------------------------------------------------------------------
136
187
  // Withdrawals
137
188
  // ---------------------------------------------------------------------------
@@ -7,11 +7,11 @@ service ProductsService {
7
7
  rpc FindAll(QueryProductsRequest) returns (ProductsListResponse);
8
8
  rpc FindAllApproved(QueryProductsRequest) returns (ProductsListResponse);
9
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 Restore(RestoreProductRequest) returns (ProductResponse);
14
- rpc SubmitForModeration(SubmitForModerationRequest) returns (ProductResponse);
10
+ rpc FindOne(FindOneRequest) returns (ProductResponse);
11
+ rpc Update(UpdateProductRequest) returns (ProductResponse);
12
+ rpc Remove(RemoveProductRequest) returns (Ok);
13
+ rpc Restore(RestoreProductRequest) returns (ProductResponse);
14
+ rpc SubmitForModeration(SubmitForModerationRequest) returns (ProductResponse);
15
15
  rpc GetPriceRange(Empty) returns (PriceRangeResponse);
16
16
 
17
17
  rpc AddToFavorites(FavoriteRequest) returns (Ok);
@@ -236,11 +236,12 @@ message QueryProductsRequest {
236
236
  string max_price = 6;
237
237
  int32 page = 7;
238
238
  int32 limit = 8;
239
- string sort_by = 9; // createdAt | price | name | updatedAt | finalPrice
240
- string sort_order = 10; // asc | desc
241
- ProductStatus status = 11;
242
- ModerationStatus moderation_status = 12;
243
- }
239
+ string sort_by = 9; // createdAt | price | name | updatedAt | finalPrice
240
+ string sort_order = 10; // asc | desc
241
+ ProductStatus status = 11;
242
+ ModerationStatus moderation_status = 12;
243
+ bool deleted_only = 13; // owner-only list filter; used by /products/my?status=deleted
244
+ }
244
245
 
245
246
  message FindMyRequest {
246
247
  string user_id = 1;
@@ -253,20 +254,20 @@ message FindOneRequest {
253
254
  string viewer_key = 3; // dedup key for view counting (userId or hashed ip+ua)
254
255
  }
255
256
 
256
- message RemoveProductRequest {
257
- string id = 1;
258
- string user_id = 2;
259
- }
260
-
261
- message RestoreProductRequest {
262
- string id = 1;
263
- string user_id = 2;
264
- }
265
-
266
- message SubmitForModerationRequest {
267
- string id = 1;
268
- string user_id = 2;
269
- }
257
+ message RemoveProductRequest {
258
+ string id = 1;
259
+ string user_id = 2;
260
+ }
261
+
262
+ message RestoreProductRequest {
263
+ string id = 1;
264
+ string user_id = 2;
265
+ }
266
+
267
+ message SubmitForModerationRequest {
268
+ string id = 1;
269
+ string user_id = 2;
270
+ }
270
271
 
271
272
  message PriceRangeResponse {
272
273
  string min = 1; // Decimal as string