Skip to content

Commit bee02be

Browse files
Alonso RodríguezAlonso Rodríguez
authored andcommitted
feat(Appraisal): added get comparables path to appraisals class
1 parent 7a0ff84 commit bee02be

4 files changed

Lines changed: 28 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
This SDK provides convenient access to the Price Engine REST API from TypeScript or JavaScript.
88
<br/>
99

10-
**[Unstable v1](https://dd360.mx/)**
10+
**[Stable v2](https://dd360.mx/)**
1111

1212
[![license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/dd3tech/pe-sdk)
1313
[![npm latest package](https://img.shields.io/npm/v/pe-sdk/latest.svg)](https://www.npmjs.com/package/pe-sdk)

src/apis/appraisal.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import type {
1111
AppraisalRequestInputVariable,
1212
AppraisalRequestOutput,
1313
AppraisalOutputCoverage,
14-
CommonRequestInput
14+
CommonRequestInput,
15+
Comparable
1516
} from '../types'
1617
/*
1718
* This is the API Client to interact with our Price Engine API.
@@ -21,6 +22,15 @@ export class Appraisal extends BaseFetcher {
2122
super(props)
2223
}
2324

25+
public async getComparables(
26+
body: AppraisalRequestInput
27+
): Promise<Comparable> {
28+
return this.request(`/${API_RESOURCES_PATH.APPRAISALS}/comparables`, {
29+
method: 'POST',
30+
body: JSON.stringify(body)
31+
})
32+
}
33+
2434
public async getAppraisalCoverage(
2535
request: CommonRequestInput
2636
): Promise<AppraisalOutputCoverage> {

src/types/appraisal.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
/** Appraisals types */
2-
export type Comparable = {
2+
export interface Comparable {
33
id?: string
44
urlAd?: string
5+
propertyId?: string
6+
propertyCode?: string
7+
latitude?: number
8+
longitude?: number
59
surfaceTotal?: number
610
terrainSurface?: number
711
builtYear?: number
@@ -11,6 +15,11 @@ export type Comparable = {
1115
isNewPropertyProb?: number
1216
pricePerSquareMeter?: number
1317
dissimilarityToTarget?: number
18+
title?: string
19+
street?: string
20+
neighborhood?: string
21+
state?: string
22+
municipality?: string
1423
}
1524

1625
export interface AppraisalRequestOutput {
@@ -71,6 +80,11 @@ export type AppraisalRequestInput = {
7180
m2PrivateTerrace?: number
7281
hasView?: number
7382
developmentAmenities?: DevelopmentAmenities
83+
isNewPropertyProb?: number
84+
isHouse?: number
85+
isSale?: number
86+
floorNumber?: number
87+
bedrooms?: number
7488
}
7589

7690
export type AppraisalRequestInputVariable = Omit<

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const APPRAISAL_PROPERTY_TYPES = {
1010

1111
export const API_RESOURCES_PATH = {
1212
APPRAISALS: 'appraisals',
13-
METRICS: 'metrics'
13+
METRICS: 'metrics',
1414
} as const
1515

1616
export const METRIC_RESOURCES_PATH = {

0 commit comments

Comments
 (0)