import { AccountOwnerType, ActiveNonFinancialEntityType, EntityAccountHolderAccountType, EntityRegardedOwnerAccountType, EntityType, FinancialInstitutionType, IntermediaryAccountType, SelfCertificationAccountType, UsAccountHolderAccountType, UsLLCAccountType, UsRegardedOwnerAccountType } from '@taxbit/utilities'; import { Yes } from './Yes'; import { YesNo } from './YesNo'; export type AccountHolderClassificationData = { accountHolderIsIndividual?: YesNo; accountHolderUsPerson?: YesNo; accountHolderAccountOwnerType?: AccountOwnerType; accountHolderUsAccountType?: UsAccountHolderAccountType; accountHolderUsSmllcElection?: YesNo; accountHolderUsLlcClassification?: UsLLCAccountType; accountHolderUsOtherClassification?: string; accountHolderUsTrustEstateEin?: YesNo; accountHolderUsSoleProprietorEin?: YesNo; accountHolderEntityAccountType?: EntityAccountHolderAccountType; accountHolderIntermediaryAccountType?: IntermediaryAccountType; }; export type AccountHolderCertifications = { accountHolderAssumesChapters3And4Responsibility?: YesNo; accountHolderAssumes1099Responsibility?: YesNo; accountHolderUsPersonElection?: YesNo; accountHolderProvidesAdditionalDocumentation?: YesNo; accountHolderIsQiCertified?: Yes; accountHolderAssumesChapters3And4ResponsibilityCertified?: Yes; accountHolderAssumes1099ResponsibilityCertified?: Yes; accountHolderNotAssume1099ResponsibilityCertified?: Yes; accountHolderMeetsQiRegulationsRequirementsCertified?: Yes; accountHolderObtainsDocumentationCertified?: Yes; accountHolderNotActingAsQiCertified?: Yes; accountHolderTransmitsNqiDocumentationCertified?: Yes; accountHolderRepresentsWithholdingStatementsCertified?: Yes; accountHolderIsFinancialInstitutionCertified?: Yes; accountHolderTfiUsPersonElectionCertified?: Yes; accountHolderTransmitsTfiDocumentationCertified?: Yes; accountHolderUsbPaymentsCertified?: Yes; accountHolderUsbUsPersonElectionCertified?: Yes; accountHolderTransmitsUsbDocumentationCertified?: Yes; accountHolderIsCompliantCertified?: Yes; accountHolderEntityPaymentsCertified?: Yes; accountHolderProvidesWithholdingStatementCertified?: Yes; }; type Address = { [key in `${Prefix}Address`]?: string; } & { [key in `${Prefix}AddressCity`]?: string; } & { [key in `${Prefix}AddressCountry`]?: string; } & { [key in `${Prefix}AddressState`]?: string; } & { [key in `${Prefix}AddressStreet2`]?: string; } & { [key in `${Prefix}AddressStreet`]?: string; } & { [key in `${Prefix}AddressZip`]?: string; }; export type AccountHolderContactData = Address<'accountHolder'> & Address<'accountHolderMailing'> & { accountHolderCityOfBirth?: string; accountHolderCountryOfBirth?: string; accountHolderOptionalCityOfBirth?: string; accountHolderOptionalCountryOfBirth?: string; accountHolderCountryOfCitizenship?: string; accountHolderDateOfBirth?: string; accountHolderDateOfBirthMonth?: string; accountHolderDateOfBirthDay?: string; accountHolderDateOfBirthYear?: string; accountHolderDbaName?: string; accountHolderMailingAddressIsDifferent?: Yes; accountHolderName?: string; accountHolderCarfClassificationDetails?: string; accountHolderPlaceOfBirth?: string; accountHolderPhoneNumber?: string; accountHolderPhoneNumberCode?: string; accountHolderPhoneNumberNumber?: string; accountHolderPhoneNumberAndEmail?: string; accountHolderEmailAddress?: string; }; export type AccountHolderTreatyClaimData = { accountHolderTreatyClaimIsEligible?: YesNo; accountHolderTreatyClaimCountry?: string; accountHolderTreatyClaimICertifyResident?: Yes; accountHolderTreatyClaimICertifyRequirements?: Yes; accountHolderTreatyClaimLimitationOnBenefits?: string; accountHolderTreatyClaimLimitationOnBenefitsOtherArticleParagraph?: string; accountHolderTreatyClaimTypeOfIncome?: string; accountHolderTreatyClaimWithholding?: string; accountHolderTreatyClaimHasAdditionalConditions?: Yes; }; export type RegardedOwnerTreatyClaimData = { regardedOwnerTreatyClaimIsEligible?: YesNo; regardedOwnerTreatyClaimCountry?: string; regardedOwnerTreatyClaimICertifyResident?: Yes; regardedOwnerTreatyClaimICertifyRequirements?: Yes; regardedOwnerTreatyClaimLimitationOnBenefits?: string; regardedOwnerTreatyClaimLimitationOnBenefitsOtherArticleParagraph?: string; regardedOwnerTreatyClaimTypeOfIncome?: string; regardedOwnerTreatyClaimWithholding?: string; regardedOwnerTreatyClaimHasAdditionalConditions?: Yes; }; type Iterate1_5 = '1' | '2' | '3' | '4' | '5'; type ResidenceCountryKey = `${Prefix}TaxResidenceCountry${Iterate1_5}`; type ResidenceTinKey = `${Prefix}TaxResidenceTin${Iterate1_5}`; type ResidenceTinNotRequiredKey = `${Prefix}TaxResidenceTinIsNotRequired${Iterate1_5}`; type ResidenceTinNotRequiredReasonKey = `${Prefix}TaxResidenceTinIsNotRequiredReason${Iterate1_5}`; type ResidenceTinNotRequiredReasonOtherKey = `${Prefix}TaxResidenceTinIsNotRequiredReasonOther${Iterate1_5}`; type ResidenceShowKey = `${Prefix}ShowTaxResidence${Iterate1_5}`; type Residences = { [key in `${Prefix}IConfirmNoOtherTaxResidencies`]?: Yes; } & { [key in `${Prefix}TaxResidences`]?: YesNo; } & { [key in ResidenceCountryKey]?: string; } & { [key in ResidenceTinKey]?: string; } & { [key in ResidenceTinNotRequiredKey]?: Yes; } & { [key in ResidenceTinNotRequiredReasonKey]?: string; } & { [key in ResidenceTinNotRequiredReasonOtherKey]?: string; } & { [key in ResidenceShowKey]?: YesNo; }; export type AccountHolderTaxData = Residences<'accountHolder'> & { accountHolderForeignTin?: string; accountHolderForeignTinIsNotRequired?: Yes; accountHolderUsTin?: string; accountHolderUsTinIsValid?: Yes; accountHolderUsTinMatchVerification?: YesNo; accountHolderVatIdentificationNumber?: string; accountHolderVatIsNotRequired?: Yes; accountHolderVatCountry?: string; accountHolderBusinessRegistrationNumber?: string; accountHolderBusinessRegistrationCountry?: string; accountHolderSelfCertificationAccountType?: SelfCertificationAccountType; accountHolderActiveNonFinancialEntityType?: ActiveNonFinancialEntityType; accountHolderFinancialInstitutionType?: FinancialInstitutionType; accountHolderInvestmentEntityManaged?: YesNo; accountHolderEntityType?: EntityType; accountHolderSecuritiesMarket?: string; accountHolderRelatedCorporation?: string; accountHolderResidenceByInvestmentConfirmed?: Yes; accountHolderGiin?: string; }; type ControllingPersonPrefix = `controllingPerson${Iterate1_5}`; type ControllingPerson = { [key in `${ControllingPersonPrefix}ShowFields`]?: Yes; } & { [key in `${ControllingPersonPrefix}Name`]?: string; } & { [key in `${ControllingPersonPrefix}Role`]?: string; } & { [key in `${ControllingPersonPrefix}RoleOther`]?: string; } & { [key in `${ControllingPersonPrefix}RoleOtherEquivalent`]?: string; } & { [key in `${ControllingPersonPrefix}OwnershipPercentage`]?: string; } & { [key in `${ControllingPersonPrefix}DateOfBirth`]?: string; } & { [key in `${ControllingPersonPrefix}DateOfBirthMonth`]?: string; } & { [key in `${ControllingPersonPrefix}DateOfBirthDay`]?: string; } & { [key in `${ControllingPersonPrefix}DateOfBirthYear`]?: string; } & { [key in `${ControllingPersonPrefix}CityOfBirth`]?: string; } & { [key in `${ControllingPersonPrefix}CountryOfBirth`]?: string; } & { [key in `${ControllingPersonPrefix}CountryOfCitizenship`]?: string; } & { [key in `${ControllingPersonPrefix}MailingAddressIsDifferent`]?: Yes; } & Address & Address<`${ControllingPersonPrefix}Mailing`> & { [key in `${ControllingPersonPrefix}ResidenceByInvestmentConfirmed`]?: Yes; }; export type ControllingPersonClassificationData = Residences & ControllingPerson; export type RegardedOwnerClassificationData = { regardedOwnerUsPerson?: YesNo; regardedOwnerUsAccountType?: UsRegardedOwnerAccountType; regardedOwnerUsLlcClassification?: UsLLCAccountType; regardedOwnerUsOtherClassification?: string; regardedOwnerAccountOwnerType?: AccountOwnerType; regardedOwnerIntermediaryAccountType?: IntermediaryAccountType; regardedOwnerEntityAccountType?: EntityRegardedOwnerAccountType; }; export type RegardedOwnerCertifications = { regardedOwnerAssumesChapters3And4Responsibility?: YesNo; regardedOwnerAssumes1099Responsibility?: YesNo; regardedOwnerUsPersonElection?: YesNo; regardedOwnerProvidesAdditionalDocumentation?: YesNo; regardedOwnerIsQiCertified?: Yes; regardedOwnerAssumesChapters3And4ResponsibilityCertified?: Yes; regardedOwnerAssumes1099ResponsibilityCertified?: Yes; regardedOwnerNotAssume1099ResponsibilityCertified?: Yes; regardedOwnerMeetsQiRegulationsRequirementsCertified?: Yes; regardedOwnerObtainsDocumentationCertified?: Yes; regardedOwnerNotActingAsQiCertified?: Yes; regardedOwnerTransmitsNqiDocumentationCertified?: Yes; regardedOwnerRepresentsWithholdingStatementsCertified?: Yes; regardedOwnerIsFinancialInstitutionCertified?: Yes; regardedOwnerTfiUsPersonElectionCertified?: Yes; regardedOwnerTransmitsTfiDocumentationCertified?: Yes; regardedOwnerUsbPaymentsCertified?: Yes; regardedOwnerUsbUsPersonElectionCertified?: Yes; regardedOwnerTransmitsUsbDocumentationCertified?: Yes; regardedOwnerIsCompliantCertified?: Yes; regardedOwnerEntityPaymentsCertified?: Yes; regardedOwnerProvidesWithholdingStatementCertified?: Yes; }; export type RegardedOwnerContactData = { regardedOwnerCountryOfCitizenship?: string; regardedOwnerDateOfBirth?: string; regardedOwnerDateOfBirthMonth?: string; regardedOwnerDateOfBirthDay?: string; regardedOwnerDateOfBirthYear?: string; regardedOwnerDbaName?: string; regardedOwnerMailingAddressIsDifferent?: Yes; regardedOwnerName?: string; } & Address<'regardedOwner'> & Address<'regardedOwnerMailing'>; export type RegardedOwnerTaxData = { regardedOwnerForeignTin?: string; regardedOwnerForeignTinIsNotRequired?: Yes; regardedOwnerUsTin?: string; regardedOwnerUsTinIsValid?: Yes; regardedOwnerUsTinMatchVerification?: YesNo; }; export type SummaryData = { exemptFatcaCode?: string; exemptPayeeCode?: string; iAmACitizenOfTheUs?: Yes; iAmExemptFromFatcaReporting?: Yes; iAmNotSubjectToBackupWithholding?: YesNo; iAuthorizeWithholdingAgent?: Yes; iConfirmIncomeIsNonUs?: Yes; iConfirmTheBeneficialOwnerIsExempt?: Yes; iConfirmNotAUsPerson?: Yes; iConfirmTheBeneficialOwner?: Yes; iConfirmTheIndividualIsResidentOfTreatyCountry?: Yes; iConfirmTheInformationIsCorrectComplete?: Yes; iConfirmTheTaxIdIsCorrect?: Yes; iHaveCapacityToSign?: Yes; iWillResubmitIfIncorrect?: Yes; iUnderstandTheInformationIsCovered?: Yes; iAcknowledgeTheInformationMayBeProvided?: Yes; iCertifyIAmAccountHolder?: Yes; iDeclareStatementsAreCorrect?: Yes; iWillNotifyChangeInCircumstance?: Yes; signature?: string; signatureCapacity?: string; signatureCapacityOther?: string; source?: string; }; export type CalculatedData = { accountHolderTaxResidences?: YesNo; accountHolderAddress?: string; accountHolderMailingAddress?: string; regardedOwnerAddress?: string; regardedOwnerMailingAddress?: string; }; export type InformationalText = { subjectToBackupWithholding?: undefined; irsRequiresBackupWithholdingConsent?: undefined; }; export type QuestionnaireState = AccountHolderContactData & AccountHolderCertifications & AccountHolderTaxData & AccountHolderClassificationData & RegardedOwnerCertifications & RegardedOwnerContactData & RegardedOwnerClassificationData & RegardedOwnerTaxData & SummaryData & CalculatedData & AccountHolderTreatyClaimData & RegardedOwnerTreatyClaimData & ControllingPersonClassificationData & InformationalText; export type QuestionnaireStateKey = keyof QuestionnaireState; export {};