Skip to content

Commit

Permalink
use leasing endpoint return type
Browse files Browse the repository at this point in the history
  • Loading branch information
momentiris committed Nov 6, 2024
1 parent ca4e7c8 commit 44b78f1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/adapters/leasing-adapter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import {
DetailedApplicant,
Tenant,
ApplicationProfile,
leasing,
} from 'onecore-types'
import { z } from 'zod'

import { AdapterResult } from './../types'
import config from '../../common/config'
Expand Down Expand Up @@ -511,9 +513,15 @@ const validatePropertyRentalRules = async (
}
}

type GetApplicationProfileResponseData = z.infer<
typeof leasing.GetApplicationProfileResponseDataSchema
>

async function getApplicationProfileByContactCode(
contactCode: string
): Promise<AdapterResult<ApplicationProfile, 'unknown' | 'not-found'>> {
): Promise<
AdapterResult<GetApplicationProfileResponseData, 'unknown' | 'not-found'>
> {
try {
const response = await axios.get<{ content: ApplicationProfile }>(
`${tenantsLeasesServiceUrl}/contacts/${contactCode}/application-profile`
Expand Down

0 comments on commit 44b78f1

Please sign in to comment.