@yuno-payments/dashboard-api-mfe 1.20.0 → 1.21.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.
Files changed (26) hide show
  1. package/build/cjs/index.js +4 -4
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/types/api/api.d.ts +13 -7
  4. package/build/cjs/types/msw/mocks/reconciliation-insights/index.d.ts +1 -0
  5. package/build/cjs/types/mutations/audit/audit-subscriptions.mutation.d.ts +41 -0
  6. package/build/cjs/types/mutations/audit/index.d.ts +1 -0
  7. package/build/cjs/types/mutations/fraud-screening/fraud-screening.mutation.d.ts +2 -0
  8. package/build/cjs/types/queries/audit/audit-subscriptions.query.d.ts +11 -0
  9. package/build/cjs/types/queries/audit/index.d.ts +1 -0
  10. package/build/cjs/types/queries/reconciliations/reconciliation-insights.query.d.ts +1 -0
  11. package/build/cjs/types/types/audit/audit.d.ts +25 -0
  12. package/build/cjs/types/types/reconciliation/reconciliation-insights.d.ts +50 -0
  13. package/build/esm/index.js +6 -6
  14. package/build/esm/index.js.map +1 -1
  15. package/build/esm/types/api/api.d.ts +13 -7
  16. package/build/esm/types/msw/mocks/reconciliation-insights/index.d.ts +1 -0
  17. package/build/esm/types/mutations/audit/audit-subscriptions.mutation.d.ts +41 -0
  18. package/build/esm/types/mutations/audit/index.d.ts +1 -0
  19. package/build/esm/types/mutations/fraud-screening/fraud-screening.mutation.d.ts +2 -0
  20. package/build/esm/types/queries/audit/audit-subscriptions.query.d.ts +11 -0
  21. package/build/esm/types/queries/audit/index.d.ts +1 -0
  22. package/build/esm/types/queries/reconciliations/reconciliation-insights.query.d.ts +1 -0
  23. package/build/esm/types/types/audit/audit.d.ts +25 -0
  24. package/build/esm/types/types/reconciliation/reconciliation-insights.d.ts +50 -0
  25. package/build/index.d.ts +140 -9
  26. package/package.json +1 -1
@@ -65,6 +65,7 @@ export declare class Api extends HttpClient {
65
65
  getReconciliationInsightsReconciliationRateByProvider<T>(body: ReconciliationInsights.BaseFiltersWithProvider): Promise<AxiosResponse<T>>;
66
66
  getReconciliationInsightsReconciliationRateByAccount<T>(body: ReconciliationInsights.BaseFiltersWithProvider): Promise<AxiosResponse<T>>;
67
67
  getReconciliationInsightsReconciliationRateByCurrency<T>(body: ReconciliationInsights.BaseFiltersWithProvider): Promise<AxiosResponse<T>>;
68
+ getReconciliationInsightsSettlementLookup<T>(body: ReconciliationInsights.SettlementLookupBody): Promise<AxiosResponse<T>>;
68
69
  postPaymentsLazy<T>(params: GetPaymentsParams): Promise<AxiosResponse<T, any>>;
69
70
  postPayouts<T>(params: GetPaymentsParams): Promise<AxiosResponse<T, any>>;
70
71
  getPayoutsFilters<T>(organizationCode: any): Promise<AxiosResponse<T>>;
@@ -184,6 +185,9 @@ export declare class Api extends HttpClient {
184
185
  postApiLogsStatsErrorsByEndpoint<T>(payload: Audit.ApiLogsStatsParams): Promise<AxiosResponse<T>>;
185
186
  postApiLogsList<T>(payload: Audit.ApiLogsListParams): Promise<AxiosResponse<T>>;
186
187
  getApiLogsV3ByPaymentCode<T>(paymentCode: string, createdAtFrom?: string): Promise<AxiosResponse<T>>;
188
+ createAuditSubscription<T>(payload: Audit.CreateAuditSubscriptionPayload): Promise<AxiosResponse<T>>;
189
+ listAuditSubscriptions<T>(params?: Audit.ListAuditSubscriptionsParams): Promise<AxiosResponse<T>>;
190
+ deleteAuditSubscription<T>(code: string): Promise<AxiosResponse<T>>;
187
191
  useGetCountriesConfig<T>(): Promise<AxiosResponse<T, any>>;
188
192
  useGetCountriesConfigV2<T>(acceptLanguage?: string): Promise<AxiosResponse<T, any>>;
189
193
  getSmartRoutingMethods<T>(accountCode: string, routingType?: SmartRouting.RoutingType): Promise<AxiosResponse<T, any>>;
@@ -520,14 +524,16 @@ export declare class Api extends HttpClient {
520
524
  putBlackListType<T>(payload: any): Promise<AxiosResponse<T, any>>;
521
525
  changeBlackListStatus<T>(payload: any): Promise<AxiosResponse<T, any>>;
522
526
  changeBlackListStatusItem<T>(payload: any): Promise<AxiosResponse<T, any>>;
523
- postBlackListItems<T>({ payload }: {
524
- payload: any;
527
+ postBlackListItems<T>({ payload, accountCode, }: {
528
+ payload: unknown;
529
+ accountCode?: string;
525
530
  }): Promise<AxiosResponse<T, any>>;
526
- postBlackListBatch<T>({ blacklist_code, expiration_days, file, handleSetProgress, }: {
527
- blacklist_code: any;
528
- expiration_days: any;
529
- file: any;
530
- handleSetProgress: any;
531
+ postBlackListBatch<T>({ blacklist_code, expiration_days, file, handleSetProgress, accountCode, }: {
532
+ blacklist_code: string;
533
+ expiration_days: number;
534
+ file: string;
535
+ handleSetProgress: (progress: number) => void;
536
+ accountCode?: string;
531
537
  }): Promise<AxiosResponse<T, any>>;
532
538
  deleteBlackListType<T>({ black_list_code, }: {
533
539
  black_list_code: any;
@@ -20,3 +20,4 @@ export declare const NOT_CONFIRM_SUMMARY_MOCK: ReconciliationInsights.GenericCha
20
20
  export declare const NOT_CONFIRM_AGGREGATORS_MOCK: ReconciliationInsights.Aggregators;
21
21
  export declare const NOT_CONFIRM_LIST_MOCK: ReconciliationInsights.ProcessedTransactionList;
22
22
  export declare const AMOUNT_TO_BE_SETTLED_SUMMARY_MOCK: ReconciliationInsights.ChartWithGraph;
23
+ export declare const SETTLEMENT_LOOKUP_MOCK: ReconciliationInsights.SettlementDetail;
@@ -0,0 +1,41 @@
1
+ import { UseMutationResult } from '@tanstack/react-query';
2
+ import { AxiosError } from 'axios';
3
+ import type { Audit } from '../../types';
4
+ import { BFFErrorResponse } from '../smart-routing';
5
+ /**
6
+ * Result of {@link useCreateAuditSubscription}'s `mutateAsync`.
7
+ *
8
+ * A `409 subscription_already_exists` response is treated as success
9
+ * (idempotent create) and resolves with `{ alreadyExists: true }` rather
10
+ * than rejecting — the caller treats an already-existing subscription as a
11
+ * successful no-op.
12
+ */
13
+ export type CreateAuditSubscriptionResult = {
14
+ alreadyExists: false;
15
+ subscription: Audit.AuditSubscription;
16
+ } | {
17
+ alreadyExists: true;
18
+ };
19
+ /**
20
+ * Creates an audit-log subscription.
21
+ *
22
+ * Hits `POST /dashboard-bff/api/audit-logs/subscriptions`. A `409`
23
+ * `subscription_already_exists` response RESOLVES successfully as
24
+ * `{ alreadyExists: true }` (idempotent create); a `201` resolves as
25
+ * `{ alreadyExists: false, subscription }`. Any other error rejects.
26
+ *
27
+ * On success (including the idempotent 409), the `['audit-subscriptions']`
28
+ * query key is invalidated.
29
+ */
30
+ export declare function useCreateAuditSubscription(): UseMutationResult<CreateAuditSubscriptionResult, AxiosError<BFFErrorResponse>, Audit.CreateAuditSubscriptionPayload>;
31
+ /**
32
+ * Deletes an audit-log subscription by its code.
33
+ *
34
+ * Hits `DELETE /dashboard-bff/api/audit-logs/subscriptions/{code}`. A `404`
35
+ * `subscription_not_found` response RESOLVES successfully (idempotent delete —
36
+ * the subscription is already gone). Any other error rejects.
37
+ *
38
+ * On success (including the idempotent 404), the `['audit-subscriptions']`
39
+ * query key is invalidated.
40
+ */
41
+ export declare function useDeleteAuditSubscription(): UseMutationResult<void, AxiosError<BFFErrorResponse>, string>;
@@ -1,2 +1,3 @@
1
1
  export * from './audit.mutation';
2
2
  export * from './audit-api.mutation';
3
+ export * from './audit-subscriptions.mutation';
@@ -18,11 +18,13 @@ export type PostBlackList = {
18
18
  };
19
19
  type PostBlackListItems = {
20
20
  payload: FraudScreening.BlackListItemsPayload;
21
+ accountCode?: string;
21
22
  };
22
23
  type PostBlackListBatch = {
23
24
  blacklist_code: string;
24
25
  expiration_days: number;
25
26
  file: string;
27
+ accountCode?: string;
26
28
  };
27
29
  export type ChangePaymentsWebhook = {
28
30
  paymentCode: string;
@@ -0,0 +1,11 @@
1
+ import { UseQueryResult } from '@tanstack/react-query';
2
+ import type { Audit } from '../../types';
3
+ import { BFFErrorResponse } from '../../mutations';
4
+ /**
5
+ * Lists audit-log subscriptions for the current organization.
6
+ *
7
+ * Hits `POST /dashboard-bff/api/audit-logs/subscriptions/list` with a JSON
8
+ * body of filter params and unwraps the `{ data: [...] }` envelope so
9
+ * consumers receive a flat `Audit.AuditSubscription[]`.
10
+ */
11
+ export declare function useListAuditSubscriptions(params?: Audit.ListAuditSubscriptionsParams): UseQueryResult<Audit.AuditSubscription[], BFFErrorResponse>;
@@ -1,2 +1,3 @@
1
1
  export * from './audit.query';
2
2
  export * from './audit-v3.query';
3
+ export * from './audit-subscriptions.query';
@@ -24,3 +24,4 @@ export declare function useGetReconciliationInsightsAmountToBeSettledSummary({ b
24
24
  export declare function useGetReconciliationInsightsReconciliationRateByProvider({ body, enabled, }: ReconciliationInsights.UseInsightsQueryProps<ReconciliationInsights.BaseFiltersWithProvider>): UseQueryResult<ReconciliationInsights.ReconciliationRateByProviderResponse, ReconciliationInsights.Error>;
25
25
  export declare function useGetReconciliationInsightsReconciliationRateByAccount({ body, enabled, }: ReconciliationInsights.UseInsightsQueryProps<ReconciliationInsights.BaseFiltersWithProvider>): UseQueryResult<ReconciliationInsights.ReconciliationRateItem[], ReconciliationInsights.Error>;
26
26
  export declare function useGetReconciliationInsightsReconciliationRateByCurrency({ body, enabled, }: ReconciliationInsights.UseInsightsQueryProps<ReconciliationInsights.BaseFiltersWithProvider>): UseQueryResult<ReconciliationInsights.ReconciliationRateItem[], ReconciliationInsights.Error>;
27
+ export declare function useGetReconciliationInsightsSettlementLookup({ body, enabled, }: ReconciliationInsights.UseInsightsQueryProps<ReconciliationInsights.SettlementLookupBody>): UseQueryResult<ReconciliationInsights.SettlementDetail, ReconciliationInsights.Error>;
@@ -459,4 +459,29 @@ export declare namespace Audit {
459
459
  total_pages: number;
460
460
  data: ApiLogV3Item[];
461
461
  }
462
+ interface AuditSubscription {
463
+ code: string;
464
+ user_code: string;
465
+ user_email: string;
466
+ organization_code: string;
467
+ account_code: string;
468
+ source: string;
469
+ event: string;
470
+ enabled: boolean;
471
+ created_at: string;
472
+ updated_at: string;
473
+ }
474
+ interface CreateAuditSubscriptionPayload {
475
+ account_code: string;
476
+ source: string;
477
+ event: string;
478
+ }
479
+ interface ListAuditSubscriptionsParams {
480
+ source?: string;
481
+ event?: string;
482
+ account_codes?: string[];
483
+ }
484
+ interface ListAuditSubscriptionsResponse {
485
+ data: AuditSubscription[];
486
+ }
462
487
  }
@@ -184,5 +184,55 @@ export declare namespace ReconciliationInsights {
184
184
  code?: string;
185
185
  message?: string;
186
186
  }
187
+ export type SettlementLookupKey = 'payment_id' | 'transaction_id' | 'provider_transaction_id' | 'third_party_transaction_id_transaction';
188
+ export interface SettlementLookupBody {
189
+ accounts?: string[];
190
+ key: SettlementLookupKey;
191
+ value: string;
192
+ }
193
+ export interface SettlementDetail {
194
+ primary_key: string;
195
+ organization_code: string;
196
+ account_id: string;
197
+ provider_merchant_id: string;
198
+ provider_id: string;
199
+ acquirer: string;
200
+ country: string;
201
+ payment_method_category: string;
202
+ payment_method_type: string;
203
+ settlement_batch_id: string;
204
+ payment_id: string;
205
+ transaction_id: string;
206
+ provider_transaction_id: string;
207
+ third_party_transaction_id_transaction: string;
208
+ merchant_order_id: string;
209
+ merchant_reference: string;
210
+ transaction_date: string;
211
+ settlement_date: string;
212
+ type: string;
213
+ reconciliation_status: string;
214
+ reconciliation_sub_status: string;
215
+ reconciliation_id: string;
216
+ amount: number;
217
+ gross_currency: string;
218
+ gross_credit: number;
219
+ gross_debit: number;
220
+ settlement_currency: string;
221
+ fx_rate: number;
222
+ settlement_gross_amount: number;
223
+ fee_rate: number;
224
+ settlement_fees: number;
225
+ settlement_fee_taxes: number;
226
+ settlement_taxes: number;
227
+ settlement_net_credit: number;
228
+ settlement_net_debit: number;
229
+ card_brand: string;
230
+ card_type: string;
231
+ card_iin: string;
232
+ card_lfd: string;
233
+ authorization_code: string;
234
+ installments: number;
235
+ installment_number: number;
236
+ }
187
237
  export {};
188
238
  }