File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77This 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 )
Original file line number Diff line number Diff 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 > {
Original file line number Diff line number Diff line change 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
1625export 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
7690export type AppraisalRequestInputVariable = Omit <
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export const APPRAISAL_PROPERTY_TYPES = {
1010
1111export const API_RESOURCES_PATH = {
1212 APPRAISALS : 'appraisals' ,
13- METRICS : 'metrics'
13+ METRICS : 'metrics' ,
1414} as const
1515
1616export const METRIC_RESOURCES_PATH = {
You can’t perform that action at this time.
0 commit comments