From 7714dabe26d03bd51ab243a7f3be9fef7bba3a3b Mon Sep 17 00:00:00 2001 From: krzysztof ziecina Date: Thu, 9 Jul 2026 17:00:26 +0200 Subject: [PATCH 1/2] fix: add six and seven bedrooms --- .../migration.sql | 3 ++ api/prisma/schema.prisma | 2 + api/prisma/seed-helpers/unit-type-factory.ts | 2 + .../utilities/application-export-helpers.ts | 2 + api/src/utilities/unit-utilities.ts | 5 ++ api/test/integration/unit-type.e2e-spec.ts | 4 +- .../unit/services/listing.service.spec.ts | 54 +++++++++++++++---- .../application-export-helpers.spec.ts | 6 +++ shared-helpers/__tests__/testHelpers.ts | 14 +++++ shared-helpers/__tests__/unitTypes.test.ts | 8 +++ shared-helpers/src/locales/ar.json | 6 +++ shared-helpers/src/locales/bn.json | 6 +++ shared-helpers/src/locales/es.json | 6 +++ shared-helpers/src/locales/fa.json | 6 +++ shared-helpers/src/locales/general.json | 6 +++ shared-helpers/src/locales/hy.json | 6 +++ shared-helpers/src/locales/ko.json | 6 +++ shared-helpers/src/locales/tl.json | 6 +++ shared-helpers/src/locales/vi.json | 6 +++ shared-helpers/src/locales/zh.json | 6 +++ shared-helpers/src/types/backend-swagger.ts | 5 ++ shared-helpers/src/utilities/formKeys.ts | 2 + shared-helpers/src/utilities/unitTypes.ts | 2 + .../PaperListingForm/UnitForm.test.tsx | 2 +- .../page_content/locales/general.json | 2 + .../src/lib/listings/UnitsFormatter.ts | 6 +++ .../browse/FilterDrawerHelpers.test.tsx | 4 ++ .../components/browse/FilterDrawerHelpers.tsx | 10 ++++ 28 files changed, 180 insertions(+), 13 deletions(-) create mode 100644 api/prisma/migrations/20260709084452_add_six_and_seven_bedroom_unit_types/migration.sql diff --git a/api/prisma/migrations/20260709084452_add_six_and_seven_bedroom_unit_types/migration.sql b/api/prisma/migrations/20260709084452_add_six_and_seven_bedroom_unit_types/migration.sql new file mode 100644 index 00000000000..9342c3a1baf --- /dev/null +++ b/api/prisma/migrations/20260709084452_add_six_and_seven_bedroom_unit_types/migration.sql @@ -0,0 +1,3 @@ +-- AlterEnum +ALTER TYPE "unit_type_enum" ADD VALUE 'sixBdrm'; +ALTER TYPE "unit_type_enum" ADD VALUE 'sevenBdrm'; diff --git a/api/prisma/schema.prisma b/api/prisma/schema.prisma index 2b147b50807..86cbeb8cc33 100644 --- a/api/prisma/schema.prisma +++ b/api/prisma/schema.prisma @@ -2590,6 +2590,8 @@ enum UnitTypeEnum { fourBdrm SRO fiveBdrm + sixBdrm + sevenBdrm @@map("unit_type_enum") } diff --git a/api/prisma/seed-helpers/unit-type-factory.ts b/api/prisma/seed-helpers/unit-type-factory.ts index 443ade292d5..e3a2dffb7dd 100644 --- a/api/prisma/seed-helpers/unit-type-factory.ts +++ b/api/prisma/seed-helpers/unit-type-factory.ts @@ -43,4 +43,6 @@ export const unitTypeMapping = { [UnitTypeEnum.threeBdrm]: 3, [UnitTypeEnum.fourBdrm]: 4, [UnitTypeEnum.fiveBdrm]: 5, + [UnitTypeEnum.sixBdrm]: 6, + [UnitTypeEnum.sevenBdrm]: 7, }; diff --git a/api/src/utilities/application-export-helpers.ts b/api/src/utilities/application-export-helpers.ts index 0480a0ad6ce..a948c896bd8 100644 --- a/api/src/utilities/application-export-helpers.ts +++ b/api/src/utilities/application-export-helpers.ts @@ -1091,6 +1091,8 @@ export const typeMap = { threeBdrm: 'Three Bedroom', fourBdrm: 'Four+ Bedroom', fiveBdrm: 'Five Bedroom', + sixBdrm: 'Six Bedroom', + sevenBdrm: 'Seven+ Bedroom', }; /** diff --git a/api/src/utilities/unit-utilities.ts b/api/src/utilities/unit-utilities.ts index 32dbfbb6c60..a11a897ea47 100644 --- a/api/src/utilities/unit-utilities.ts +++ b/api/src/utilities/unit-utilities.ts @@ -26,6 +26,8 @@ export const UnitTypeSort = [ UnitTypeEnum.threeBdrm, UnitTypeEnum.fourBdrm, UnitTypeEnum.fiveBdrm, + UnitTypeEnum.sixBdrm, + UnitTypeEnum.sevenBdrm, ]; export const usd = new Intl.NumberFormat('en-US', { @@ -176,6 +178,9 @@ export const generateHmiData = ( 'listings.unitTypes.twoBdrm', 'listings.unitTypes.threeBdrm', 'listings.unitTypes.fourBdrm', + 'listings.unitTypes.fiveBdrm', + 'listings.unitTypes.sixBdrm', + 'listings.unitTypes.sevenBdrm', ]; // this is to map currentHouseholdSize to a units max occupancy const unitOccupancy = []; diff --git a/api/test/integration/unit-type.e2e-spec.ts b/api/test/integration/unit-type.e2e-spec.ts index 374184a3a5b..21e33bd2ade 100644 --- a/api/test/integration/unit-type.e2e-spec.ts +++ b/api/test/integration/unit-type.e2e-spec.ts @@ -62,11 +62,13 @@ describe('UnitType Controller Tests', () => { .set('Cookie', cookies) .expect(200); // all unit types are returned - expect(res.body.length).toBeGreaterThanOrEqual(7); + expect(res.body.length).toBeGreaterThanOrEqual(9); // check for random unit types const unitTypeNames = res.body.map((value) => value.name); expect(unitTypeNames).toContain(UnitTypeEnum.SRO); expect(unitTypeNames).toContain(UnitTypeEnum.threeBdrm); + expect(unitTypeNames).toContain(UnitTypeEnum.sixBdrm); + expect(unitTypeNames).toContain(UnitTypeEnum.sevenBdrm); }); it("retrieve endpoint with id that doesn't exist should error", async () => { diff --git a/api/test/unit/services/listing.service.spec.ts b/api/test/unit/services/listing.service.spec.ts index 4aeab5c85ac..2d875e451f4 100644 --- a/api/test/unit/services/listing.service.spec.ts +++ b/api/test/unit/services/listing.service.spec.ts @@ -1256,7 +1256,7 @@ describe('Testing listing service', () => { occupancyRange: { min: 1, max: 8 }, rentRange: { min: '$1', max: '$8' }, rentAsPercentIncomeRange: { min: 1, max: 1 }, - floorRange: { min: 1, max: 8 }, + floorRange: { min: 1, max: 1 }, unitTypes: { id: 'unitType 1', createdAt: date, @@ -1264,7 +1264,7 @@ describe('Testing listing service', () => { name: 'studio', numBedrooms: 1, }, - totalAvailable: 2, + totalAvailable: 1, }, { areaRange: { min: 2, max: 2 }, @@ -1346,6 +1346,38 @@ describe('Testing listing service', () => { }, totalAvailable: 1, }, + { + areaRange: { min: 7, max: 7 }, + minIncomeRange: { min: '$7', max: '$7' }, + occupancyRange: { min: 7, max: 7 }, + rentRange: { min: '$7', max: '$7' }, + rentAsPercentIncomeRange: { min: 7, max: 7 }, + floorRange: { min: 7, max: 7 }, + unitTypes: { + id: 'unitType 7', + createdAt: date, + updatedAt: date, + name: 'sixBdrm', + numBedrooms: 7, + }, + totalAvailable: 1, + }, + { + areaRange: { min: 8, max: 8 }, + minIncomeRange: { min: '$8', max: '$8' }, + occupancyRange: { min: 8, max: 8 }, + rentRange: { min: '$8', max: '$8' }, + rentAsPercentIncomeRange: { min: 8, max: 8 }, + floorRange: { min: 8, max: 8 }, + unitTypes: { + id: 'unitType 8', + createdAt: date, + updatedAt: date, + name: 'sevenBdrm', + numBedrooms: 8, + }, + totalAvailable: 1, + }, ], priorityTypes: [UnitAccessibilityPriorityTypeEnum.mobility], }); @@ -3230,13 +3262,13 @@ describe('Testing listing service', () => { minIncomeRange: { min: '$7', max: '$7' }, occupancyRange: { min: 7, max: 7 }, rentRange: { min: '$7', max: '$7' }, - rentAsPercentIncomeRange: { min: 0, max: 0 }, + rentAsPercentIncomeRange: { min: 7, max: 7 }, floorRange: { min: 7, max: 7 }, unitTypes: { id: 'unitType 7', createdAt: date, updatedAt: date, - name: 'SRO', + name: 'sixBdrm', numBedrooms: 7, }, totalAvailable: 1, @@ -3251,13 +3283,13 @@ describe('Testing listing service', () => { minIncomeRange: { min: '$8', max: '$8' }, occupancyRange: { min: 8, max: 8 }, rentRange: { min: '$8', max: '$8' }, - rentAsPercentIncomeRange: { min: 1, max: 1 }, + rentAsPercentIncomeRange: { min: 8, max: 8 }, floorRange: { min: 8, max: 8 }, unitTypes: { id: 'unitType 8', createdAt: date, updatedAt: date, - name: 'studio', + name: 'sevenBdrm', numBedrooms: 8, }, totalAvailable: 1, @@ -3272,13 +3304,13 @@ describe('Testing listing service', () => { minIncomeRange: { min: '$9', max: '$9' }, occupancyRange: { min: 9, max: 9 }, rentRange: { min: '$9', max: '$9' }, - rentAsPercentIncomeRange: { min: 2, max: 2 }, + rentAsPercentIncomeRange: { min: 0, max: 0 }, floorRange: { min: 9, max: 9 }, unitTypes: { id: 'unitType 9', createdAt: date, updatedAt: date, - name: 'oneBdrm', + name: 'SRO', numBedrooms: 9, }, totalAvailable: 1, @@ -3339,21 +3371,21 @@ describe('Testing listing service', () => { { createdAt: date, id: 'unitType 7', - name: 'SRO', + name: 'sixBdrm', numBedrooms: 7, updatedAt: date, }, { createdAt: date, id: 'unitType 8', - name: 'studio', + name: 'sevenBdrm', numBedrooms: 8, updatedAt: date, }, { createdAt: date, id: 'unitType 9', - name: 'oneBdrm', + name: 'SRO', numBedrooms: 9, updatedAt: date, }, diff --git a/api/test/unit/utilities/application-export-helpers.spec.ts b/api/test/unit/utilities/application-export-helpers.spec.ts index e2db06fe7e4..3a7d2f7672b 100644 --- a/api/test/unit/utilities/application-export-helpers.spec.ts +++ b/api/test/unit/utilities/application-export-helpers.spec.ts @@ -882,6 +882,9 @@ describe('Testing application export helpers', () => { 'twoBdrm', 'threeBdrm', 'fourBdrm', + 'fiveBdrm', + 'sixBdrm', + 'sevenBdrm', ]; const readableTypes = [ @@ -891,6 +894,9 @@ describe('Testing application export helpers', () => { 'Two Bedroom', 'Three Bedroom', 'Four+ Bedroom', + 'Five Bedroom', + 'Six Bedroom', + 'Seven+ Bedroom', ]; for (let i = 0; i < types.length; i++) { diff --git a/shared-helpers/__tests__/testHelpers.ts b/shared-helpers/__tests__/testHelpers.ts index 76c32f4608e..e139fb3728d 100644 --- a/shared-helpers/__tests__/testHelpers.ts +++ b/shared-helpers/__tests__/testHelpers.ts @@ -484,6 +484,20 @@ export const unitTypes: UnitType[] = [ name: UnitTypeEnum.fiveBdrm, numBedrooms: 5, }, + { + id: "b3f2a6b1-3c4d-4e5f-8a9b-0c1d2e3f4a5b", + createdAt: new Date(), + updatedAt: new Date(), + name: UnitTypeEnum.sixBdrm, + numBedrooms: 6, + }, + { + id: "c4a3b7c2-4d5e-4f60-9b0c-1d2e3f4a5b6c", + createdAt: new Date(), + updatedAt: new Date(), + name: UnitTypeEnum.sevenBdrm, + numBedrooms: 7, + }, ] export const unitGroup: UnitGroup = { diff --git a/shared-helpers/__tests__/unitTypes.test.ts b/shared-helpers/__tests__/unitTypes.test.ts index 6197af5ad9a..4a267b4c727 100644 --- a/shared-helpers/__tests__/unitTypes.test.ts +++ b/shared-helpers/__tests__/unitTypes.test.ts @@ -21,6 +21,8 @@ describe("unit type: sortUnitTypes helper", () => { { id: "twoBdrm", name: "twoBdrm" }, { id: "threeBdrm", name: "threeBdrm" }, { id: "fourBdrm", name: "fourBdrm" }, + { id: "sixBdrm", name: "sixBdrm" }, + { id: "sevenBdrm", name: "sevenBdrm" }, ]) ).toStrictEqual([ { id: "SRO", name: "sro" }, @@ -29,14 +31,18 @@ describe("unit type: sortUnitTypes helper", () => { { id: "twoBdrm", name: "twoBdrm" }, { id: "threeBdrm", name: "threeBdrm" }, { id: "fourBdrm", name: "fourBdrm" }, + { id: "sixBdrm", name: "sixBdrm" }, + { id: "sevenBdrm", name: "sevenBdrm" }, ]) expect( sortUnitTypes([ + { id: "sevenBdrm", name: "sevenBdrm" }, { id: "fourBdrm", name: "fourBdrm" }, { id: "studio", name: "studio" }, { id: "oneBdrm", name: "oneBdrm" }, { id: "twoBdrm", name: "twoBdrm" }, { id: "threeBdrm", name: "threeBdrm" }, + { id: "sixBdrm", name: "sixBdrm" }, { id: "SRO", name: "sro" }, ]) ).toStrictEqual([ @@ -46,6 +52,8 @@ describe("unit type: sortUnitTypes helper", () => { { id: "twoBdrm", name: "twoBdrm" }, { id: "threeBdrm", name: "threeBdrm" }, { id: "fourBdrm", name: "fourBdrm" }, + { id: "sixBdrm", name: "sixBdrm" }, + { id: "sevenBdrm", name: "sevenBdrm" }, ]) }) it("should sort complex arrays", () => { diff --git a/shared-helpers/src/locales/ar.json b/shared-helpers/src/locales/ar.json index aaa5ecb634d..b8aae37874d 100644 --- a/shared-helpers/src/locales/ar.json +++ b/shared-helpers/src/locales/ar.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "5 غرف نوم", "application.household.preferredUnit.options.fourBdrm": "4 غرف نوم", "application.household.preferredUnit.options.oneBdrm": "غرفة نوم واحدة", + "application.household.preferredUnit.options.sevenBdrm": "7 غرف نوم", + "application.household.preferredUnit.options.sixBdrm": "6 غرف نوم", "application.household.preferredUnit.options.SRO": "منظمة SRO", "application.household.preferredUnit.options.studio": "ستوديو", "application.household.preferredUnit.options.threeBdrm": "3 غرف نوم", @@ -1103,11 +1105,15 @@ "listings.unitTypes.expanded.fiveBdrm": "5 غرف نوم", "listings.unitTypes.expanded.fourBdrm": "4 غرف نوم", "listings.unitTypes.expanded.oneBdrm": "غرفة نوم واحدة", + "listings.unitTypes.expanded.sevenBdrm": "7 غرف نوم", + "listings.unitTypes.expanded.sixBdrm": "6 غرف نوم", "listings.unitTypes.expanded.threeBdrm": "3 غرف نوم", "listings.unitTypes.expanded.twoBdrm": "غرفتي نوم", "listings.unitTypes.fiveBdrm": "5 غرف نوم", "listings.unitTypes.fourBdrm": "4 غرف نوم", "listings.unitTypes.oneBdrm": "غرفة نوم واحدة", + "listings.unitTypes.sevenBdrm": "7 غرف نوم", + "listings.unitTypes.sixBdrm": "6 غرف نوم", "listings.unitTypes.SRO": "إشغال الغرفة الفردية", "listings.unitTypes.studio": "ستوديو", "listings.unitTypes.threeBdrm": "3 غرف نوم", diff --git a/shared-helpers/src/locales/bn.json b/shared-helpers/src/locales/bn.json index afb6a0d4baa..910f908dcfd 100644 --- a/shared-helpers/src/locales/bn.json +++ b/shared-helpers/src/locales/bn.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "৫টি শোবার ঘর", "application.household.preferredUnit.options.fourBdrm": "৪টি শোবার ঘর", "application.household.preferredUnit.options.oneBdrm": "১টি শোবার ঘর", + "application.household.preferredUnit.options.sevenBdrm": "৭টি শোবার ঘর", + "application.household.preferredUnit.options.sixBdrm": "৬টি শোবার ঘর", "application.household.preferredUnit.options.SRO": "এসআরও", "application.household.preferredUnit.options.studio": "স্টুডিও", "application.household.preferredUnit.options.threeBdrm": "৩টি শোবার ঘর", @@ -1103,11 +1105,15 @@ "listings.unitTypes.expanded.fiveBdrm": "৫টি শোবার ঘর", "listings.unitTypes.expanded.fourBdrm": "৪টি শোবার ঘর", "listings.unitTypes.expanded.oneBdrm": "১টি শোবার ঘর", + "listings.unitTypes.expanded.sevenBdrm": "৭টি শোবার ঘর", + "listings.unitTypes.expanded.sixBdrm": "৬টি শোবার ঘর", "listings.unitTypes.expanded.threeBdrm": "৩টি শোবার ঘর", "listings.unitTypes.expanded.twoBdrm": "২টি শোবার ঘর", "listings.unitTypes.fiveBdrm": "৫টি বেডরুম", "listings.unitTypes.fourBdrm": "৪টি বেডরুম", "listings.unitTypes.oneBdrm": "১ বেডরুম", + "listings.unitTypes.sevenBdrm": "৭টি বেডরুম", + "listings.unitTypes.sixBdrm": "৬টি বেডরুম", "listings.unitTypes.SRO": "একক কক্ষের আবাসন", "listings.unitTypes.studio": "স্টুডিও", "listings.unitTypes.threeBdrm": "৩টি বেডরুম", diff --git a/shared-helpers/src/locales/es.json b/shared-helpers/src/locales/es.json index e78ebb7c093..01ec994e717 100644 --- a/shared-helpers/src/locales/es.json +++ b/shared-helpers/src/locales/es.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "5 dormitorios", "application.household.preferredUnit.options.fourBdrm": "4 dormitorios", "application.household.preferredUnit.options.oneBdrm": "1 dormitorio", + "application.household.preferredUnit.options.sevenBdrm": "7+ dormitorios", + "application.household.preferredUnit.options.sixBdrm": "6 dormitorios", "application.household.preferredUnit.options.SRO": "Organización con potestad reglamentaria", "application.household.preferredUnit.options.studio": "Estudio", "application.household.preferredUnit.options.threeBdrm": "3 dormitorios", @@ -1103,11 +1105,15 @@ "listings.unitTypes.expanded.fiveBdrm": "5 dormitorios", "listings.unitTypes.expanded.fourBdrm": "4 dormitorios", "listings.unitTypes.expanded.oneBdrm": "1 dormitorio", + "listings.unitTypes.expanded.sevenBdrm": "7 dormitorios", + "listings.unitTypes.expanded.sixBdrm": "6 dormitorios", "listings.unitTypes.expanded.threeBdrm": "3 dormitorios", "listings.unitTypes.expanded.twoBdrm": "2 dormitorios", "listings.unitTypes.fiveBdrm": "5 habitaciones", "listings.unitTypes.fourBdrm": "4 habitaciones", "listings.unitTypes.oneBdrm": "1 dormitorio", + "listings.unitTypes.sevenBdrm": "7 habitaciones", + "listings.unitTypes.sixBdrm": "6 habitaciones", "listings.unitTypes.SRO": "Habitación individual", "listings.unitTypes.studio": "Estudio", "listings.unitTypes.threeBdrm": "3 habitaciones", diff --git a/shared-helpers/src/locales/fa.json b/shared-helpers/src/locales/fa.json index 9bf9df72727..8c17551363c 100644 --- a/shared-helpers/src/locales/fa.json +++ b/shared-helpers/src/locales/fa.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "۵ خوابه", "application.household.preferredUnit.options.fourBdrm": "۴ خوابه", "application.household.preferredUnit.options.oneBdrm": "۱ اتاق خواب", + "application.household.preferredUnit.options.sevenBdrm": "۷ خوابه", + "application.household.preferredUnit.options.sixBdrm": "۶ خوابه", "application.household.preferredUnit.options.SRO": "اس‌آر‌او", "application.household.preferredUnit.options.studio": "استودیو", "application.household.preferredUnit.options.threeBdrm": "۳ خوابه", @@ -1107,11 +1109,15 @@ "listings.unitTypes.expanded.fiveBdrm": "۵ خوابه", "listings.unitTypes.expanded.fourBdrm": "۴ خوابه", "listings.unitTypes.expanded.oneBdrm": "۱ اتاق خواب", + "listings.unitTypes.expanded.sevenBdrm": "۷ خوابه", + "listings.unitTypes.expanded.sixBdrm": "۶ خوابه", "listings.unitTypes.expanded.threeBdrm": "۳ خوابه", "listings.unitTypes.expanded.twoBdrm": "۲ خوابه", "listings.unitTypes.fiveBdrm": "۵ اتاق خواب", "listings.unitTypes.fourBdrm": "۴ اتاق خواب", "listings.unitTypes.oneBdrm": "۱ اتاق خواب", + "listings.unitTypes.sevenBdrm": "۷ اتاق خواب", + "listings.unitTypes.sixBdrm": "۶ اتاق خواب", "listings.unitTypes.SRO": "ظرفیت اتاق یک تخته", "listings.unitTypes.studio": "استودیو", "listings.unitTypes.threeBdrm": "۳ اتاق خواب", diff --git a/shared-helpers/src/locales/general.json b/shared-helpers/src/locales/general.json index ed56b280b9c..512b24c5d2e 100644 --- a/shared-helpers/src/locales/general.json +++ b/shared-helpers/src/locales/general.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "5 bedroom", "application.household.preferredUnit.options.fourBdrm": "4 bedroom", "application.household.preferredUnit.options.oneBdrm": "1 bedroom", + "application.household.preferredUnit.options.sevenBdrm": "7+ bedroom", + "application.household.preferredUnit.options.sixBdrm": "6 bedroom", "application.household.preferredUnit.options.SRO": "SRO", "application.household.preferredUnit.options.studio": "Studio", "application.household.preferredUnit.options.threeBdrm": "3 bedroom", @@ -1099,11 +1101,15 @@ "listings.unitTypes.expanded.fiveBdrm": "5 bedroom", "listings.unitTypes.expanded.fourBdrm": "4 bedroom", "listings.unitTypes.expanded.oneBdrm": "1 bedroom", + "listings.unitTypes.expanded.sevenBdrm": "7+ bedroom", + "listings.unitTypes.expanded.sixBdrm": "6 bedroom", "listings.unitTypes.expanded.threeBdrm": "3 bedroom", "listings.unitTypes.expanded.twoBdrm": "2 bedroom", "listings.unitTypes.fiveBdrm": "5 Bedrooms", "listings.unitTypes.fourBdrm": "4 Bedrooms", "listings.unitTypes.oneBdrm": "1 Bedroom", + "listings.unitTypes.sevenBdrm": "7+ Bedrooms", + "listings.unitTypes.sixBdrm": "6 Bedrooms", "listings.unitTypes.SRO": "Single Room Occupancy", "listings.unitTypes.studio": "Studio", "listings.unitTypes.threeBdrm": "3 Bedrooms", diff --git a/shared-helpers/src/locales/hy.json b/shared-helpers/src/locales/hy.json index 89726e7fc99..d8d758c3771 100644 --- a/shared-helpers/src/locales/hy.json +++ b/shared-helpers/src/locales/hy.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "5 ննջասենյակ", "application.household.preferredUnit.options.fourBdrm": "4 ննջասենյակ", "application.household.preferredUnit.options.oneBdrm": "1 ննջասենյակ", + "application.household.preferredUnit.options.sevenBdrm": "7+ ննջասենյակ", + "application.household.preferredUnit.options.sixBdrm": "6 ննջասենյակ", "application.household.preferredUnit.options.SRO": "ՍՊՕ", "application.household.preferredUnit.options.studio": "Ստուդիա", "application.household.preferredUnit.options.threeBdrm": "3 ննջասենյակ", @@ -1107,11 +1109,15 @@ "listings.unitTypes.expanded.fiveBdrm": "5 ննջասենյակ", "listings.unitTypes.expanded.fourBdrm": "4 ննջասենյակ", "listings.unitTypes.expanded.oneBdrm": "1 ննջասենյակ", + "listings.unitTypes.expanded.sevenBdrm": "7+ ննջասենյակ", + "listings.unitTypes.expanded.sixBdrm": "6 ննջասենյակ", "listings.unitTypes.expanded.threeBdrm": "3 ննջասենյակ", "listings.unitTypes.expanded.twoBdrm": "2 ննջասենյակ", "listings.unitTypes.fiveBdrm": "5 ննջասենյակ", "listings.unitTypes.fourBdrm": "4 ննջասենյակ", "listings.unitTypes.oneBdrm": "1 ննջասենյակ", + "listings.unitTypes.sevenBdrm": "7+ ննջասենյակ", + "listings.unitTypes.sixBdrm": "6 ննջասենյակ", "listings.unitTypes.SRO": "Մեկտեղանոց սենյակի զբաղվածություն", "listings.unitTypes.studio": "Ստուդիա", "listings.unitTypes.threeBdrm": "3 ննջասենյակ", diff --git a/shared-helpers/src/locales/ko.json b/shared-helpers/src/locales/ko.json index db7d0fe09cb..08e9523890e 100644 --- a/shared-helpers/src/locales/ko.json +++ b/shared-helpers/src/locales/ko.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "침실 5개", "application.household.preferredUnit.options.fourBdrm": "침실 4개", "application.household.preferredUnit.options.oneBdrm": "침실 1개", + "application.household.preferredUnit.options.sevenBdrm": "침실 7개 이상", + "application.household.preferredUnit.options.sixBdrm": "침실 6개", "application.household.preferredUnit.options.SRO": "SRO", "application.household.preferredUnit.options.studio": "사진관", "application.household.preferredUnit.options.threeBdrm": "침실 3개", @@ -1107,11 +1109,15 @@ "listings.unitTypes.expanded.fiveBdrm": "침실 5개", "listings.unitTypes.expanded.fourBdrm": "침실 4개", "listings.unitTypes.expanded.oneBdrm": "침실 1개", + "listings.unitTypes.expanded.sevenBdrm": "침실 7개 이상", + "listings.unitTypes.expanded.sixBdrm": "침실 6개", "listings.unitTypes.expanded.threeBdrm": "침실 3개", "listings.unitTypes.expanded.twoBdrm": "침실 2개", "listings.unitTypes.fiveBdrm": "침실 5개", "listings.unitTypes.fourBdrm": "침실 4개", "listings.unitTypes.oneBdrm": "침실 1개", + "listings.unitTypes.sevenBdrm": "침실 7개 이상", + "listings.unitTypes.sixBdrm": "침실 6개", "listings.unitTypes.SRO": "1인실 사용", "listings.unitTypes.studio": "사진관", "listings.unitTypes.threeBdrm": "침실 3개", diff --git a/shared-helpers/src/locales/tl.json b/shared-helpers/src/locales/tl.json index d0e18e105a7..0322c703853 100644 --- a/shared-helpers/src/locales/tl.json +++ b/shared-helpers/src/locales/tl.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "5 silid-tulugan", "application.household.preferredUnit.options.fourBdrm": "4 na kwarto", "application.household.preferredUnit.options.oneBdrm": "1 kwarto", + "application.household.preferredUnit.options.sevenBdrm": "7+ na kwarto", + "application.household.preferredUnit.options.sixBdrm": "6 na kwarto", "application.household.preferredUnit.options.SRO": "SRO", "application.household.preferredUnit.options.studio": "Studio", "application.household.preferredUnit.options.threeBdrm": "3 silid-tulugan", @@ -1103,11 +1105,15 @@ "listings.unitTypes.expanded.fiveBdrm": "5 silid-tulugan", "listings.unitTypes.expanded.fourBdrm": "4 na kwarto", "listings.unitTypes.expanded.oneBdrm": "1 kwarto", + "listings.unitTypes.expanded.sevenBdrm": "7+ na kwarto", + "listings.unitTypes.expanded.sixBdrm": "6 na kwarto", "listings.unitTypes.expanded.threeBdrm": "3 silid-tulugan", "listings.unitTypes.expanded.twoBdrm": "2 kwarto", "listings.unitTypes.fiveBdrm": "5 Silid-tulugan", "listings.unitTypes.fourBdrm": "4 na Silid-tulugan", "listings.unitTypes.oneBdrm": "1 Silid-tulugan", + "listings.unitTypes.sevenBdrm": "7+ Silid-tulugan", + "listings.unitTypes.sixBdrm": "6 na Silid-tulugan", "listings.unitTypes.SRO": "Pag-okupa ng Isang Kwarto", "listings.unitTypes.studio": "Studio", "listings.unitTypes.threeBdrm": "3 Silid-tulugan", diff --git a/shared-helpers/src/locales/vi.json b/shared-helpers/src/locales/vi.json index 0e1003dad7a..de9377b7bb8 100644 --- a/shared-helpers/src/locales/vi.json +++ b/shared-helpers/src/locales/vi.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "5 phòng ngủ", "application.household.preferredUnit.options.fourBdrm": "4 phòng ngủ", "application.household.preferredUnit.options.oneBdrm": "1 phòng ngủ", + "application.household.preferredUnit.options.sevenBdrm": "7+ phòng ngủ", + "application.household.preferredUnit.options.sixBdrm": "6 phòng ngủ", "application.household.preferredUnit.options.SRO": "SRO", "application.household.preferredUnit.options.studio": "Một phòng kiểu studio", "application.household.preferredUnit.options.threeBdrm": "3 phòng ngủ", @@ -1103,11 +1105,15 @@ "listings.unitTypes.expanded.fiveBdrm": "5 phòng ngủ", "listings.unitTypes.expanded.fourBdrm": "4 phòng ngủ", "listings.unitTypes.expanded.oneBdrm": "1 phòng ngủ", + "listings.unitTypes.expanded.sevenBdrm": "7+ phòng ngủ", + "listings.unitTypes.expanded.sixBdrm": "6 phòng ngủ", "listings.unitTypes.expanded.threeBdrm": "3 phòng ngủ", "listings.unitTypes.expanded.twoBdrm": "2 phòng ngủ", "listings.unitTypes.fiveBdrm": "5 phòng ngủ", "listings.unitTypes.fourBdrm": "4 phòng ngủ", "listings.unitTypes.oneBdrm": "1 phòng ngủ", + "listings.unitTypes.sevenBdrm": "7+ phòng ngủ", + "listings.unitTypes.sixBdrm": "6 phòng ngủ", "listings.unitTypes.SRO": "Phòng đơn", "listings.unitTypes.studio": "Một phòng kiểu studio", "listings.unitTypes.threeBdrm": "3 phòng ngủ", diff --git a/shared-helpers/src/locales/zh.json b/shared-helpers/src/locales/zh.json index c14be1d591a..39b5e18f9ad 100644 --- a/shared-helpers/src/locales/zh.json +++ b/shared-helpers/src/locales/zh.json @@ -334,6 +334,8 @@ "application.household.preferredUnit.options.fiveBdrm": "5间卧室", "application.household.preferredUnit.options.fourBdrm": "4卧室", "application.household.preferredUnit.options.oneBdrm": "1间卧室", + "application.household.preferredUnit.options.sevenBdrm": "7间以上卧室", + "application.household.preferredUnit.options.sixBdrm": "6间卧室", "application.household.preferredUnit.options.SRO": "自律组织", "application.household.preferredUnit.options.studio": "工作室", "application.household.preferredUnit.options.threeBdrm": "3卧室", @@ -1103,11 +1105,15 @@ "listings.unitTypes.expanded.fiveBdrm": "5间卧室", "listings.unitTypes.expanded.fourBdrm": "4卧室", "listings.unitTypes.expanded.oneBdrm": "1间卧室", + "listings.unitTypes.expanded.sevenBdrm": "7间以上卧室", + "listings.unitTypes.expanded.sixBdrm": "6间卧室", "listings.unitTypes.expanded.threeBdrm": "3卧室", "listings.unitTypes.expanded.twoBdrm": "2卧室", "listings.unitTypes.fiveBdrm": "5间卧室", "listings.unitTypes.fourBdrm": "4间卧室", "listings.unitTypes.oneBdrm": "一室一厅", + "listings.unitTypes.sevenBdrm": "7间以上卧室", + "listings.unitTypes.sixBdrm": "6间卧室", "listings.unitTypes.SRO": "单人间入住", "listings.unitTypes.studio": "套房", "listings.unitTypes.threeBdrm": "3间卧室", diff --git a/shared-helpers/src/types/backend-swagger.ts b/shared-helpers/src/types/backend-swagger.ts index 934f1b1b74e..db2f312cdc6 100644 --- a/shared-helpers/src/types/backend-swagger.ts +++ b/shared-helpers/src/types/backend-swagger.ts @@ -8416,6 +8416,9 @@ export interface PublicAppsViewResponse { applicationsCount: PublicAppsCount } +/** StreamableFile */ +export interface StreamableFile {} + /** ApplicationSelectionOptionCreate */ export interface ApplicationSelectionOptionCreate { /** */ @@ -10559,6 +10562,8 @@ export enum UnitTypeEnum { "fourBdrm" = "fourBdrm", "SRO" = "SRO", "fiveBdrm" = "fiveBdrm", + "sixBdrm" = "sixBdrm", + "sevenBdrm" = "sevenBdrm", } export enum UnitRentTypeEnum { diff --git a/shared-helpers/src/utilities/formKeys.ts b/shared-helpers/src/utilities/formKeys.ts index 13b775cd8b0..0e5c58613bd 100644 --- a/shared-helpers/src/utilities/formKeys.ts +++ b/shared-helpers/src/utilities/formKeys.ts @@ -225,6 +225,8 @@ export const bedroomKeys = [ "threeBdrm", "fourBdrm", "fiveBdrm", + "sixBdrm", + "sevenBdrm", ] export type ListingFeaturesValues = keyof Omit diff --git a/shared-helpers/src/utilities/unitTypes.ts b/shared-helpers/src/utilities/unitTypes.ts index 289c6ab5b40..3ec1c275b2d 100644 --- a/shared-helpers/src/utilities/unitTypes.ts +++ b/shared-helpers/src/utilities/unitTypes.ts @@ -21,6 +21,8 @@ export const UnitTypeSort: string[] = [ UnitTypeEnum.threeBdrm, UnitTypeEnum.fourBdrm, UnitTypeEnum.fiveBdrm, + UnitTypeEnum.sixBdrm, + UnitTypeEnum.sevenBdrm, ] export const UnitGroupTypeSort: string[] = [ diff --git a/sites/partners/__tests__/components/listings/PaperListingForm/UnitForm.test.tsx b/sites/partners/__tests__/components/listings/PaperListingForm/UnitForm.test.tsx index 3c2a7aaed20..5fceb170beb 100644 --- a/sites/partners/__tests__/components/listings/PaperListingForm/UnitForm.test.tsx +++ b/sites/partners/__tests__/components/listings/PaperListingForm/UnitForm.test.tsx @@ -93,7 +93,7 @@ describe("UnitForm", () => { // Unit type dropdown selector const unitTypeSelector = screen.getByRole("combobox", { name: /unit type/i }) expect(unitTypeSelector).toBeInTheDocument() - expect(within(unitTypeSelector).getAllByRole("option")).toHaveLength(8) + expect(within(unitTypeSelector).getAllByRole("option")).toHaveLength(10) expect(within(unitTypeSelector).getByRole("option", { name: /unit type/i })).toBeInTheDocument() expect(within(unitTypeSelector).getByRole("option", { name: "Studio" })).toBeInTheDocument() expect(within(unitTypeSelector).getByRole("option", { name: "SRO" })).toBeInTheDocument() diff --git a/sites/partners/page_content/locales/general.json b/sites/partners/page_content/locales/general.json index 4c38e41781a..757ef5c04a7 100644 --- a/sites/partners/page_content/locales/general.json +++ b/sites/partners/page_content/locales/general.json @@ -612,6 +612,8 @@ "listings.unit.typeOptions.fiveBdrm": "Five bedroom", "listings.unit.typeOptions.fourBdrm": "Four bedroom", "listings.unit.typeOptions.oneBdrm": "One bedroom", + "listings.unit.typeOptions.sevenBdrm": "Seven+ bedroom", + "listings.unit.typeOptions.sixBdrm": "Six bedroom", "listings.unit.typeOptions.SRO": "SRO", "listings.unit.typeOptions.studio": "Studio", "listings.unit.typeOptions.threeBdrm": "Three bedroom", diff --git a/sites/partners/src/lib/listings/UnitsFormatter.ts b/sites/partners/src/lib/listings/UnitsFormatter.ts index 98cb43f431d..3ca10211881 100644 --- a/sites/partners/src/lib/listings/UnitsFormatter.ts +++ b/sites/partners/src/lib/listings/UnitsFormatter.ts @@ -10,6 +10,12 @@ export default class UnitsFormatter extends Formatter { const unit = { ...unitValue } // make a copy of the unit before transformation switch (unit.unitTypes?.name) { + case "sevenBdrm": + unit.numBedrooms = 7 + break + case "sixBdrm": + unit.numBedrooms = 6 + break case "fiveBdrm": unit.numBedrooms = 5 break diff --git a/sites/public/__tests__/components/browse/FilterDrawerHelpers.test.tsx b/sites/public/__tests__/components/browse/FilterDrawerHelpers.test.tsx index f0b2c0cf45c..f401a844d2e 100644 --- a/sites/public/__tests__/components/browse/FilterDrawerHelpers.test.tsx +++ b/sites/public/__tests__/components/browse/FilterDrawerHelpers.test.tsx @@ -55,6 +55,8 @@ describe("filter drawer helpers", () => { [UnitTypeEnum.threeBdrm]: false, [UnitTypeEnum.fourBdrm]: false, [UnitTypeEnum.fiveBdrm]: false, + [UnitTypeEnum.sixBdrm]: false, + [UnitTypeEnum.sevenBdrm]: false, }, [ListingFilterKeys.monthlyRent]: { minRent: "", @@ -659,6 +661,8 @@ describe("filter drawer helpers", () => { threeBdrm: false, fourBdrm: false, fiveBdrm: false, + sixBdrm: false, + sevenBdrm: false, }, monthlyRent: { minRent: "", diff --git a/sites/public/src/components/browse/FilterDrawerHelpers.tsx b/sites/public/src/components/browse/FilterDrawerHelpers.tsx index 095332582ce..1def515cd30 100644 --- a/sites/public/src/components/browse/FilterDrawerHelpers.tsx +++ b/sites/public/src/components/browse/FilterDrawerHelpers.tsx @@ -156,6 +156,16 @@ export const unitTypeMapping = { ordinal: 6, labelKey: "listings.unitTypes.expanded.fiveBdrm", }, + [UnitTypeEnum.sixBdrm]: { + value: 6, + ordinal: 7, + labelKey: "listings.unitTypes.expanded.sixBdrm", + }, + [UnitTypeEnum.sevenBdrm]: { + value: 7, + ordinal: 8, + labelKey: "listings.unitTypes.expanded.sevenBdrm", + }, } export const unitTypeUnitGroupsMapping = { From 2407d032124212135ab72c9810acd4c56c74caa7 Mon Sep 17 00:00:00 2001 From: krzysztof ziecina Date: Thu, 9 Jul 2026 17:23:39 +0200 Subject: [PATCH 2/2] fix: add 7+ for es translation --- shared-helpers/src/locales/es.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-helpers/src/locales/es.json b/shared-helpers/src/locales/es.json index 01ec994e717..34420873d12 100644 --- a/shared-helpers/src/locales/es.json +++ b/shared-helpers/src/locales/es.json @@ -1105,14 +1105,14 @@ "listings.unitTypes.expanded.fiveBdrm": "5 dormitorios", "listings.unitTypes.expanded.fourBdrm": "4 dormitorios", "listings.unitTypes.expanded.oneBdrm": "1 dormitorio", - "listings.unitTypes.expanded.sevenBdrm": "7 dormitorios", + "listings.unitTypes.expanded.sevenBdrm": "7+ dormitorios", "listings.unitTypes.expanded.sixBdrm": "6 dormitorios", "listings.unitTypes.expanded.threeBdrm": "3 dormitorios", "listings.unitTypes.expanded.twoBdrm": "2 dormitorios", "listings.unitTypes.fiveBdrm": "5 habitaciones", "listings.unitTypes.fourBdrm": "4 habitaciones", "listings.unitTypes.oneBdrm": "1 dormitorio", - "listings.unitTypes.sevenBdrm": "7 habitaciones", + "listings.unitTypes.sevenBdrm": "7+ habitaciones", "listings.unitTypes.sixBdrm": "6 habitaciones", "listings.unitTypes.SRO": "Habitación individual", "listings.unitTypes.studio": "Estudio",