From 09230d5173bcaed7c0f3d25811e4c78b55771520 Mon Sep 17 00:00:00 2001 From: Alula Beshue Date: Wed, 7 May 2025 11:37:31 -0700 Subject: [PATCH 1/4] feat: use unit status rather than iterating over leases --- .../sections/Lease.js | 23 ++++++++++++++----- app/javascript/utils/consts.js | 1 + app/services/force/units_service.rb | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/app/javascript/components/supplemental_application/sections/Lease.js b/app/javascript/components/supplemental_application/sections/Lease.js index 9fa5a4bac..5338cfa7c 100644 --- a/app/javascript/components/supplemental_application/sections/Lease.js +++ b/app/javascript/components/supplemental_application/sections/Lease.js @@ -20,11 +20,13 @@ import { getApplicationMembers, totalSetAsidesForPref } from 'components/supplemental_application/utils/supplementalApplicationUtils' +import { UNIT_STATUS_OCCUPIED } from 'utils/consts' import { useAppContext } from 'utils/customHooks' import { CurrencyField, FieldError, Label, SelectField } from 'utils/form/final_form/Field' import { MultiDateField } from 'utils/form/final_form/MultiDateField' import { areLeaseAndRentalAssistancesValid } from 'utils/form/formSectionValidations' import formUtils from 'utils/formUtils' +import { useFeatureFlag } from 'utils/hooks/useFeatureFlag' import { addLayeredPreferenceFields } from 'utils/layeredPreferenceUtil' import { pluck } from 'utils/utils' @@ -119,6 +121,8 @@ const LeaseActions = ({ } const Lease = ({ form, values }) => { + const { unleashFlag: unitStatusFlagEnabled } = useFeatureFlag('partners.unitStatus', false) + const [ { supplementalApplicationData: { supplemental: state } @@ -155,17 +159,24 @@ const Lease = ({ form, values }) => { /** * available units fit the following criteria - * - if it doesn't have any leases - * - if there are leases, they cannot be in draft or signed status - * - if the unit has an application, it must match the current one + * - if unitStatusFlagEnabled, check unit status is not occupied + * - else + * - if it doesn't have any leases + * - if there are leases, they cannot be in draft or signed status + * - if the unit has an application, it must match the current one + * + * todo: clean up feature flag code */ const unavailableStatuses = ['Draft', 'Signed'] - const availableUnits = state.units.filter( - (unit) => + const availableUnits = state.units.filter((unit) => { + if (unitStatusFlagEnabled) return (unit) => unit.status && unit.status !== UNIT_STATUS_OCCUPIED + + return ( !Array.isArray(unit.leases) || !unit.leases.some((lease) => unavailableStatuses.includes(lease.lease_status)) || unit.leases.some((lease) => lease.application_id === state.application.id) - ) + ) + }) const availableUnitsOptions = formUtils.toOptions( map(availableUnits, pluck('id', 'unit_number', 'priority_type')) diff --git a/app/javascript/utils/consts.js b/app/javascript/utils/consts.js index 904e0b14f..7431c9fe2 100644 --- a/app/javascript/utils/consts.js +++ b/app/javascript/utils/consts.js @@ -1 +1,2 @@ export const LISTING_TYPE_FIRST_COME_FIRST_SERVED = 'First Come, First Served' +export const UNIT_STATUS_OCCUPIED = 'Occupied' diff --git a/app/services/force/units_service.rb b/app/services/force/units_service.rb index 5621c653e..4adffd1bc 100644 --- a/app/services/force/units_service.rb +++ b/app/services/force/units_service.rb @@ -16,7 +16,7 @@ def units_and_leases_for_listing(listing_id) .to_soql result = builder.from(:Unit__c) - .select("Id, Priority_Type__c, AMI_chart_type__c, Max_AMI_for_Qualifying_Unit__c, Unit_Number__c, Unit_Type__c, AMI_chart_year__c, (#{lease_query})") + .select("Id, Priority_Type__c, AMI_chart_type__c, Max_AMI_for_Qualifying_Unit__c, Unit_Number__c, Unit_Type__c, AMI_chart_year__c, Status__c, (#{lease_query})") .where_eq('Listing__c', listing_id, :string) .transform_results { |results| massage(results) } .query From 0351c0d0dad88a123b4f6748abed37189ae0ac18 Mon Sep 17 00:00:00 2001 From: Alula Beshue Date: Fri, 9 May 2025 13:18:48 -0700 Subject: [PATCH 2/4] fix: fixing broken tests --- .../SupplementalApplicationPage.test.js | 8 ++++++++ spec/vcr/services/force/unit_service/with_lease.yml | 2 +- spec/vcr/services/force/unit_service/without_lease.yml | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/spec/javascript/components/supplemental_application/SupplementalApplicationPage.test.js b/spec/javascript/components/supplemental_application/SupplementalApplicationPage.test.js index 0172640c3..1e19b37e3 100644 --- a/spec/javascript/components/supplemental_application/SupplementalApplicationPage.test.js +++ b/spec/javascript/components/supplemental_application/SupplementalApplicationPage.test.js @@ -1,4 +1,5 @@ import { render, screen, fireEvent, within, act } from '@testing-library/react' +import { useFlag as useFlagUnleash, useFlagsStatus } from '@unleash/proxy-client-react' import { cloneDeep } from 'lodash' import selectEvent from 'react-select-event' @@ -21,6 +22,13 @@ const getWindowUrl = (id) => `/lease-ups/applications/${id}` const ID_NO_AVAILABLE_UNITS = 'idwithnoavailableunits' const ID_WITH_TOTAL_MONTHLY_RENT = 'idwithtotalmonthlyrent' +jest.mock('@unleash/proxy-client-react') +useFlagUnleash.mockImplementation(() => false) +useFlagsStatus.mockImplementation(() => ({ + flagsError: false, + flagsReady: true +})) + /** * TODO: instead of mocking apiService, we should probably be mocking one level up (actions.js). */ diff --git a/spec/vcr/services/force/unit_service/with_lease.yml b/spec/vcr/services/force/unit_service/with_lease.yml index b7c6d717f..ae059127d 100644 --- a/spec/vcr/services/force/unit_service/with_lease.yml +++ b/spec/vcr/services/force/unit_service/with_lease.yml @@ -53,7 +53,7 @@ http_interactions: recorded_at: Mon, 11 Mar 2024 21:47:14 GMT - request: method: get - uri: https://<>/services/data/v<>/query?q=SELECT%20Id,%20Priority_Type__c,%20AMI_chart_type__c,%20Max_AMI_for_Qualifying_Unit__c,%20Unit_Number__c,%20Unit_Type__c,%20AMI_chart_year__c,%20(SELECT%20Application__c,%20Lease_Status__c,%20Preference_Used_Name__c%20FROM%20Leases__r)%20FROM%20Unit__c%20WHERE%20(Listing__c%20=%20%27a0W0P00000GbyuQUAR%27) + uri: https://<>/services/data/v<>/query?q=SELECT%20Id,%20Priority_Type__c,%20AMI_chart_type__c,%20Max_AMI_for_Qualifying_Unit__c,%20Unit_Number__c,%20Unit_Type__c,%20AMI_chart_year__c,%20Status__c,%20(SELECT%20Application__c,%20Lease_Status__c,%20Preference_Used_Name__c%20FROM%20Leases__r)%20FROM%20Unit__c%20WHERE%20(Listing__c%20=%20%27a0W0P00000GbyuQUAR%27) body: encoding: US-ASCII string: '' diff --git a/spec/vcr/services/force/unit_service/without_lease.yml b/spec/vcr/services/force/unit_service/without_lease.yml index 4389b8fc4..b4e8d97e7 100644 --- a/spec/vcr/services/force/unit_service/without_lease.yml +++ b/spec/vcr/services/force/unit_service/without_lease.yml @@ -53,7 +53,7 @@ http_interactions: recorded_at: Mon, 11 Mar 2024 20:07:30 GMT - request: method: get - uri: https://<>/services/data/v<>/query?q=SELECT%20Id,%20Priority_Type__c,%20AMI_chart_type__c,%20Max_AMI_for_Qualifying_Unit__c,%20Unit_Number__c,%20Unit_Type__c,%20AMI_chart_year__c,%20(SELECT%20Application__c,%20Lease_Status__c,%20Preference_Used_Name__c%20FROM%20Leases__r)%20FROM%20Unit__c%20WHERE%20(Listing__c%20=%20%27a0W0P00000F8YG4UAN%27) + uri: https://<>/services/data/v<>/query?q=SELECT%20Id,%20Priority_Type__c,%20AMI_chart_type__c,%20Max_AMI_for_Qualifying_Unit__c,%20Unit_Number__c,%20Unit_Type__c,%20AMI_chart_year__c,%20Status__c,%20(SELECT%20Application__c,%20Lease_Status__c,%20Preference_Used_Name__c%20FROM%20Leases__r)%20FROM%20Unit__c%20WHERE%20(Listing__c%20=%20%27a0W0P00000F8YG4UAN%27) body: encoding: US-ASCII string: '' From a20f373d826dbebdfc92706b7d323640e1477a96 Mon Sep 17 00:00:00 2001 From: Alula Beshue Date: Fri, 9 May 2025 14:28:07 -0700 Subject: [PATCH 3/4] fix: fixing available units logic and adding tests --- .../sections/Lease.js | 2 +- .../SupplementalApplicationPage.test.js | 23 +++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/app/javascript/components/supplemental_application/sections/Lease.js b/app/javascript/components/supplemental_application/sections/Lease.js index 5338cfa7c..6d853e251 100644 --- a/app/javascript/components/supplemental_application/sections/Lease.js +++ b/app/javascript/components/supplemental_application/sections/Lease.js @@ -169,7 +169,7 @@ const Lease = ({ form, values }) => { */ const unavailableStatuses = ['Draft', 'Signed'] const availableUnits = state.units.filter((unit) => { - if (unitStatusFlagEnabled) return (unit) => unit.status && unit.status !== UNIT_STATUS_OCCUPIED + if (unitStatusFlagEnabled) return unit.status && unit.status !== UNIT_STATUS_OCCUPIED return ( !Array.isArray(unit.leases) || diff --git a/spec/javascript/components/supplemental_application/SupplementalApplicationPage.test.js b/spec/javascript/components/supplemental_application/SupplementalApplicationPage.test.js index 1e19b37e3..d87106280 100644 --- a/spec/javascript/components/supplemental_application/SupplementalApplicationPage.test.js +++ b/spec/javascript/components/supplemental_application/SupplementalApplicationPage.test.js @@ -98,6 +98,7 @@ jest.mock('apiService', () => { unit_type: 'studio', priority_type: null, max_ami_for_qualifying_unit: 50, + status: 'Occupied', leases: [ { application_id: 'testId', @@ -115,13 +116,15 @@ jest.mock('apiService', () => { id: 'unit_without_priority', unit_number: 'unit without priority', priority_type: null, - max_ami_for_qualifying_unit: 50 + max_ami_for_qualifying_unit: 50, + status: 'Available' }), _merge(mockedUnits[1], { id: 'unit_with_priority', unit_number: 'unit with priority', priority_type: 'Hearing/Vision impairments', - max_ami_for_qualifying_unit: 50 + max_ami_for_qualifying_unit: 50, + status: 'Available' }) ] }, @@ -663,6 +666,22 @@ describe('SupplementalApplicationPage', () => { expect(screen.getByTestId('accessibility-available-count').textContent).toBe('0') }) }) + + describe('partners.unitStatus feature toggle', () => { + beforeEach(async () => { + await getWrapper() + }) + + test('shows available units based on leases when toggle is off', () => { + useFlagUnleash.mockImplementation(() => false) + expect(screen.getByTestId('total-available-count').textContent).toBe('2') + }) + + test('shows available units based on unit status when toggle is on', () => { + useFlagUnleash.mockImplementation(() => true) + expect(screen.getByTestId('total-available-count').textContent).toBe('2') + }) + }) }) describe('Status Sidebar', () => { From f72d19ea797e41329b04b7be2e7757f312540f8c Mon Sep 17 00:00:00 2001 From: Alula Beshue Date: Wed, 14 May 2025 10:26:28 -0700 Subject: [PATCH 4/4] chore: recreate cassettes --- .../force/unit_service/with_lease.yml | 175 +++++++++--------- .../force/unit_service/without_lease.yml | 144 ++++++++------ 2 files changed, 178 insertions(+), 141 deletions(-) diff --git a/spec/vcr/services/force/unit_service/with_lease.yml b/spec/vcr/services/force/unit_service/with_lease.yml index ae059127d..3d43378b2 100644 --- a/spec/vcr/services/force/unit_service/with_lease.yml +++ b/spec/vcr/services/force/unit_service/with_lease.yml @@ -8,7 +8,7 @@ http_interactions: string: grant_type=password&client_id=<>&client_secret=<>&username=<>&password=<><> headers: User-Agent: - - Faraday v2.7.4 + - Faraday v2.12.2 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -21,36 +21,44 @@ http_interactions: message: OK headers: Date: - - Mon, 11 Mar 2024 21:47:14 GMT - Set-Cookie: - - BrowserId=7CNey9_wEe69eTkH6Vhq2Q; domain=.salesforce.com; path=/; expires=Tue, - 11-Mar-2025 21:47:14 GMT; Max-Age=31536000 - - CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 21:47:14 GMT; Max-Age=31536000; - secure - - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 21:47:14 - GMT; Max-Age=31536000; secure - Strict-Transport-Security: - - max-age=63072000; includeSubDomains - X-Content-Type-Options: - - nosniff - X-Robots-Tag: - - none - Cache-Control: - - no-cache,must-revalidate,max-age=0,no-store,private - Expires: - - Thu, 01 Jan 1970 00:00:00 GMT - X-Readonlymode: - - 'false' + - Wed, 14 May 2025 17:24:23 GMT Content-Type: - application/json;charset=UTF-8 - Vary: - - Accept-Encoding Transfer-Encoding: - chunked + Connection: + - keep-alive + Vary: + - Accept-Encoding + X-Readonlymode: + - 'false' + X-Robots-Tag: + - none + Expires: + - Thu, 01 Jan 1970 00:00:00 GMT + Strict-Transport-Security: + - max-age=63072000; includeSubDomains + Cache-Control: + - no-cache,must-revalidate,max-age=0,no-store,private + X-Content-Type-Options: + - nosniff + Set-Cookie: + - BrowserId=R0FAmzDoEfCtfye--l_eiQ; domain=.salesforce.com; path=/; expires=Thu, + 14-May-2026 17:24:23 GMT; Max-Age=31536000; secure; SameSite=None + - CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:23 GMT; Max-Age=31536000; + secure + - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:23 + GMT; Max-Age=31536000; secure + Server: + - sfdcedge + X-Sfdc-Request-Id: + - 5bf98f5b37766bf44f4659dfbaa362b1 + X-Request-Id: + - 5bf98f5b37766bf44f4659dfbaa362b1 body: encoding: ASCII-8BIT - string: '{"access_token":"<>","instance_url":"https://<>","id":"https://test.salesforce.com/id/00D8H0000004dNlUAI/0058H000005lZogQAE","token_type":"Bearer","issued_at":"1710193634314","signature":"bgg9jWaMD18uMxaZyuUoYM0edvexvWoXm75uVw0754A="}' - recorded_at: Mon, 11 Mar 2024 21:47:14 GMT + string: '{"access_token":"<>","instance_url":"https://<>","id":"https://test.salesforce.com/id/00Dbb000002NqmLEAS/005U00000066jl9IAA","token_type":"Bearer","issued_at":"1747243463623","signature":"V+0xcvbClsQyxa4NVfhMMm6x+5pDH27BSigAIUmFEjs="}' + recorded_at: Wed, 14 May 2025 17:24:23 GMT - request: method: get uri: https://<>/services/data/v<>/query?q=SELECT%20Id,%20Priority_Type__c,%20AMI_chart_type__c,%20Max_AMI_for_Qualifying_Unit__c,%20Unit_Number__c,%20Unit_Type__c,%20AMI_chart_year__c,%20Status__c,%20(SELECT%20Application__c,%20Lease_Status__c,%20Preference_Used_Name__c%20FROM%20Leases__r)%20FROM%20Unit__c%20WHERE%20(Listing__c%20=%20%27a0W0P00000GbyuQUAR%27) @@ -59,7 +67,7 @@ http_interactions: string: '' headers: User-Agent: - - Faraday v2.7.4 + - Faraday v2.12.2 Authorization: - OAuth <> Accept-Encoding: @@ -72,56 +80,47 @@ http_interactions: message: OK headers: Date: - - Mon, 11 Mar 2024 21:47:14 GMT - Set-Cookie: - - BrowserId=7HIa1t_wEe61Pd0JfiT2KA; domain=.salesforce.com; path=/; expires=Tue, - 11-Mar-2025 21:47:14 GMT; Max-Age=31536000 - - CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 21:47:14 GMT; Max-Age=31536000; - secure - - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 21:47:14 - GMT; Max-Age=31536000; secure + - Wed, 14 May 2025 17:24:24 GMT + Content-Type: + - application/json;charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Robots-Tag: + - none Strict-Transport-Security: - max-age=63072000; includeSubDomains X-Content-Type-Options: - nosniff - X-Robots-Tag: - - none + Sforce-Limit-Info: + - api-usage=28296/982000 Cache-Control: - no-cache,must-revalidate,max-age=0,no-store,private - Sforce-Limit-Info: - - api-usage=15882/930000 - Content-Type: - - application/json;charset=UTF-8 + Set-Cookie: + - BrowserId=R4EwnjDoEfCrHrvfGByfkg; domain=.salesforce.com; path=/; expires=Thu, + 14-May-2026 17:24:23 GMT; Max-Age=31536000; secure; SameSite=None + - CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:23 GMT; Max-Age=31536000; + secure + - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:23 + GMT; Max-Age=31536000; secure Vary: - Accept-Encoding - Transfer-Encoding: - - chunked + Server: + - sfdcedge + X-Sfdc-Request-Id: + - 69f41022f4f35e9d82cc718f23d16201 + X-Request-Id: + - 69f41022f4f35e9d82cc718f23d16201 + X-Sfdc-Edge-Cache: + - MISS body: encoding: ASCII-8BIT - string: '{"totalSize":9,"done":true,"records":[{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHr9QAH"},"Id":"a0b0P00001HIHr9QAH","Priority_Type__c":null,"AMI_chart_type__c":"HUD - Unadjusted","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"101","Unit_Type__c":"1 - BR","AMI_chart_year__c":2018.0,"Leases__r":{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Lease__c","url":"/services/data/v<>/sobjects/Lease__c/a138H000000GWjSQAW"},"Application__c":"a0o0P00000GZazOQAT","Lease_Status__c":"Draft","Preference_Used_Name__c":null}]}},{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHrEQAX"},"Id":"a0b0P00001HIHrEQAX","Priority_Type__c":"Hearing/Vision - impairments","AMI_chart_type__c":"HUD Unadjusted","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"201","Unit_Type__c":"1 - BR","AMI_chart_year__c":2018.0,"Leases__r":{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Lease__c","url":"/services/data/v<>/sobjects/Lease__c/a130P000007U6trQAC"},"Application__c":"a0o0P00000IvWghQAF","Lease_Status__c":"Signed","Preference_Used_Name__c":"Displaced - Tenant Housing Preference (DTHP)"}]}},{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHrJQAX"},"Id":"a0b0P00001HIHrJQAX","Priority_Type__c":null,"AMI_chart_type__c":"HUD - Unadjusted","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"301","Unit_Type__c":"1 - BR","AMI_chart_year__c":2018.0,"Leases__r":{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Lease__c","url":"/services/data/v<>/sobjects/Lease__c/a130P000007U6tgQAC"},"Application__c":"a0o0P00000Iv7H4QAJ","Lease_Status__c":"Draft","Preference_Used_Name__c":null}]}},{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHrTQAX"},"Id":"a0b0P00001HIHrTQAX","Priority_Type__c":"Mobility - impairments","AMI_chart_type__c":"HUD Unadjusted","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"103","Unit_Type__c":"2 - BR","AMI_chart_year__c":2018.0,"Leases__r":null},{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHrYQAX"},"Id":"a0b0P00001HIHrYQAX","Priority_Type__c":null,"AMI_chart_type__c":"HUD - Unadjusted","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"203","Unit_Type__c":"2 - BR","AMI_chart_year__c":2018.0,"Leases__r":{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Lease__c","url":"/services/data/v<>/sobjects/Lease__c/a130P000007U6tiQAC"},"Application__c":"a0o0P00000GZazsQAD","Lease_Status__c":"Draft","Preference_Used_Name__c":"Certificate - of Preference (COP)"}]}},{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHrdQAH"},"Id":"a0b0P00001HIHrdQAH","Priority_Type__c":null,"AMI_chart_type__c":"HUD - Unadjusted","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"303","Unit_Type__c":"2 - BR","AMI_chart_year__c":2018.0,"Leases__r":{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Lease__c","url":"/services/data/v<>/sobjects/Lease__c/a130P000007U6tfQAC"},"Application__c":"a0o0P00000Isnf4QAB","Lease_Status__c":"Draft","Preference_Used_Name__c":"Displaced - Tenant Housing Preference (DTHP)"}]}},{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHrnQAH"},"Id":"a0b0P00001HIHrnQAH","Priority_Type__c":"Mobility/Hearing/Vision - impairments","AMI_chart_type__c":"HUD Unadjusted","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"105","Unit_Type__c":"3 - BR","AMI_chart_year__c":2018.0,"Leases__r":null},{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHrsQAH"},"Id":"a0b0P00001HIHrsQAH","Priority_Type__c":null,"AMI_chart_type__c":"HUD - Unadjusted","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"205","Unit_Type__c":"3 - BR","AMI_chart_year__c":2018.0,"Leases__r":{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Lease__c","url":"/services/data/v<>/sobjects/Lease__c/a130P000007U6thQAC"},"Application__c":"a0o0P00000IvWgXQAV","Lease_Status__c":"Draft","Preference_Used_Name__c":"Live - or Work in San Francisco Preference"}]}},{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHrxQAH"},"Id":"a0b0P00001HIHrxQAH","Priority_Type__c":null,"AMI_chart_type__c":"HUD - Unadjusted","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"305","Unit_Type__c":"3 - BR","AMI_chart_year__c":2018.0,"Leases__r":null}]}' - recorded_at: Mon, 11 Mar 2024 21:47:14 GMT + string: '{"totalSize":2,"done":true,"records":[{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHr9QAH"},"Id":"a0b0P00001HIHr9QAH","Priority_Type__c":null,"AMI_chart_type__c":"MOHCD","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"101","Unit_Type__c":"Studio","AMI_chart_year__c":2024.0,"Status__c":"Occupied","Leases__r":{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Lease__c","url":"/services/data/v<>/sobjects/Lease__c/a130P000007B4ugQAC"},"Application__c":"a0o0P00000ItlpiQAB","Lease_Status__c":"Draft","Preference_Used_Name__c":"Live + or Work in San Francisco Preference"}]}},{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001HIHrEQAX"},"Id":"a0b0P00001HIHrEQAX","Priority_Type__c":"Hearing/Vision + impairments","AMI_chart_type__c":"MOHCD","Max_AMI_for_Qualifying_Unit__c":55.0,"Unit_Number__c":"201","Unit_Type__c":"Studio","AMI_chart_year__c":2024.0,"Status__c":"Occupied","Leases__r":{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Lease__c","url":"/services/data/v<>/sobjects/Lease__c/a130P000007U6trQAC"},"Application__c":"a0o0P00000IvWghQAF","Lease_Status__c":"Signed","Preference_Used_Name__c":"Displaced + Tenant Housing Preference (DTHP)"}]}}]}' + recorded_at: Wed, 14 May 2025 17:24:24 GMT - request: method: get uri: https://<>/services/data/v<>/query?q=SELECT%20count()%20FROM%20Unit__c%20WHERE%20(Listing__c%20=%20%27a0W0P00000GbyuQUAR%27) @@ -130,7 +129,7 @@ http_interactions: string: '' headers: User-Agent: - - Faraday v2.7.4 + - Faraday v2.12.2 Authorization: - OAuth <> Accept-Encoding: @@ -143,32 +142,42 @@ http_interactions: message: OK headers: Date: - - Mon, 11 Mar 2024 21:47:15 GMT + - Wed, 14 May 2025 17:24:24 GMT + Content-Type: + - application/json;charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive Set-Cookie: - - BrowserId=7Lq84N_wEe60f3myxJslPg; domain=.salesforce.com; path=/; expires=Tue, - 11-Mar-2025 21:47:15 GMT; Max-Age=31536000 - - CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 21:47:15 GMT; Max-Age=31536000; + - BrowserId=R7-Y_jDoEfCfBlXyeAIwAQ; domain=.salesforce.com; path=/; expires=Thu, + 14-May-2026 17:24:24 GMT; Max-Age=31536000; secure; SameSite=None + - CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:24 GMT; Max-Age=31536000; secure - - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 21:47:15 + - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:24 GMT; Max-Age=31536000; secure + Sforce-Limit-Info: + - api-usage=28288/982000 Strict-Transport-Security: - max-age=63072000; includeSubDomains - X-Content-Type-Options: - - nosniff X-Robots-Tag: - none Cache-Control: - no-cache,must-revalidate,max-age=0,no-store,private - Sforce-Limit-Info: - - api-usage=15882/930000 - Content-Type: - - application/json;charset=UTF-8 + X-Content-Type-Options: + - nosniff Vary: - Accept-Encoding - Transfer-Encoding: - - chunked + Server: + - sfdcedge + X-Sfdc-Request-Id: + - 8d18cbadb05367a6f2b80d37d18dda21 + X-Request-Id: + - 8d18cbadb05367a6f2b80d37d18dda21 + X-Sfdc-Edge-Cache: + - MISS body: encoding: ASCII-8BIT - string: '{"totalSize":9,"done":true,"records":[]}' - recorded_at: Mon, 11 Mar 2024 21:47:15 GMT -recorded_with: VCR 6.1.0 + string: '{"totalSize":2,"done":true,"records":[]}' + recorded_at: Wed, 14 May 2025 17:24:24 GMT +recorded_with: VCR 6.3.1 diff --git a/spec/vcr/services/force/unit_service/without_lease.yml b/spec/vcr/services/force/unit_service/without_lease.yml index b4e8d97e7..13a31d8df 100644 --- a/spec/vcr/services/force/unit_service/without_lease.yml +++ b/spec/vcr/services/force/unit_service/without_lease.yml @@ -8,7 +8,7 @@ http_interactions: string: grant_type=password&client_id=<>&client_secret=<>&username=<>&password=<><> headers: User-Agent: - - Faraday v2.7.4 + - Faraday v2.12.2 Content-Type: - application/x-www-form-urlencoded Accept-Encoding: @@ -21,36 +21,44 @@ http_interactions: message: OK headers: Date: - - Mon, 11 Mar 2024 20:07:30 GMT - Set-Cookie: - - BrowserId=_VbIR9_iEe60in2bx7SPgA; domain=.salesforce.com; path=/; expires=Tue, - 11-Mar-2025 20:07:30 GMT; Max-Age=31536000 - - CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 20:07:30 GMT; Max-Age=31536000; - secure - - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 20:07:30 - GMT; Max-Age=31536000; secure - Strict-Transport-Security: - - max-age=63072000; includeSubDomains - X-Content-Type-Options: - - nosniff - X-Robots-Tag: - - none + - Wed, 14 May 2025 17:24:24 GMT + Content-Type: + - application/json;charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive Cache-Control: - no-cache,must-revalidate,max-age=0,no-store,private + Vary: + - Accept-Encoding + Strict-Transport-Security: + - max-age=63072000; includeSubDomains Expires: - Thu, 01 Jan 1970 00:00:00 GMT + X-Robots-Tag: + - none X-Readonlymode: - 'false' - Content-Type: - - application/json;charset=UTF-8 - Vary: - - Accept-Encoding - Transfer-Encoding: - - chunked + Set-Cookie: + - BrowserId=R_WdZzDoEfCrmwUBlEEFzQ; domain=.salesforce.com; path=/; expires=Thu, + 14-May-2026 17:24:24 GMT; Max-Age=31536000; secure; SameSite=None + - CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:24 GMT; Max-Age=31536000; + secure + - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:24 + GMT; Max-Age=31536000; secure + X-Content-Type-Options: + - nosniff + Server: + - sfdcedge + X-Sfdc-Request-Id: + - cb4db3bab95bd4d03954ac80c9899a5e + X-Request-Id: + - cb4db3bab95bd4d03954ac80c9899a5e body: encoding: ASCII-8BIT - string: '{"access_token":"<>","instance_url":"https://<>","id":"https://test.salesforce.com/id/00D8H0000004dNlUAI/0058H000005lZogQAE","token_type":"Bearer","issued_at":"1710187650198","signature":"jAYe46Oh4KLEB860qIhGGs9ISJigBkYSnA4V6npneWQ="}' - recorded_at: Mon, 11 Mar 2024 20:07:30 GMT + string: '{"access_token":"<>","instance_url":"https://<>","id":"https://test.salesforce.com/id/00Dbb000002NqmLEAS/005U00000066jl9IAA","token_type":"Bearer","issued_at":"1747243464773","signature":"WoCOizkbOiS6FFZv1cp9oD2NziLW5FPQyb9NcXwSfbc="}' + recorded_at: Wed, 14 May 2025 17:24:24 GMT - request: method: get uri: https://<>/services/data/v<>/query?q=SELECT%20Id,%20Priority_Type__c,%20AMI_chart_type__c,%20Max_AMI_for_Qualifying_Unit__c,%20Unit_Number__c,%20Unit_Type__c,%20AMI_chart_year__c,%20Status__c,%20(SELECT%20Application__c,%20Lease_Status__c,%20Preference_Used_Name__c%20FROM%20Leases__r)%20FROM%20Unit__c%20WHERE%20(Listing__c%20=%20%27a0W0P00000F8YG4UAN%27) @@ -59,7 +67,7 @@ http_interactions: string: '' headers: User-Agent: - - Faraday v2.7.4 + - Faraday v2.12.2 Authorization: - OAuth <> Accept-Encoding: @@ -72,36 +80,46 @@ http_interactions: message: OK headers: Date: - - Mon, 11 Mar 2024 20:07:30 GMT + - Wed, 14 May 2025 17:24:25 GMT + Content-Type: + - application/json;charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive Set-Cookie: - - BrowserId=_Z7N2d_iEe6ikK-JvnZ1Rg; domain=.salesforce.com; path=/; expires=Tue, - 11-Mar-2025 20:07:30 GMT; Max-Age=31536000 - - CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 20:07:30 GMT; Max-Age=31536000; + - BrowserId=SC2c8jDoEfCEubkvfpTtqg; domain=.salesforce.com; path=/; expires=Thu, + 14-May-2026 17:24:24 GMT; Max-Age=31536000; secure; SameSite=None + - CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:24 GMT; Max-Age=31536000; secure - - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 20:07:30 + - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:24 GMT; Max-Age=31536000; secure - Strict-Transport-Security: - - max-age=63072000; includeSubDomains X-Content-Type-Options: - nosniff + Strict-Transport-Security: + - max-age=63072000; includeSubDomains X-Robots-Tag: - none Cache-Control: - no-cache,must-revalidate,max-age=0,no-store,private Sforce-Limit-Info: - - api-usage=15687/930000 - Content-Type: - - application/json;charset=UTF-8 + - api-usage=28260/982000 Vary: - Accept-Encoding - Transfer-Encoding: - - chunked + Server: + - sfdcedge + X-Sfdc-Request-Id: + - 99bb366b2b8f721fbbddc87e2fe0d38a + X-Request-Id: + - 99bb366b2b8f721fbbddc87e2fe0d38a + X-Sfdc-Edge-Cache: + - MISS body: encoding: ASCII-8BIT string: '{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Unit__c","url":"/services/data/v<>/sobjects/Unit__c/a0b0P00001Fb3yNQAR"},"Id":"a0b0P00001Fb3yNQAR","Priority_Type__c":null,"AMI_chart_type__c":"HUD Unadjusted","Max_AMI_for_Qualifying_Unit__c":100.0,"Unit_Number__c":"311","Unit_Type__c":"1 - BR","AMI_chart_year__c":2016.0,"Leases__r":null}]}' - recorded_at: Mon, 11 Mar 2024 20:07:30 GMT + BR","AMI_chart_year__c":2016.0,"Status__c":"Available","Leases__r":null}]}' + recorded_at: Wed, 14 May 2025 17:24:25 GMT - request: method: get uri: https://<>/services/data/v<>/query?q=SELECT%20count()%20FROM%20Unit__c%20WHERE%20(Listing__c%20=%20%27a0W0P00000F8YG4UAN%27) @@ -110,7 +128,7 @@ http_interactions: string: '' headers: User-Agent: - - Faraday v2.7.4 + - Faraday v2.12.2 Authorization: - OAuth <> Accept-Encoding: @@ -123,32 +141,42 @@ http_interactions: message: OK headers: Date: - - Mon, 11 Mar 2024 20:07:30 GMT + - Wed, 14 May 2025 17:24:25 GMT + Content-Type: + - application/json;charset=UTF-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + Vary: + - Accept-Encoding + X-Robots-Tag: + - none + Sforce-Limit-Info: + - api-usage=28261/982000 + Strict-Transport-Security: + - max-age=63072000; includeSubDomains Set-Cookie: - - BrowserId=_d_1i9_iEe60f3myxJslPg; domain=.salesforce.com; path=/; expires=Tue, - 11-Mar-2025 20:07:30 GMT; Max-Age=31536000 - - CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 20:07:30 GMT; Max-Age=31536000; + - BrowserId=SFh9hDDoEfCEubkvfpTtqg; domain=.salesforce.com; path=/; expires=Thu, + 14-May-2026 17:24:25 GMT; Max-Age=31536000; secure; SameSite=None + - CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:25 GMT; Max-Age=31536000; secure - - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Tue, 11-Mar-2025 20:07:30 + - LSKey-c$CookieConsentPolicy=0:1; path=/; expires=Thu, 14-May-2026 17:24:25 GMT; Max-Age=31536000; secure - Strict-Transport-Security: - - max-age=63072000; includeSubDomains X-Content-Type-Options: - nosniff - X-Robots-Tag: - - none Cache-Control: - no-cache,must-revalidate,max-age=0,no-store,private - Sforce-Limit-Info: - - api-usage=15691/930000 - Content-Type: - - application/json;charset=UTF-8 - Vary: - - Accept-Encoding - Transfer-Encoding: - - chunked + Server: + - sfdcedge + X-Sfdc-Request-Id: + - 4def54acd5e68397fdbd07ff07d6f5cc + X-Request-Id: + - 4def54acd5e68397fdbd07ff07d6f5cc + X-Sfdc-Edge-Cache: + - MISS body: encoding: ASCII-8BIT string: '{"totalSize":1,"done":true,"records":[]}' - recorded_at: Mon, 11 Mar 2024 20:07:31 GMT -recorded_with: VCR 6.1.0 + recorded_at: Wed, 14 May 2025 17:24:25 GMT +recorded_with: VCR 6.3.1