import type { LegalEntityTypes } from '../../../../core/models/api/legal-entity-type';
import type { TrustMemberType, TrustMemberTypes } from '../../../../core/models/api/trust-member-type';
import type { CountryCode } from '../../../../types/datasets/country-code';
import type { IsNewEntity } from '../../../../utils/isNewEntity';
import type { SettlorExemptionReason, TrustMemberLegalEntityType } from '../../forms/TrustRoleAndEntityType/types';
/**
 * The top level legal entity that the trust LE is associated to.
 */
export interface RootTrustee {
    trustMemberType: 'rootTrustee';
    roles: TrustMemberType[];
    legalEntityType: TrustMemberLegalEntityType;
    legalEntityId: string;
    name: string;
}
/**
 * Normal individual LEs linked via {@link LegalEntity.entityAssociations}.
 * They can hold a combination of roles.
 */
export interface RegularTrustMember {
    trustMemberType: 'regular';
    roles: TrustMemberType[];
    legalEntityType: typeof LegalEntityTypes.INDIVIDUAL;
    legalEntityId: string | IsNewEntity;
    name: string;
}
/**
 * Normal organization LEs linked via {@link LegalEntity.entityAssociations}.
 * They can hold a combination of roles.
 * The UBOs of the company are associated with the trust also.
 */
export interface CompanyTrustMember {
    trustMemberType: 'company';
    roles: TrustMemberType[];
    legalEntityType: typeof LegalEntityTypes.ORGANIZATION;
    legalEntityId: string | IsNewEntity;
    name: string;
    ownerId?: string;
    country?: CountryCode;
}
/**
 * Exempt settlors are bare-bones individual LEs also linked via {@link LegalEntity.entityAssociations}, but their association contains some special fields.
 * There can exist only one exempt settlor per trust, and that is their only role (otherwise they become a {@link RegularTrustMember}).
 */
export interface ExemptSettlor {
    trustMemberType: 'exemptSettlor';
    roles: [typeof TrustMemberTypes.SETTLOR];
    legalEntityType: typeof LegalEntityTypes.INDIVIDUAL | typeof LegalEntityTypes.ORGANIZATION;
    legalEntityId: string | IsNewEntity;
    settlorExemptionReason: SettlorExemptionReason[];
    exemptSettlorName?: {
        firstName: string;
        lastName: string;
    };
    country?: CountryCode;
    name?: string;
}
/**
 * Undefined beneficiaries are not LEs, and are instead found in {@link LegalEntity.trust.undefinedBeneficiaryInfo}, *not* in {@link LegalEntity.entityAssociations}.
 */
export interface UndefinedBeneficiary {
    trustMemberType: 'undefinedBeneficiary';
    roles: [typeof TrustMemberTypes.UNDEFINED_BENEFICIARY];
    reference: string | IsNewEntity;
    description: string;
}
/**
 * A standardised shape for trust members, no matter where they are located on the LE.
 */
export type TrustMember = RootTrustee | RegularTrustMember | CompanyTrustMember | ExemptSettlor | UndefinedBeneficiary;
