@temboplus/afloat 0.2.0 → 0.2.1-beta.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.
@@ -1,6 +1,7 @@
1
1
  import { QueryBuilder } from "@/lib/query/index.js";
2
2
  import { PayoutStatus, PayoutApprovalStatus, PayoutFilters } from "./payout.dtos.js";
3
3
  import { Amount } from "@temboplus/frontend-core";
4
+ type PayoutUrlParams = Record<string, string | string[]>;
4
5
  /**
5
6
  * Represents an active filter with its label and value
6
7
  */
@@ -28,7 +29,7 @@ export declare class PayoutQuery extends QueryBuilder {
28
29
  /**
29
30
  * Create from URL search parameters (strings)
30
31
  */
31
- static fromUrlParams(params: Record<string, string>): PayoutQuery;
32
+ static fromUrlParams(params: PayoutUrlParams): PayoutQuery;
32
33
  /**
33
34
  * Create from URLSearchParams object
34
35
  */
@@ -40,14 +41,20 @@ export declare class PayoutQuery extends QueryBuilder {
40
41
  /**
41
42
  * Create from any supported input type
42
43
  */
43
- static from(input: QueryBuilder | PayoutFilters | Record<string, string> | URLSearchParams | null | undefined): PayoutQuery;
44
+ static from(input: QueryBuilder | PayoutFilters | PayoutUrlParams | URLSearchParams | null | undefined): PayoutQuery;
44
45
  /**
45
- * Type guard for string records
46
+ * Type guard for URL param records
46
47
  */
47
- private static isStringRecord;
48
+ private static isUrlParamsRecord;
49
+ private static searchParamsToRecord;
50
+ private static normalizeUrlParams;
51
+ private static toStringList;
48
52
  whereStatus(status: PayoutStatus): this;
53
+ whereStatusIn(statuses: PayoutStatus[]): this;
49
54
  whereApprovalStatus(approvalStatus: PayoutApprovalStatus): this;
55
+ whereApprovalStatusIn(approvalStatuses: PayoutApprovalStatus[]): this;
50
56
  whereChannel(channel: string): this;
57
+ whereChannelIn(channels: string[]): this;
51
58
  wherePending(): this;
52
59
  whereApproved(): this;
53
60
  whereRejected(): this;
@@ -56,7 +63,12 @@ export declare class PayoutQuery extends QueryBuilder {
56
63
  whereAmountBetween(min: Amount, max: Amount): this;
57
64
  wherePayee(payeeName: string): this;
58
65
  whereMsisdn(msisdn: string): this;
66
+ whereMsisdnIn(msisdns: string[]): this;
59
67
  whereProfileId(profileId: string): this;
68
+ whereCreatedById(createdById: string): this;
69
+ whereCreatedByIdIn(createdByIds: string[]): this;
70
+ whereActionedById(actionedById: string): this;
71
+ whereActionedByIdIn(actionedByIds: string[]): this;
60
72
  wherePartnerReference(partnerReference: string): this;
61
73
  whereSearch(searchTerm: string): this;
62
74
  whereCurrencyCode(currencyCode: string): this;
@@ -96,14 +108,46 @@ export declare class PayoutQuery extends QueryBuilder {
96
108
  * Create new instance with status filter
97
109
  */
98
110
  withStatus(status?: PayoutStatus): PayoutQuery;
111
+ /**
112
+ * Create new instance with status in filter
113
+ */
114
+ withStatusIn(statuses?: PayoutStatus[]): PayoutQuery;
99
115
  /**
100
116
  * Create new instance with approval status filter
101
117
  */
102
118
  withApprovalStatus(approvalStatus?: PayoutApprovalStatus): PayoutQuery;
119
+ /**
120
+ * Create new instance with approval status in filter
121
+ */
122
+ withApprovalStatusIn(approvalStatuses?: PayoutApprovalStatus[]): PayoutQuery;
103
123
  /**
104
124
  * Create new instance with channel filter
105
125
  */
106
126
  withChannel(channel?: string): PayoutQuery;
127
+ /**
128
+ * Create new instance with channel in filter
129
+ */
130
+ withChannelIn(channels?: string[]): PayoutQuery;
131
+ /**
132
+ * Create new instance with MSISDN in filter
133
+ */
134
+ withMsisdnIn(msisdns?: string[]): PayoutQuery;
135
+ /**
136
+ * Create new instance with creator ID filter
137
+ */
138
+ withCreatedById(createdById?: string): PayoutQuery;
139
+ /**
140
+ * Create new instance with creator ID in filter
141
+ */
142
+ withCreatedByIdIn(createdByIds?: string[]): PayoutQuery;
143
+ /**
144
+ * Create new instance with actioner ID filter
145
+ */
146
+ withActionedById(actionedById?: string): PayoutQuery;
147
+ /**
148
+ * Create new instance with actioner ID in filter
149
+ */
150
+ withActionedByIdIn(actionedByIds?: string[]): PayoutQuery;
107
151
  /**
108
152
  * Includes default relations for eager loading.
109
153
  * This ensures that related data (createdBy, actionedBy) is fetched automatically.
@@ -174,6 +218,9 @@ export declare class PayoutQuery extends QueryBuilder {
174
218
  * Extract primary sort order
175
219
  */
176
220
  private extractSortOrder;
221
+ private whereInValues;
222
+ private getValidStatuses;
223
+ private getValidApprovalStatuses;
177
224
  /**
178
225
  * Type guard for valid statuses
179
226
  */
@@ -183,3 +230,4 @@ export declare class PayoutQuery extends QueryBuilder {
183
230
  */
184
231
  private isValidApprovalStatus;
185
232
  }
233
+ export {};
@@ -40,7 +40,7 @@ export interface RejectPayoutInput {
40
40
  /**
41
41
  * Flexible query input type - supports the class, filters interface, URL params, etc.
42
42
  */
43
- export type PayoutQueryInput = PayoutQuery | PayoutFilters | Record<string, string> | URLSearchParams | null | undefined;
43
+ export type PayoutQueryInput = PayoutQuery | PayoutFilters | Record<string, string | string[]> | URLSearchParams | null | undefined;
44
44
  /**
45
45
  * Repository class for managing payout operations including creation, approval,
46
46
  * rejection, and retrieval of payouts.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@temboplus/afloat",
3
- "version": "0.2.0",
3
+ "version": "0.2.1-beta.0",
4
4
  "description": "A foundational library for Temboplus-Afloat projects.",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.esm.js",