diff --git a/api/prisma/migrations/21_community_type_description/migration.sql b/api/prisma/migrations/21_community_type_description/migration.sql new file mode 100644 index 0000000000..9f6d42eeba --- /dev/null +++ b/api/prisma/migrations/21_community_type_description/migration.sql @@ -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; diff --git a/api/prisma/schema.prisma b/api/prisma/schema.prisma index d53b99fcbe..fdcefa4ced 100644 --- a/api/prisma/schema.prisma +++ b/api/prisma/schema.prisma @@ -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") } @@ -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") @@ -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]) diff --git a/api/src/dtos/listings/listing.dto.ts b/api/src/dtos/listings/listing.dto.ts index d4817ac293..2d47d13804 100644 --- a/api/src/dtos/listings/listing.dto.ts +++ b/api/src/dtos/listings/listing.dto.ts @@ -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 }; diff --git a/api/test/integration/listing.e2e-spec.ts b/api/test/integration/listing.e2e-spec.ts index 9fc0e9db3b..3a2fb04b88 100644 --- a/api/test/integration/listing.e2e-spec.ts +++ b/api/test/integration/listing.e2e-spec.ts @@ -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, }; }; diff --git a/shared-helpers/src/types/backend-swagger.ts b/shared-helpers/src/types/backend-swagger.ts index 27da7358c3..aceeeea32a 100644 --- a/shared-helpers/src/types/backend-swagger.ts +++ b/shared-helpers/src/types/backend-swagger.ts @@ -3493,6 +3493,15 @@ export interface Listing { /** */ applicationLotteryTotals: ApplicationLotteryTotal[] + + /** */ + includeCommunityDisclaimer?: boolean + + /** */ + communityDisclaimerTitle?: string + + /** */ + communityDisclaimerDescription?: string } export interface PaginationMeta { @@ -3955,6 +3964,15 @@ export interface ListingCreate { /** */ lotteryOptIn?: boolean + /** */ + includeCommunityDisclaimer?: boolean + + /** */ + communityDisclaimerTitle?: string + + /** */ + communityDisclaimerDescription?: string + /** */ listingMultiselectQuestions?: IdDTO[] @@ -4229,6 +4247,15 @@ export interface ListingUpdate { /** */ lotteryOptIn?: boolean + /** */ + includeCommunityDisclaimer?: boolean + + /** */ + communityDisclaimerTitle?: string + + /** */ + communityDisclaimerDescription?: string + /** */ listingMultiselectQuestions?: IdDTO[] @@ -6099,6 +6126,8 @@ export enum LanguagesEnum { "vi" = "vi", "zh" = "zh", "tl" = "tl", + "bn" = "bn", + "ar" = "ar", } export enum ListingEventsTypeEnum {