gotrip-fx-transaction-form 1.0.194 → 1.0.195

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/index.js CHANGED
@@ -29852,6 +29852,7 @@ const Ae = {
29852
29852
  create: `${Ae.API_URL}/transaction-handlers/create`,
29853
29853
  createMany: `${Ae.API_URL}/transaction-handlers/create-many`,
29854
29854
  confirm: `${Ae.API_URL}/transaction-handlers/confirm`,
29855
+ purchaseConfirm: `${Ae.API_URL}/transaction-handlers/purchase-confirm`,
29855
29856
  sendBankTransaction: `${Ae.API_URL}/transaction-handlers/send-bank-transaction`,
29856
29857
  checkTicketStatus: `${Ae.API_URL}/transaction-handlers/check-ticket-status`,
29857
29858
  getByBankTransactionId: (e) => `${Ae.API_URL}/transaction-handlers/${e}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gotrip-fx-transaction-form",
3
- "version": "1.0.194",
3
+ "version": "1.0.195",
4
4
  "description": "FX Transaction Form ES6 module",
5
5
  "main": "index.js",
6
6
  "types": "types/index.d.ts",
@@ -1,5 +1,7 @@
1
+ import { TransactionStatus } from '../../types/enum';
1
2
  type Props = {
2
3
  publicId: string;
4
+ status?: TransactionStatus;
3
5
  };
4
- export declare const PublicIdActionMenu: ({ publicId }: Props) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const PublicIdActionMenu: ({ publicId, status }: Props) => import("react/jsx-runtime").JSX.Element;
5
7
  export {};
@@ -26,6 +26,7 @@ export declare const ApiUrls: {
26
26
  create: string;
27
27
  createMany: string;
28
28
  confirm: string;
29
+ purchaseConfirm: string;
29
30
  sendBankTransaction: string;
30
31
  checkTicketStatus: string;
31
32
  getByBankTransactionId: (transactionId: string) => string;
@@ -0,0 +1,3 @@
1
+ import { TransactionStatus } from '../types/enum';
2
+ export declare const CUSTOMER_PURCHASE_CONFIRMATION_STATUS_LABEL = "Ch\u1EDD KH x\u00E1c nh\u1EADn thanh to\u00E1n";
3
+ export declare const TRANSACTION_STATUS_LABELS: Partial<Record<TransactionStatus, string>>;
@@ -0,0 +1 @@
1
+ export declare const isConfirmationApiSuccess: (code?: string) => boolean;
@@ -0,0 +1,4 @@
1
+ import { TransactionStatus } from '../../types/enum';
2
+ /** Luồng xác nhận mua — `/confirm-purchase/:id` */
3
+ export declare const PURCHASE_CONFIRMATION_STATUSES: TransactionStatus[];
4
+ export declare const PURCHASE_CONFIRMATION_PENDING_STATUS = TransactionStatus.CUSTOMER_PURCHASE_CONFIRMATION;
@@ -0,0 +1,22 @@
1
+ import { TransactionStatus } from '../../types/enum';
2
+ import { IAgent, ITransaction } from '../../types/response.dto';
3
+ export type TravellerConfirmationTransaction = {
4
+ id: number;
5
+ bankCode: string;
6
+ bankName: string;
7
+ bookerName?: string;
8
+ bookerEmail?: string;
9
+ ticketNumber: string;
10
+ travellerName: string;
11
+ confirmationToken: string;
12
+ status: TransactionStatus;
13
+ customerCode: string;
14
+ };
15
+ export type TravellerConfirmationContext = {
16
+ transaction: TravellerConfirmationTransaction | null;
17
+ agent: IAgent | null;
18
+ groupTransactions: ITransaction[];
19
+ isLoading: boolean;
20
+ fetchError: string | null;
21
+ refetch: () => Promise<void>;
22
+ };
@@ -0,0 +1,12 @@
1
+ import { TravellerConfirmationTransaction } from './types';
2
+ type Params = {
3
+ transaction: TravellerConfirmationTransaction | null;
4
+ refetch: () => Promise<void>;
5
+ };
6
+ export declare const usePurchaseTravellerConfirmation: ({ transaction, refetch }: Params) => {
7
+ isPending: boolean;
8
+ isCompleted: boolean;
9
+ isSubmitting: boolean;
10
+ submitPurchaseConfirmation: () => Promise<void>;
11
+ };
12
+ export {};
@@ -0,0 +1,2 @@
1
+ import { TravellerConfirmationContext } from './types';
2
+ export declare const useTravellerConfirmationFetch: () => TravellerConfirmationContext;
@@ -1,38 +1,19 @@
1
1
  import { TransactionStatus } from '../types/enum';
2
- import { IAgent, ITransaction, IUser } from '../types/response.dto';
2
+ import { IAgent, ITransaction } from '../types/response.dto';
3
3
  export type ConfirmTransactionData = {
4
- code: string;
5
- data: {
6
- id: number;
7
- bankCode: string;
8
- bankName: string;
9
- bookerName?: string;
10
- bookerEmail?: string;
11
- ticketNumber: string;
12
- travellerName: string;
13
- confirmationToken: string;
14
- status: TransactionStatus;
15
- customerCode: string;
16
- agent?: IUser;
17
- groupTransactions?: ITransaction[];
18
- };
19
- message: string;
4
+ id: number;
5
+ bankCode: string;
6
+ bankName: string;
7
+ bookerName?: string;
8
+ bookerEmail?: string;
9
+ ticketNumber: string;
10
+ travellerName: string;
11
+ confirmationToken: string;
12
+ status: TransactionStatus;
13
+ customerCode: string;
20
14
  };
21
15
  export declare const useConfirmTransaction: () => {
22
- transaction: {
23
- id: number;
24
- bankCode: string;
25
- bankName: string;
26
- bookerName?: string;
27
- bookerEmail?: string;
28
- ticketNumber: string;
29
- travellerName: string;
30
- confirmationToken: string;
31
- status: TransactionStatus;
32
- customerCode: string;
33
- agent?: IUser;
34
- groupTransactions?: ITransaction[];
35
- } | null;
16
+ transaction: ConfirmTransactionData | null;
36
17
  agent: IAgent | null;
37
18
  groupTransactions: ITransaction[];
38
19
  isLoading: boolean;
@@ -0,0 +1,5 @@
1
+ import { TravellerConfirmationContext } from '../../../hooks/traveller-confirmation/types';
2
+ type Props = TravellerConfirmationContext;
3
+ /** Màn xác nhận mua — `/confirm-purchase/:id` */
4
+ export declare const PurchaseTravellerConfirmation: ({ transaction, agent, groupTransactions, refetch, }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ /** Luồng xác nhận mua — `/confirm-purchase/:id` */
2
+ export declare const TravellerPurchaseConfirmation: () => import("react/jsx-runtime").JSX.Element | null;
@@ -1,3 +1,4 @@
1
1
  import { BANK_CODES, BANKS_WITH_DEPARTMENT_AND_ZNS_FLOW } from '../constants/tenant';
2
+ export declare const getBankLogoUrl: (bankCodeOrShortName?: string | null) => string | null;
2
3
  export declare const isBankWithDepartmentAndZnsFlow: (shortName?: string | null) => shortName is (typeof BANKS_WITH_DEPARTMENT_AND_ZNS_FLOW)[number];
3
4
  export { BANK_CODES };
@@ -0,0 +1,9 @@
1
+ import { TransactionStatus } from '../types/enum';
2
+ /** Logic cũ — nút "Copy link xác nhận" (link `/confirm/`) */
3
+ export declare const CUSTOMER_CONFIRMATION_LINK_STATUS_VALUES: readonly [TransactionStatus.SENT_CONFIRMATION, TransactionStatus.CUSTOMER_PURCHASE_CONFIRMATION, "sent_confirmation_to_customer", "customer_purchase_confirmation"];
4
+ /** Chỉ nút "Copy link xác nhận mua" (link `/confirm-purchase/`) */
5
+ export declare const CUSTOMER_PURCHASE_CONFIRMATION_LINK_STATUS_VALUES: readonly [TransactionStatus.CUSTOMER_PURCHASE_CONFIRMATION, "customer_purchase_confirmation"];
6
+ export declare const canCopyCustomerConfirmationLink: (status?: TransactionStatus | string | null) => boolean;
7
+ export declare const canCopyCustomerPurchaseConfirmationLink: (status?: TransactionStatus | string | null) => boolean;
8
+ export declare const getCustomerConfirmationLink: (publicId: string) => string;
9
+ export declare const getCustomerPurchaseConfirmationLink: (publicId: string) => string;