Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
12373e2
added feature flag
millord Dec 19, 2025
f761fc5
added field into the listing model
millord Dec 19, 2025
82362a4
updated feature flag desc
millord Dec 20, 2025
cf72052
added parking fee dto prop
millord Dec 20, 2025
d027849
ran the migration
millord Dec 20, 2025
0e7b36b
added new field to front
millord Dec 22, 2025
60953b5
updated dto for parking fee
millord Dec 22, 2025
2cd5699
updated swager
millord Dec 22, 2025
285b38b
added propper field
millord Dec 22, 2025
b41f47b
added flag to field
millord Dec 22, 2025
0ef803c
added flag to field in the proper file
millord Dec 22, 2025
ee9335e
added parking fee field
millord Dec 22, 2025
0a290c0
cleaned code
millord Dec 22, 2025
e869f31
used cleaner sintax for codd
millord Dec 22, 2025
354c824
updated migration
millord Dec 22, 2025
19e0563
working for partners
millord Dec 22, 2025
f6ba0a7
updated id name
millord Dec 22, 2025
27e5295
added parking fees to the csv
millord Dec 22, 2025
dd43748
added parking fee to public
millord Dec 22, 2025
1d7a0fe
removed comment
millord Dec 23, 2025
c7eae2e
added dollar money sign
millord Dec 23, 2025
53499a5
added translations
millord Dec 23, 2025
fef0da0
Merge branch 'main' into 5676/new-field-parking-fee
millord Dec 23, 2025
885f8c0
removed s from name
millord Dec 23, 2025
5a3ce32
put the text in a better location
millord Dec 23, 2025
eedd902
updated size and position of field
millord Dec 23, 2025
899dc50
updated column size
millord Dec 23, 2025
a343e7d
Merge branch 'main' into 5676/new-field-parking-fee
millord Dec 23, 2025
f2cc65d
updated tests for parking fee
millord Dec 24, 2025
77d13dd
Merge branch 'main' into 5676/new-field-parking-fee
millord Dec 24, 2025
5bf6401
updated tests for parking fee flag
millord Dec 24, 2025
7e620c3
updated tests for parking fee flag in the correct test
millord Dec 24, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "listings" ADD COLUMN "parking_fee" TEXT;
1 change: 1 addition & 0 deletions api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ model Listings {
Listings Listings[] @relation("copy_of")
lastUpdatedByUserId String? @map("last_updated_by_user_id") @db.Uuid
lastUpdatedByUser UserAccounts? @relation("last_updated_by_user", fields: [lastUpdatedByUserId], references: [id], onDelete: NoAction, onUpdate: NoAction)
parkingFee String? @map("parking_fee")

@@index([jurisdictionId])
@@map("listings")
Expand Down
3 changes: 3 additions & 0 deletions api/prisma/seed-staging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const stagingSeed = async (
FeatureFlagEnum.enableListingPagination,
FeatureFlagEnum.enableMarketingStatus,
FeatureFlagEnum.enableNeighborhoodAmenities,
FeatureFlagEnum.enableParkingFee,
FeatureFlagEnum.enablePartnerDemographics,
FeatureFlagEnum.enablePartnerSettings,
FeatureFlagEnum.enableSection8Question,
Expand Down Expand Up @@ -111,6 +112,7 @@ export const stagingSeed = async (
FeatureFlagEnum.enableMarketingStatus,
FeatureFlagEnum.enableNeighborhoodAmenities,
FeatureFlagEnum.enableNonRegulatedListings,
FeatureFlagEnum.enableParkingFee,
FeatureFlagEnum.enablePartnerDemographics,
FeatureFlagEnum.enablePartnerSettings,
FeatureFlagEnum.enableRegions,
Expand Down Expand Up @@ -173,6 +175,7 @@ export const stagingSeed = async (
FeatureFlagEnum.enableMarketingStatusMonths,
FeatureFlagEnum.enableNeighborhoodAmenities,
FeatureFlagEnum.enableNeighborhoodAmenitiesDropdown,
FeatureFlagEnum.enableParkingFee,
FeatureFlagEnum.enableProperties,
FeatureFlagEnum.enableReferralQuestionUnits,
],
Expand Down
8 changes: 8 additions & 0 deletions api/src/dtos/listings/listing.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,14 @@ class Listing extends AbstractDTO {
@ApiProperty()
name: string;

@Expose()
@ValidateListingPublish('parkingFee', {
groups: [ValidationsGroupsEnum.default],
})
@IsString({ groups: [ValidationsGroupsEnum.default] })
@ApiPropertyOptional()
parkingFee?: string;

@Expose()
@ValidateListingPublish('postmarkedApplicationsReceivedByDate', {
groups: [ValidationsGroupsEnum.default],
Expand Down
5 changes: 5 additions & 0 deletions api/src/enums/feature-flags/feature-flags-enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export enum FeatureFlagEnum {
enableNeighborhoodAmenities = 'enableNeighborhoodAmenities',
enableNeighborhoodAmenitiesDropdown = 'enableNeighborhoodAmenitiesDropdown',
enableNonRegulatedListings = 'enableNonRegulatedListings',
enableParkingFee = 'enableParkingFee',
enablePartnerDemographics = 'enablePartnerDemographics',
enablePartnerSettings = 'enablePartnerSettings',
enableProperties = 'enableProperties',
Expand Down Expand Up @@ -210,6 +211,10 @@ export const featureFlagMap: {
description:
'When true, non-regulated listings are displayed in listing creation/edit and public listing view',
},
{
name: FeatureFlagEnum.enableParkingFee,
description: 'When true, the parking fee field should be visible',
},
{
name: FeatureFlagEnum.enablePartnerDemographics,
description:
Expand Down
12 changes: 12 additions & 0 deletions api/src/services/listing-csv-export.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -946,6 +946,18 @@ export class ListingCsvExporterService implements CsvExporterServiceInterface {
});
}

if (
doAnyJurisdictionHaveFeatureFlagSet(
user.jurisdictions,
FeatureFlagEnum.enableParkingFee,
)
) {
headers.push({
path: 'parkingFee',
label: 'Parking Fee',
});
}

headers.push(
...[
{
Expand Down
1 change: 1 addition & 0 deletions shared-helpers/src/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@
"t.order": "ترتيب",
"t.orUpTo": "أو ما يصل إلى",
"t.other": "آخر",
"t.parkingFee": "رسوم الإصطفاف",
"t.people": "اشخاص",
"t.perMonth": "كل شهر",
"t.person": "شخص",
Expand Down
1 change: 1 addition & 0 deletions shared-helpers/src/locales/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@
"t.order": "আদেশ",
"t.orUpTo": "বা পর্যন্ত",
"t.other": "অন্যান্য",
"t.parkingFee": "পার্কিং ফি",
"t.people": "মানুষ",
"t.perMonth": "প্রতি মাসে",
"t.person": "ব্যক্তি",
Expand Down
1 change: 1 addition & 0 deletions shared-helpers/src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@
"t.order": "Orden",
"t.orUpTo": "o hasta",
"t.other": "Otro",
"t.parkingFee": "Tarifa de estacionamiento",
"t.people": "personas",
"t.perMonth": "al mes",
"t.person": "persona",
Expand Down
1 change: 1 addition & 0 deletions shared-helpers/src/locales/general.json
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,7 @@
"t.order": "Order",
"t.orUpTo": "or up to",
"t.other": "Other",
"t.parkingFee": "Parking Fee",
"t.people": "people",
"t.perMonth": "per month",
"t.person": "person",
Expand Down
1 change: 1 addition & 0 deletions shared-helpers/src/locales/tl.json
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@
"t.order": "Umorder",
"t.orUpTo": "o hanggang sa",
"t.other": "Iba pa",
"t.parkingFee": "Bayad sa Paradahan",
"t.people": "mga tao",
"t.perMonth": "kada buwan",
"t.person": "tao",
Expand Down
1 change: 1 addition & 0 deletions shared-helpers/src/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@
"t.order": "Đặt hàng",
"t.orUpTo": "hoặc lên đến",
"t.other": "Khác",
"t.parkingFee": "Phí đỗ xe",
"t.people": "người",
"t.perMonth": "mỗi tháng",
"t.person": "người",
Expand Down
1 change: 1 addition & 0 deletions shared-helpers/src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@
"t.order": "命令",
"t.orUpTo": "或最多",
"t.other": "其他",
"t.parkingFee": "停車費",
"t.people": "人",
"t.perMonth": "每月",
"t.person": "人",
Expand Down
10 changes: 10 additions & 0 deletions shared-helpers/src/types/backend-swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4273,6 +4273,9 @@ export interface Listing {
/** */
name: string

/** */
parkingFee?: string

/** */
postmarkedApplicationsReceivedByDate?: Date

Expand Down Expand Up @@ -4987,6 +4990,9 @@ export interface ListingCreate {
/** */
name: string

/** */
parkingFee?: string

/** */
postmarkedApplicationsReceivedByDate?: Date

Expand Down Expand Up @@ -5345,6 +5351,9 @@ export interface ListingUpdate {
/** */
name: string

/** */
parkingFee?: string

/** */
postmarkedApplicationsReceivedByDate?: Date

Expand Down Expand Up @@ -8045,6 +8054,7 @@ export enum FeatureFlagEnum {
"enableNeighborhoodAmenities" = "enableNeighborhoodAmenities",
"enableNeighborhoodAmenitiesDropdown" = "enableNeighborhoodAmenitiesDropdown",
"enableNonRegulatedListings" = "enableNonRegulatedListings",
"enableParkingFee" = "enableParkingFee",
"enablePartnerDemographics" = "enablePartnerDemographics",
"enablePartnerSettings" = "enablePartnerSettings",
"enableProperties" = "enableProperties",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,8 @@ describe("add listing", () => {
return true
case FeatureFlagEnum.enableHomeType:
return true
case FeatureFlagEnum.enableParkingFee:
return true
case FeatureFlagEnum.enableCompanyWebsite:
return true
default:
Expand Down Expand Up @@ -402,6 +404,7 @@ describe("add listing", () => {
"Additional accessibility",
"Unit amenities",
"Smoking policy",
"Parking fee",
"Pets policy",
"Services offered",
"Credit history",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable import/no-named-as-default */
import React from "react"
import { setupServer } from "msw/lib/node"
import { fireEvent, mockNextRouter, queryByText, render, screen, within } from "../../../testUtils"

Check warning on line 4 in sites/partners/__tests__/pages/listings/[id]/index.test.tsx

View workflow job for this annotation

GitHub Actions / Run linters

'queryByText' is defined but never used
import { ListingContext } from "../../../../src/components/listings/ListingContext"
import { jurisdiction, listing, user } from "@bloom-housing/shared-helpers/__tests__/testHelpers"
import DetailListingData from "../../../../src/components/listings/PaperListingDetails/sections/DetailListingData"
Expand Down Expand Up @@ -835,6 +835,7 @@
)
).toBeInTheDocument()
expect(screen.getByText("Services offered")).toBeInTheDocument()
expect(screen.getByText("Services offered")).toBeInTheDocument()
expect(screen.getByText("Professional Help")).toBeInTheDocument()
})

Expand Down
1 change: 1 addition & 0 deletions sites/partners/page_content/locale_overrides/general.json
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@
"listings.sections.neighborhoodAmenitiesSubtitle": "Provide details about any local amenities including grocery stores, health services and parks within 2 miles of your listing.",
"listings.sections.neighborhoodAmenitiesSubtitleAlt": "Please provide details about any nearby amenities.",
"listings.sections.openHouse": "Open house",
"listings.sections.parkingFeeText": "Parking fee",
"listings.sections.photo.helperTextBase": "Select JPEG or PNG file to upload. Please upload horizontal images only at approximately 1440px.",
"listings.sections.photo.helperTextLimit": "Up to 10 uploaded images allowed.",
"listings.sections.photo.helperTextLimits": "At least %{smart_count} image is required, and up to 10 images are allowed. |||| At least %{smart_count} images are required, and up to 10 images are allowed.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const DetailBuildingFeatures = () => {
FeatureFlagEnum.enableAccessibilityFeatures,
listing.jurisdictions.id
)
const enableParkingFee = doJurisdictionsHaveFeatureFlagOn(
FeatureFlagEnum.enableParkingFee,
listing?.jurisdictions?.id
)

return (
<SectionWithGrid heading={t("listings.sections.buildingFeaturesTitle")} inset>
Expand Down Expand Up @@ -90,6 +94,15 @@ const DetailBuildingFeatures = () => {
</Grid.Cell>
</Grid.Row>
)}
{enableParkingFee && (
<Grid.Row>
<Grid.Cell>
<FieldValue id="parkingFee" label={t("listings.sections.parkingFeeText")}>
{getDetailFieldString(listing.parkingFee)}
</FieldValue>
</Grid.Cell>
</Grid.Row>
)}
</SectionWithGrid>
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import React, { useMemo, useEffect } from "react"
import React, { useMemo, useEffect, useContext } from "react"
import { useFormContext } from "react-hook-form"
import { t, Textarea, FieldGroup } from "@bloom-housing/ui-components"
import { t, Textarea, FieldGroup, Field } from "@bloom-housing/ui-components"
import { Grid } from "@bloom-housing/ui-seeds"
import { listingFeatures } from "@bloom-housing/shared-helpers"
import { ListingFeatures } from "@bloom-housing/shared-helpers/src/types/backend-swagger"
import { AuthContext, listingFeatures } from "@bloom-housing/shared-helpers"
import {
FeatureFlagEnum,
ListingFeatures,
} from "@bloom-housing/shared-helpers/src/types/backend-swagger"
import SectionWithGrid from "../../../shared/SectionWithGrid"
import { defaultFieldProps } from "../../../../lib/helpers"
import styles from "../ListingForm.module.scss"
import { ListingContext } from "../../ListingContext"

type BuildingFeaturesProps = {
enableAccessibilityFeatures?: boolean
Expand All @@ -16,6 +20,8 @@ type BuildingFeaturesProps = {

const BuildingFeatures = (props: BuildingFeaturesProps) => {
const formMethods = useFormContext()
const listing = useContext(ListingContext)
const { doJurisdictionsHaveFeatureFlagOn } = useContext(AuthContext)

// eslint-disable-next-line @typescript-eslint/unbound-method
const { register, setValue, errors, clearErrors } = formMethods
Expand All @@ -36,6 +42,11 @@ const BuildingFeatures = (props: BuildingFeaturesProps) => {
}
}, [props.enableAccessibilityFeatures, setValue])

const enableParkingFee = doJurisdictionsHaveFeatureFlagOn(
FeatureFlagEnum.enableParkingFee,
listing?.jurisdictions?.id
)

return (
<>
<hr className="spacer-section-above spacer-section" />
Expand Down Expand Up @@ -139,6 +150,24 @@ const BuildingFeatures = (props: BuildingFeaturesProps) => {
/>
</Grid.Cell>
</Grid.Row>
{enableParkingFee && (
<Grid.Row columns={3}>
<Grid.Cell>
<Field
register={register}
type={"currency"}
prepend={"$"}
{...defaultFieldProps(
"parkingFee",
t("listings.sections.parkingFeeText"),
props.requiredFields,
errors,
clearErrors
)}
/>
</Grid.Cell>
</Grid.Row>
)}
{!props.enableAccessibilityFeatures ? null : (
<Grid.Row>
<FieldGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,12 @@ export const getFeatures = (
if (listing.servicesOffered) {
features.push({ heading: t("t.servicesOffered"), subheading: listing.servicesOffered })
}
if (listing.parkingFee) {
features.push({
heading: t("t.parkingFee"),
subheading: `$ ${listing.parkingFee}`,
})
}
const accessibilityFeatures = getAccessibilityFeatures(listing)
const enableAccessibilityFeatures = jurisdiction?.featureFlags?.some(
(flag) => flag.name === "enableAccessibilityFeatures" && flag.active
Expand Down
Loading