Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/ClientBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,23 @@ class ClientBuilder {
return this.withCustomCommaSeperatedQuery("features", "component-analysis");
}

/**
* Adds to the request query to use the financial history feature.
* @return ClientBuilder <b>this</b> to accommodate method chaining.
*/
withFinancialHistory() {
return this.withCustomCommaSeperatedQuery("features", "financial");
}

/**
* Adds to the request query to use the occupant use feature.
* @return ClientBuilder <b>this</b> to accommodate method chaining.
*/
withOccupantUse() {
return this.withCustomCommaSeperatedQuery("features", "occupant-use");
}


buildSender() {
if (this.httpSender) return this.httpSender;

Expand Down
1 change: 1 addition & 0 deletions src/international_street/Candidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ class Candidate {
this.metadata.geocodePrecision = responseData.metadata.geocode_precision;
this.metadata.maxGeocodePrecision = responseData.metadata.max_geocode_precision;
this.metadata.addressFormat = responseData.metadata.address_format;
this.metadata.occupantUse = responseData.metadata.occupant_use;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/us_enrichment/Lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Lookup {
this.exclude = exclude;
this.dataset = dataset;
this.dataSubset = dataSubset;
this.features = undefined;

this.response = {};
this.customParameters = {};
Expand Down
48 changes: 48 additions & 0 deletions src/us_enrichment/Response.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,54 @@ class Response {
this.attributes.exerciseRoom = responseData.attributes.exercise_room;
this.attributes.exteriorWalls = responseData.attributes.exterior_walls;
this.attributes.familyRoom = responseData.attributes.family_room;
this.attributes.financialHistory = !responseData.attributes.financial_history ? [] : responseData.attributes.financial_history.map(history => {
return {
codeTitleCompany: history.code_title_company,
instrumentDate: history.instrument_date,
interestRateType2: history.interest_rate_type_2,
lenderAddress: history.lender_address,
lenderAddress2: history.lender_address_2,
lenderCity: history.lender_city,
lenderCity2: history.lender_city_2,
lenderCode: history.lender_code,
lenderCode2: history.lender_code_2,
lenderFirstName: history.lender_first_name,
lenderFirstName2: history.lender_first_name_2,
lenderLastName: history.lender_last_name,
lenderLastName2: history.lender_last_name_2,
lenderName: history.lender_name,
lenderName2: history.lender_name_2,
lenderSellerCarryBack: history.lender_seller_carry_back,
lenderSellerCarryBack2: history.lender_seller_carry_back_2,
lenderState: history.lender_state,
lenderState2: history.lender_state_2,
lenderZip: history.lender_zip,
lenderZip2: history.lender_zip_2,
lenderZipExtended: history.lender_zip_extended,
lenderZipExtended2: history.lender_zip_extended_2,
mortgageAmount: history.mortgage_amount,
mortgageAmount2: history.mortgage_amount_2,
mortgageDueDate: history.mortgage_due_date,
mortgageDueDate2: history.mortgage_due_date_2,
mortgageInterestRate: history.mortgage_interest_rate,
mortgageInterestRateType: history.mortgage_interest_rate_type,
mortgageLenderCode: history.mortgage_lender_code,
mortgageRate: history.mortgage_rate,
mortgageRate2: history.mortgage_rate_2,
mortgageRecordingDate: history.mortgage_recording_date,
mortgageRecordingDate2: history.mortgage_recording_date_2,
mortgageTerm: history.mortgage_term,
mortgageTerm2: history.mortgage_term_2,
mortgageTermType: history.mortgage_term_type,
mortgageTermType2: history.mortgage_term_type_2,
mortgageType: history.mortgage_type,
mortgageType2: history.mortgage_type_2,
multiParcelFlag: history.multi_parcel_flag,
nameTitleCompany: history.name_title_company,
recordingDate: history.recording_date,
transferAmount: history.transfer_amount,
}
})
this.attributes.fence = responseData.attributes.fence;
this.attributes.fenceArea = responseData.attributes.fence_area;
this.attributes.fipsCode = responseData.attributes.fips_code;
Expand Down
2 changes: 2 additions & 0 deletions tests/international_street/test_Candidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ describe("An International match candidate", function () {
geocode_precision: "54",
max_geocode_precision: "55",
address_format: "56",
occupant_use: "56.5",
},
analysis: {
verification_status: "57",
Expand Down Expand Up @@ -204,6 +205,7 @@ describe("An International match candidate", function () {
expect(metadata.geocodePrecision).to.equal("54");
expect(metadata.maxGeocodePrecision).to.equal("55");
expect(metadata.addressFormat).to.equal("56");
expect(metadata.occupantUse).to.equal("56.5");
let analysis = candidate.analysis;
expect(analysis.verificationStatus).to.equal("57");
expect(analysis.addressPrecision).to.equal("58");
Expand Down
37 changes: 22 additions & 15 deletions tests/us_enrichment/test_Lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,27 @@ const expect = chai.expect;
const Lookup = require("../../src/us_enrichment/Lookup");

describe("A US Enrichment Lookup", function () {
it("can be newed up with all basic fields.", function () {
const expectedSmartyKey = "a";
const expectedInclude = "b";
const expectedExclude = "c";
const expectedDataset = "d";
const expectedDataSubset = "e";

let lookup = new Lookup(expectedSmartyKey, expectedInclude, expectedExclude, expectedDataset, expectedDataSubset);
expect(lookup.smartyKey).to.equal(expectedSmartyKey);
expect(lookup.include).to.equal(expectedInclude);
expect(lookup.exclude).to.equal(expectedExclude);
expect(lookup.dataset).to.equal(expectedDataset);
expect(lookup.dataSubset).to.equal(expectedDataSubset);
});

it("can be newed up with all basic fields.", function () {
const expectedSmartyKey = "a";
const expectedInclude = "b";
const expectedExclude = "c";
const expectedDataset = "d";
const expectedDataSubset = "e";
const expectedFeatures = "f";

let lookup = new Lookup(
expectedSmartyKey,
expectedInclude,
expectedExclude,
expectedDataset,
expectedDataSubset,
);
lookup.features = expectedFeatures;
expect(lookup.smartyKey).to.equal(expectedSmartyKey);
expect(lookup.include).to.equal(expectedInclude);
expect(lookup.exclude).to.equal(expectedExclude);
expect(lookup.dataset).to.equal(expectedDataset);
expect(lookup.dataSubset).to.equal(expectedDataSubset);
expect(lookup.features).to.equal(expectedFeatures);
});
});