import type { HouseCollectionIdentifier } from './House' export type SupportedCurrencies = 'EUR' | 'CHF' | 'USD' | 'GBP' export type ContractAttributes = { approvedByClientAt: string | null approvedByOwnerAt: string | null checkInDate: string checkInTime: string checkOutDate: string checkOutTime: string clientCompanyRepresentativeFirstname: string | null clientCompanyRepresentativeLastname: string | null clientFirstname: string | null clientIsCompany: boolean | null clientIsRepeater?: boolean | null clientLastname: string | null clientIsRepeat?: boolean | null currencyTrigram: SupportedCurrencies destinationName: string durationInDays: number houseCollectionIdentifier: HouseCollectionIdentifier houseFirstPhotoUrl: string houseName: string houseOldName: string negociatedOwnerPrice: number | null ownerAddress: string ownerBankAccountOwner: string ownerBic: string | null ownerCity: string ownerCivility: string ownerCompanyAccountOwner: string | null ownerCompanyAddress: string | null ownerCompanyBic: string | null ownerCompanyCity: string | null ownerCompanyCountry: string | null ownerCompanyEmail: string | null ownerCompanyIban: string | null ownerCompanyId: string | null ownerCompanyName: string | null ownerCompanyPhone: string | null ownerCompanyPostalCode: string | null ownerCompanyRepresentativeCivility: string | null ownerCompanyRepresentativeFirstname: string | null ownerCompanyRepresentativeLastname: string | null ownerCompanySiret: string | null ownerCountry: string ownerEmail: string ownerFirstname: string ownerIban: string | null ownerId: number ownerIsCompany: boolean ownerLanguage: string | null ownerLastname: string ownerPaymentDelay: string | null ownerPdfDocumentId: string | null ownerPhone: string ownerPostalCode: string ownerPrice: number ownerPrivateToken: string ownerProcedureYousignToken: string | null ownerProcedureYousignTokenUpdatedAt: string | null ownerSendingMethod: string | null ownerType: string ownerUploadYousignFileToken: string | null ownerYousignProcedureFinished: boolean sent_to_owner_at: string state: string } type ContractType = 'ownerContract' | 'clientContract' | 'contract' type ContractOptions = { serialized?: boolean attributeType?: 'contract' | 'attributes' attributeOptions?: keyof ContractAttributes | 'all' withRelationships?: boolean } type ContractAttributesCondition = AttributeOptions extends keyof ContractAttributes ? AttributeOptions : keyof ContractAttributes type ContractAttributesWrapped = { contract: { id: string type: 'contract' attributes: Pick< ContractAttributes, ContractAttributesCondition > } } type ContractAttributeCondition = Options['attributeType'] extends 'contract' ? ContractAttributesWrapped : Pick< ContractAttributes, ContractAttributesCondition > type ContractFields = { id: string type: Options['attributeType'] extends 'contract' ? ContractType : 'contract' attributes: ContractAttributeCondition relationships: Record } type ContractSerialized = Pick< ContractFields, 'id' | 'relationships' > & ContractAttributeCondition type ContractWithSerializedCondition = Options['serialized'] extends true ? ContractSerialized : ContractFields export type Contract< Options extends ContractOptions = { serialized: false withRelationships: true }, > = Options['withRelationships'] extends true ? ContractWithSerializedCondition : Omit, 'relationships'> export type ContractFormatted = { additionalHousekeepingHouseFee: string approvedByClientAt: string approvedByOwnerAt: string b2b2c: boolean checkInDate: string checkInTime: string checkOutDate: string checkOutTime: string clientAddress: string | null clientBirthdate: string | null clientCivility: string | null clientCity: string | null clientCompanyAddress: string | null clientCompanyRepresentativeCivility: string | null clientCompanyCity: string | null clientCompanyCountry: string | null clientCompanyEmail: string | null clientCompanyIban: string | null clientCompanyName: string | null clientCompanyPhone: string | null clientCompanyPostalCode: string | null clientCompanyRepresentativeFirstname: string | null clientCompanyRepresentativeLastname: string | null clientCompanySiret: string | null clientCountry: string clientEmail: string | null clientFirstname: string | null clientIban: string | null clientIsCompany: boolean clientIsRepeater: boolean clientLanguage: string | null clientLastname: string | null clientPhone: string clientPostalCode: string clientPrice: number clientRibFilePath: string | null clientSendingMethod: string | null clientYousignProcedureFinished: boolean cryptoCode: number | string currency: SupportedCurrencies currencyTrigram: SupportedCurrencies destinationName: string estimatedOperationalCosts: number estimatedPartnersCommission: number fee: number house: number houseAddress: string houseBathrooms: number houseBedrooms: number houseCapacity: number houseCapacityAdults: number houseCollectionIdentifier: HouseCollectionIdentifier houseDoubleBeds: number houseFloor: number houseGpscoordinates: string housekeeping: string housekeepingHours: number houseName: string houseOldName: string houseSingleBeds: number houseSurface: number id: string lcApprovedAt: string | null manualSignatureClient: boolean meta: { currentBalance: number seasonalPurchase: boolean } negociatedClientPrice: number negociatedFee: number negociatedOwnerPrice: number negociatedTaxes: string negociatedTouristTaxes: string netCommission: number numberOfPayments: number operationalCostComment: string | null operationalCosts: number | null operationalCostsIsPaid: boolean operationalCostsPaidOn: string | null ownerAddress: string ownerCity: string | null ownerCompanyAddress: string | null ownerCompanyCity: string | null ownerCompanyCountry: string | null ownerCompanyEmail: string | null ownerCompanyName: string | null ownerCompanyPhone: string | null ownerCompanyPostalCode: string | null ownerCompanyRepresentativeFirstname: string | null ownerCompanyRepresentativeLastname: string | null ownerCompanySiret: string | null ownerCountry: string | null ownerEmail: string | null ownerFirstname: string | null ownerIsCompany: boolean ownerLanguage: string | null ownerLastname: string | null ownerPhone: string | null ownerPostalCode: string | null ownerPrice: number ownerPrivateToken: string | null ownerRibFilename: string | null ownerRibFilePath: string ownerSendingMethod: string ownerType: string ownerUploadYousignFileToken: string | null ownerYousignProcedureFinished: boolean ownerProcedureYousignTokenUpdatedAt: string | null partnersCommission: number | null partnersCommissionComment: string | null partnersCommissionIsPaid: boolean partnersCommissionPaidOn: string | null paymentTrackingState: 'open' | 'closed_ok' | 'canceled' | 'closed_ko' securityDepositAmount: number securityDepositDueOn: string sheetsAndTowelsReplacement: string specialConditions: string state: string taxes: string | null }