All files / src/features/GiveOnboarding/types form.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201                                                                                                                                                                                                                                                                                                                                                                                                                 
import { IDocumentype } from "@components/ProfilePage/BusinessProfileSetupNew/types";
import { IStep } from ".";
 
import { StatusInfo } from "@features/Merchants/MerchantSidePanel/AgreementAndSnapshot/agreements.types";
 
import {
  IMerchantBankAccount,
  TinType,
  TMerchantBankAccountSettings,
} from "@components/Merchants/MerchantPreview/data.types";
import { NewBankAccount } from "@hooks/merchant-api/manage-money/useListBankAccounts";
 
export type IdentityDetailsFormValues = {
  firstName: string;
  lastName: string;
  dateOfBirth: Date | string | null;
  phoneNumber: string;
  countryOfResidence: string;
  citizenship: string;
};
 
export type IMerchantInfo = {
  merchantId?: string;
  legalEntityID?: number;
  merchantName?: string;
  pendingTaxIdNumber?: string;
  isOnboardingCompleted?: boolean;
  isAllowedAddBankAccounts?: boolean;
  bankAccountSettings?: TMerchantBankAccountSettings;
  statusInfo: StatusInfo;
  pendingLegalEntityEmail?: string;
  // PAH006 SS-4: BE flag (derived in account_read_handler) marking that a
  // reassigned PAH must re-onboard Identity only on an already-approved merchant.
  isPahReassignmentIdentityOnly?: boolean;
};
 
export type { TinType } from "@validation/types";
 
type businessProfileDataAux = {
  showLinkedBusinessProfile?: boolean;
  wasFilledAnExistingTaxID?: boolean;
  hasBeenPreviouslyLinked?: boolean;
};
 
export type IBusinessProfileFormValues = {
  name: string;
  DBA: string;
  businessOpenedAt: string | number | Date | null;
  type: string;
  ownershipType: string;
  phoneNumber: string;
  ssn: string;
  taxIDNumber: string;
  tinType: TinType;
  businessProfileDataAux?: Partial<businessProfileDataAux>;
};
 
export type IBusinessOwnerFormValues = {
  address: {
    country: string;
    line1: string;
    city: string;
    state: string;
    zip: string;
  };
  files: {
    fileWithMeta?: any;
    status?: any;
    allFiles: any[];
  };
  firstName: string;
  lastName: string;
  email: string;
  ssn: string;
  ownership: string;
  dob: string | null;
  id: string;
  documentType?: IDocumentype;
  documentNumber?: string;
  citizenship: string;
  countryOfResidence: string;
  phone?: string;
  idImageUrl?: string;
  tinType?: TinType;
};
 
export type IBusinessOwnerPayload = {
  address?: Partial<{
    line1: string;
  }>;
  id?: string;
  taxIdNumber: string | null;
  docIDNumber: string | null;
  docIDNumberType: IDocumentype | null;
  tinType: TinType | null;
  citizenship?: string;
  countryOfResidence?: string;
  dateOfBirth?: number;
  idImageUrl?: string;
  ownershipPercentage?: number;
};
 
export type IBusinessAddressFormValues = {
  country: string;
  address: string;
  city: string;
  state: string;
  zip: string;
  notes: string;
};
 
export type IBusinessDetailsFormValues = {
  website_url: string;
  business_social_media: string;
  merchant_phone_number: string;
  estimated_annual_revenue: string | number;
  average_ticket_amount: string | number;
  high_ticket_amount: string | number;
  billingDescriptor: string;
};
export type IBusinessBankAccountConnectFormValues = {
  type: string;
  name: string;
  routingNumber: string;
  accountNumber: string;
  notes: string;
};
 
export type IBusinessOwners = {
  list: any[];
  skipInitialRequestOnMount: boolean;
};
 
export type IBusinessData = {
  business_profile: IBusinessProfileFormValues;
  business_address: IBusinessAddressFormValues;
};
 
export type BankAccountDetailsForm = {
  type: string;
  name: string;
  routingNumber: string;
  accountNumber: string;
  notes?: string;
  bankDataAux: {
    id: number;
    bankName: string;
    createdAt?: number | null;
    routingNumber: string;
    numberLast4: string;
    status: string;
    isLinked: boolean;
  };
};
 
export type BusinessDetails = {
  business_social_media: string;
  website_url: string;
  businessImage: string;
  billingDescriptor: string;
  billingDescriptorPrefix: string;
  estimated_annual_revenue: number;
  high_ticket_amount: number;
  average_ticket_amount: number;
  merchant_name: string;
  amount: string;
  date: string;
  merchant_phone_number?: string;
};
 
export type WizardFormData = {
  identity_details: IdentityDetailsFormValues;
  merchant_info: IMerchantInfo;
  business_profile: Partial<IBusinessProfileFormValues>;
  business_address: IBusinessAddressFormValues;
  business_owners: IBusinessOwnerFormValues;
  business_bank_connect: BankAccountDetailsForm;
  business_details: BusinessDetails;
};
 
export type IApiData = {
  data: Partial<{
    identity_details: IdentityDetailsFormValues;
    merchant_info: IMerchantInfo;
    business_profile: Partial<IBusinessProfileFormValues>;
    business_address: IBusinessAddressFormValues;
    business_details: BusinessDetails;
    business_bank_connect: BankAccountDetailsForm;
  }> & { business_owners: IBusinessOwners };
  loadings: Partial<Record<IStep | "merchant_info", boolean>>;
};
 
export type TerminationFormValues = {
  processorName: string;
  terminationDate: Date | null | string;
  terminationReason: string;
  msaPreviousTermination?: boolean;
  msaPCICompliant?: boolean;
  msaRefundPolicy?: string;
};