Skip to content

Commit

Permalink
feat: adding community type disclaimer fields (#4486)
Browse files Browse the repository at this point in the history
* feat: adding community type disclaimer fields

* fix: updates per morgan
  • Loading branch information
YazeedLoonat authored Nov 25, 2024
1 parent 76a84be commit baa2f43
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- AlterTable
ALTER TABLE "listings" ADD COLUMN "community_disclaimer_description" TEXT,
ADD COLUMN "community_disclaimer_title" TEXT,
ADD COLUMN "include_community_disclaimer" BOOLEAN;
19 changes: 11 additions & 8 deletions api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,13 @@ model Demographics {
}

model FeatureFlags {
id String @id() @default(dbgenerated("uuid_generate_v4()")) @db.Uuid
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(6)
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamp(6)
name String @unique()
description String
active Boolean @default(true)
jurisdictions Jurisdictions[]
id String @id() @default(dbgenerated("uuid_generate_v4()")) @db.Uuid
createdAt DateTime @default(now()) @map("created_at") @db.Timestamp(6)
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamp(6)
name String @unique()
description String
active Boolean @default(true)
jurisdictions Jurisdictions[]
@@map("feature_flags")
}
Expand Down Expand Up @@ -572,6 +572,9 @@ model Listings {
resultId String? @map("result_id") @db.Uuid
featuresId String? @unique() @map("features_id") @db.Uuid
utilitiesId String? @unique() @map("utilities_id") @db.Uuid
includeCommunityDisclaimer Boolean? @map("include_community_disclaimer")
communityDisclaimerTitle String? @map("community_disclaimer_title")
communityDisclaimerDescription String? @map("community_disclaimer_description")
// START DETROIT SPECIFIC
hrdId String? @map("hrd_id")
ownerCompany String? @map("owner_company")
Expand Down Expand Up @@ -621,7 +624,7 @@ model Listings {
requestedChangesUser UserAccounts? @relation("requested_changes_user", fields: [requestedChangesUserId], references: [id], onDelete: NoAction, onUpdate: NoAction)
applicationLotteryPositions ApplicationLotteryPositions[]
applicationLotteryTotals ApplicationLotteryTotal[]
copyOf Listings? @relation("copy_of", fields: [copyOfId], references: [id])
copyOf Listings? @relation("copy_of", fields: [copyOfId], references: [id], onUpdate: NoAction)
Listings Listings[] @relation("copy_of")
@@index([jurisdictionId])
Expand Down
15 changes: 15 additions & 0 deletions api/src/dtos/listings/listing.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,21 @@ class Listing extends AbstractDTO {
@Type(() => ApplicationLotteryTotal)
@ApiProperty({ type: ApplicationLotteryTotal, isArray: true })
applicationLotteryTotals: ApplicationLotteryTotal[];

@Expose()
@ApiPropertyOptional()
@IsBoolean({ groups: [ValidationsGroupsEnum.default] })
includeCommunityDisclaimer?: boolean;

@Expose()
@ApiPropertyOptional()
@IsString({ groups: [ValidationsGroupsEnum.default] })
communityDisclaimerTitle?: string;

@Expose()
@ApiPropertyOptional()
@IsString({ groups: [ValidationsGroupsEnum.default] })
communityDisclaimerDescription?: string;
}

export { Listing as default, Listing };
5 changes: 5 additions & 0 deletions api/test/integration/listing.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,11 @@ describe('Listing Controller Tests', () => {
phone: false,
internet: true,
},
includeCommunityDisclaimer: Math.random() >= 0.5,
communityDisclaimerTitle:
Math.random() >= 0.5 ? 'example title' : undefined,
communityDisclaimerDescription:
Math.random() >= 0.5 ? 'example description' : undefined,
};
};

Expand Down
29 changes: 29 additions & 0 deletions shared-helpers/src/types/backend-swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3493,6 +3493,15 @@ export interface Listing {

/** */
applicationLotteryTotals: ApplicationLotteryTotal[]

/** */
includeCommunityDisclaimer?: boolean

/** */
communityDisclaimerTitle?: string

/** */
communityDisclaimerDescription?: string
}

export interface PaginationMeta {
Expand Down Expand Up @@ -3955,6 +3964,15 @@ export interface ListingCreate {
/** */
lotteryOptIn?: boolean

/** */
includeCommunityDisclaimer?: boolean

/** */
communityDisclaimerTitle?: string

/** */
communityDisclaimerDescription?: string

/** */
listingMultiselectQuestions?: IdDTO[]

Expand Down Expand Up @@ -4229,6 +4247,15 @@ export interface ListingUpdate {
/** */
lotteryOptIn?: boolean

/** */
includeCommunityDisclaimer?: boolean

/** */
communityDisclaimerTitle?: string

/** */
communityDisclaimerDescription?: string

/** */
listingMultiselectQuestions?: IdDTO[]

Expand Down Expand Up @@ -6099,6 +6126,8 @@ export enum LanguagesEnum {
"vi" = "vi",
"zh" = "zh",
"tl" = "tl",
"bn" = "bn",
"ar" = "ar",
}

export enum ListingEventsTypeEnum {
Expand Down

0 comments on commit baa2f43

Please sign in to comment.