@temboplus/afloat 0.2.0-beta.2 → 0.2.0-beta.3

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.
@@ -64,7 +64,12 @@ export declare class QueryBuilder {
64
64
  */
65
65
  countAs(expression: string, alias: string): this;
66
66
  /**
67
- * @returns an objection-find query
67
+ * Build the query into an objection-find compatible object.
68
+ *
69
+ * Pagination (rangeStart/rangeEnd) is only included if both `page` and `limit`
70
+ * have been explicitly set via `.paginate()` or in the constructor options.
71
+ *
72
+ * @returns An objection-find query object
68
73
  */
69
74
  build(): Record<string, any>;
70
75
  /**
@@ -111,6 +111,35 @@ export declare class PayoutQuery extends QueryBuilder {
111
111
  * Get human-readable filter descriptions
112
112
  */
113
113
  getActiveFilters(): string[];
114
+ /**
115
+ * Build the query into an objection-find compatible object for payout queries.
116
+ *
117
+ * The output object contains:
118
+ * - Filters: Field conditions like `status:eq`, `createdAt:gte`, `payeeName:likeLower`
119
+ * - Sorting: `orderBy` and/or `orderByDesc` with comma-separated fields
120
+ * - Pagination: `rangeStart` and `rangeEnd` (only if `.paginate()` was called)
121
+ * - Relations: `eager` for included relations via `.with()` or `.includeDefaultRelations()`
122
+ *
123
+ * @example
124
+ * ```ts
125
+ * // Paginated query
126
+ * const paged = PayoutQuery.create()
127
+ * .whereStatus(PayoutStatus.PAID)
128
+ * .paginate(1, 20)
129
+ * .build();
130
+ * // => { "status:eq": "PAID", rangeStart: 0, rangeEnd: 19 }
131
+ *
132
+ * // Unpaginated list (no rangeStart/rangeEnd)
133
+ * const all = PayoutQuery.create()
134
+ * .whereApproved()
135
+ * .orderByDesc("createdAt")
136
+ * .build();
137
+ * // => { "approvalStatus:eq": "APPROVED", orderByDesc: "createdAt" }
138
+ * ```
139
+ *
140
+ * @returns An objection-find query object
141
+ */
142
+ build(): Record<string, any>;
114
143
  /**
115
144
  * Extract filter values from QueryBuilder options
116
145
  */
@@ -88,6 +88,37 @@ export declare class WalletQuery extends QueryBuilder {
88
88
  * Get human-readable filter descriptions
89
89
  */
90
90
  getActiveFilters(): string[];
91
+ /**
92
+ * Build the query into an objection-find compatible object for wallet queries.
93
+ *
94
+ * The output object contains:
95
+ * - Filters: Field conditions like `id:eq`, `profileId:eq`, `accountName:likeLower`
96
+ * - Sorting: `orderBy` and/or `orderByDesc` with comma-separated fields
97
+ * - Pagination: `rangeStart` and `rangeEnd` (only if `.paginate()` was called)
98
+ *
99
+ * Since wallets are typically fetched as complete lists (not paginated),
100
+ * pagination is usually omitted.
101
+ *
102
+ * @example
103
+ * ```ts
104
+ * // Get all wallets for a profile (no pagination)
105
+ * const query = WalletQuery.create()
106
+ * .whereProfileId("prof_123")
107
+ * .whereCurrencyCode("TZS")
108
+ * .build();
109
+ * // => { "profileId:eq": "prof_123", "currencyCode:eq": "TZS" }
110
+ *
111
+ * // Paginated wallet list (if needed)
112
+ * const paged = WalletQuery.create()
113
+ * .whereChannel("MOBILE")
114
+ * .paginate(1, 10)
115
+ * .build();
116
+ * // => { "channel:eq": "MOBILE", rangeStart: 0, rangeEnd: 9 }
117
+ * ```
118
+ *
119
+ * @returns An objection-find query object
120
+ */
121
+ build(): Record<string, any>;
91
122
  /**
92
123
  * Extract filter values from QueryBuilder options
93
124
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temboplus/afloat",
3
- "version": "0.2.0-beta.2",
3
+ "version": "0.2.0-beta.3",
4
4
  "description": "A foundational library for Temboplus-Afloat projects.",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",