From 28158507b6bf3fe2d8b4e92d8a54da6ad44c6d72 Mon Sep 17 00:00:00 2001 From: Andres Bolocco Date: Tue, 23 Jun 2020 10:48:14 -0300 Subject: [PATCH] fix southwest gas remove zipcode from address --- lib/documentProcessor.test.js | 2 +- lib/documentTypes/southwestGasBill.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/documentProcessor.test.js b/lib/documentProcessor.test.js index 1502574..317c3d9 100644 --- a/lib/documentProcessor.test.js +++ b/lib/documentProcessor.test.js @@ -76,7 +76,7 @@ it('Expect SOUTHWESTGAS bill to be detected and processed', async () => { expect(response.documentType).toBe('Southwest Gas'); expect(response.extracted.first_name).toBe('CHARLES'); expect(response.extracted.last_name).toBe('DOE'); - expect(response.extracted.street_address_line_1).toBe('2561 W ARCADIA LN 85310'); + expect(response.extracted.street_address_line_1).toBe('2561 W ARCADIA LN'); expect(response.extracted.street_address_line_2).toBe(''); expect(response.extracted.city).toBe('PHOENIX'); expect(response.extracted.state).toBe('AZ'); diff --git a/lib/documentTypes/southwestGasBill.js b/lib/documentTypes/southwestGasBill.js index ef9c4ea..5a9b557 100644 --- a/lib/documentTypes/southwestGasBill.js +++ b/lib/documentTypes/southwestGasBill.js @@ -52,6 +52,8 @@ module.exports = { street_address_line_1 = rawText[lineWithCityStateZipCodeIndex - 1]; } + street_address_line_1 = street_address_line_1.split(' ').slice(0, -1).join(' '); + const street_address_line_2 = ''; // city, state, zip code