Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
682fa60
fix: fix schema formatting
matzduniuk Sep 22, 2025
6db2a67
chore: add new enum types
matzduniuk Sep 22, 2025
6ee3134
chore: add new Listings model fields
matzduniuk Sep 22, 2025
19e2d5e
chore: add new fields to the UnitGroup model
matzduniuk Sep 22, 2025
a082fd7
chore: update DTO's to changes in schema
matzduniuk Sep 22, 2025
2dcb632
chore: generate new swagger types
matzduniuk Sep 22, 2025
ca450a1
chore: add migration for new schema updates
matzduniuk Sep 22, 2025
9a6d37d
fix: update depositValue field decimal range
matzduniuk Sep 22, 2025
4b9c250
Merge branch 'main' into 5376/database-schema-updates
matzduniuk Sep 22, 2025
1bcf860
Merge branch 'main' into 5376/database-schema-updates
matzduniuk Sep 23, 2025
f05c50d
fix: add missing field names
matzduniuk Sep 25, 2025
7d78997
chore: add custom deposit validation decorator
matzduniuk Sep 25, 2025
cdd4c2a
chore: add unit group rent type validation
matzduniuk Sep 25, 2025
ceb9ee8
fix: remove unnecessary import
matzduniuk Sep 25, 2025
b39299a
chore: update sunit summary DTO to contain new fields
matzduniuk Sep 25, 2025
dfc3173
chore: update service layer
matzduniuk Sep 26, 2025
ada8d52
fix: remove unnecessary migration update
matzduniuk Sep 26, 2025
eeb5bfa
fix: update db fields
matzduniuk Sep 26, 2025
e506251
Merge branch '5376/database-schema-updates' into 5377/non-regulated-l…
matzduniuk Sep 26, 2025
5250427
chore: update rent validation decorator
matzduniuk Sep 26, 2025
1bf8c66
chore: add the cocInfo to the listing DTO
matzduniuk Sep 26, 2025
da79ff3
chore: regenerate backend swagger
matzduniuk Sep 29, 2025
bde59a9
chore: add listing type selector
matzduniuk Sep 29, 2025
f3d8fdb
chore: add unit form non regulated rent fields
matzduniuk Sep 29, 2025
84fa3c5
fix: fix invalid logic
matzduniuk Oct 2, 2025
8a1300e
chore: update prop to and optional value
matzduniuk Oct 2, 2025
51e13db
chore: add rent type fields for unit group form
matzduniuk Oct 2, 2025
1d6a74b
chore: hide additional fields for non regulated listings
matzduniuk Oct 2, 2025
53b3a6b
chore: add fields for the deposit types
matzduniuk Oct 2, 2025
460d55a
chore: update labels
matzduniuk Oct 2, 2025
f1ca76a
chore: update community types fields
matzduniuk Oct 2, 2025
fff8934
chore: add listing ebll clearance field
matzduniuk Oct 2, 2025
c288da6
chore: update built year filed rendering logic
matzduniuk Oct 2, 2025
3afdfed
Merge branch 'main' into 5377/non-regulated-listings-api-layer-updates
matzduniuk Oct 2, 2025
006f9bc
chore: fix field decorator error
matzduniuk Oct 2, 2025
d237066
fix: fix decorators import paths
matzduniuk Oct 6, 2025
16373ee
chore: update required documents form fields
matzduniuk Oct 6, 2025
6118b98
Merge branch 'main' into 5377/non-regulated-listings-api-layer-updates
matzduniuk Oct 7, 2025
f22d168
Merge branch '5377/non-regulated-listings-api-layer-updates' into 538…
matzduniuk Oct 7, 2025
1507925
chore: update the schema to include the new required documents list t…
matzduniuk Oct 7, 2025
1afaf3b
fix: remove unused import
matzduniuk Oct 7, 2025
ad195fc
chore: update listings factory to include the new required documents …
matzduniuk Oct 7, 2025
85226fb
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Oct 17, 2025
11f0874
chore: hide non regulated switch field based on feature flag
matzduniuk Oct 17, 2025
914a2db
chore: retain the original required documents field
matzduniuk Oct 17, 2025
10be0f9
Revert "chore: hide non regulated switch field based on feature flag"
matzduniuk Oct 17, 2025
319599b
fix: add missing fields validation
matzduniuk Oct 17, 2025
8b9611f
fix: update imports
matzduniuk Oct 17, 2025
1da2a62
fix: remove the package manager filed in package JSON
matzduniuk Oct 21, 2025
e9ef75a
fix: update the hasHudEbllClearance field
matzduniuk Oct 21, 2025
df5fa5d
fix: remove unused import
matzduniuk Oct 21, 2025
dfc7714
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Nov 3, 2025
278efcf
chore: update the label to match the current listing type
matzduniuk Nov 4, 2025
7239564
fix: fix the application fee full width field
matzduniuk Nov 4, 2025
b30668b
fix: hide the new deposit and rent fields for regulated units
matzduniuk Nov 4, 2025
de66bca
fix: boolean ebll formatting for form submission
matzduniuk Nov 5, 2025
475bb36
chore: add non regulated listing fields to intro and fees sections
matzduniuk Nov 6, 2025
f561204
chore: add missing documents model column mapping
matzduniuk Nov 6, 2025
d0a6ccd
fix: udpdate form subssion for the new required documents field
matzduniuk Nov 6, 2025
6160064
chore: add required documents preview in the details
matzduniuk Nov 6, 2025
ba55947
fix: add feature flag based regulated fields control
matzduniuk Nov 6, 2025
c1e9605
chore: update the validation decorator
matzduniuk Nov 7, 2025
eb745c9
chore: update listing details page to new jest standard
matzduniuk Nov 7, 2025
92b1e04
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Nov 7, 2025
5625199
fix: fix failing backend API tests
matzduniuk Nov 7, 2025
b5ece3b
fix: fix backend integration tests
matzduniuk Nov 7, 2025
24c6abf
fix: fix decorator logic
matzduniuk Nov 7, 2025
e9936bb
fix: add unit group rent range revalidation triggering
matzduniuk Nov 10, 2025
09ddfb2
fix: fix unwanted initial ebll field reset
matzduniuk Nov 10, 2025
36c5a01
fix: required documents preview filtering
matzduniuk Nov 10, 2025
597e840
fix: update the developer field title switching on listing preview page
matzduniuk Nov 10, 2025
edade1b
fix: hide new fields on listing preview based on the non-regulated fe…
matzduniuk Nov 10, 2025
d61a472
fix: fix label typo
matzduniuk Nov 10, 2025
76c226d
fix: update new required documents field label formatting
matzduniuk Nov 10, 2025
d7afcd9
fix: hide the new documents field group on regulated listings
matzduniuk Nov 10, 2025
63f1600
fix: remove unused import
matzduniuk Nov 10, 2025
1006fc0
fix: add missing monthly rent field to database
matzduniuk Nov 10, 2025
291d321
fix: fix unit groups integration tests
matzduniuk Nov 10, 2025
306232c
fix: paper listing form failing tests
matzduniuk Nov 10, 2025
e465ef4
chore: rename migration files
matzduniuk Nov 12, 2025
592cae9
fix: clean-up merge conflict resolve
matzduniuk Nov 12, 2025
c8ff3c5
fix: remove unnecessary listing service code
matzduniuk Nov 12, 2025
1da4d98
fix: hide the new required documents field from preview page based on…
matzduniuk Nov 12, 2025
03ed802
fix: remove unused prop
matzduniuk Nov 12, 2025
c9b5b7d
fix: update the listings factory to add new required documents only f…
matzduniuk Nov 12, 2025
71a26af
chore: add logic to disconnect and delete documents table entry autom…
matzduniuk Nov 12, 2025
f76c969
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Nov 12, 2025
9535528
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Nov 13, 2025
27ac650
fix: fix Units component feature flag detection code
matzduniuk Nov 13, 2025
51f1cab
chore: add integration tests for non regulated listing preview
matzduniuk Nov 13, 2025
6e70cf0
chore: add integration tests for the ListingIntro section
matzduniuk Nov 13, 2025
eadcbc2
chore: add integration tests for AdditionalDetails form section compo…
matzduniuk Nov 13, 2025
5e27a79
chore: add deposit type default field for the listing form
matzduniuk Nov 13, 2025
4377a7f
chore: add integration tests for the AdditionalFees listing form comp…
matzduniuk Nov 13, 2025
c4b0258
chore: add integration tests for the unit group form for non-regulate…
matzduniuk Nov 13, 2025
fe00e85
fix: update the listing service to remove the documents entry after c…
matzduniuk Nov 13, 2025
e7b61b0
fix: revert the CommunityType component logic
matzduniuk Nov 13, 2025
a61f19d
chore: partially revert additional fees section logic
matzduniuk Nov 14, 2025
e535fa6
fix: update the listingType field clearing to undefined
matzduniuk Nov 14, 2025
16f0e1f
fix: remove unused imports
matzduniuk Nov 14, 2025
7aa5cbc
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Nov 14, 2025
09ec8e0
fix: revert changes for unit form
matzduniuk Nov 14, 2025
2ae4837
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Nov 14, 2025
f605050
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Nov 17, 2025
c3e16bf
test: re-run testing suite
matzduniuk Nov 17, 2025
987b734
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Nov 18, 2025
d60363f
chore: remove the depositRangeMin and depositRangeMax fields
matzduniuk Nov 18, 2025
0baa29c
chore: update the data formatter to handle different deposit type values
matzduniuk Nov 18, 2025
8952aeb
fix: update api integration tests to new changes
matzduniuk Nov 18, 2025
98b5456
fix: fix csv export integration tests
matzduniuk Nov 18, 2025
edb77e1
test: re-run testing suite
matzduniuk Nov 18, 2025
1efbca4
fix: update partners site integration tests
matzduniuk Nov 18, 2025
a3d85a1
test: re-run testing suite
matzduniuk Nov 18, 2025
0a2b691
fix: remove unnecessary console log
matzduniuk Nov 19, 2025
545fbb8
fix: clear deposit on save and continue (#5598)
ludtkemorgan Nov 19, 2025
cd9453d
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk Nov 20, 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
Expand Up @@ -10,8 +10,6 @@ CREATE TYPE "rent_type_enum" AS ENUM ('fixedRent', 'rentRange');
-- AlterTable
ALTER TABLE "listings"
ADD COLUMN "coc_info" TEXT,
ADD COLUMN "deposit_range_max" INTEGER,
ADD COLUMN "deposit_range_min" INTEGER,
ADD COLUMN "deposit_type" "deposit_type_enum",
ADD COLUMN "deposit_value" DECIMAL(65,30),
ADD COLUMN "has_hud_ebll_clearance" BOOLEAN,
Expand Down
Comment thread
matzduniuk marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-- AlterTable
ALTER TABLE "listings" ADD COLUMN "documents_id" UUID;

-- CreateTable
CREATE TABLE "listing_documents" (
"id" UUID NOT NULL DEFAULT uuid_generate_v4(),
"created_at" TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(6) NOT NULL,
"birth_certificate" BOOLEAN,
"current_landlord_reference" BOOLEAN,
"government_issued_id" BOOLEAN,
"previous_landlord_reference" BOOLEAN,
"proof_of_assets" BOOLEAN,
"proof_of_custody" BOOLEAN,
"proof_of_income" BOOLEAN,
"residency_documents" BOOLEAN,
"social_security_card" BOOLEAN,

CONSTRAINT "listing_documents_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "listings_documents_id_key" ON "listings"("documents_id");

-- AddForeignKey
ALTER TABLE "listings" ADD CONSTRAINT "listings_documents_id_fkey" FOREIGN KEY ("documents_id") REFERENCES "listing_documents"("id") ON DELETE NO ACTION ON UPDATE NO ACTION;
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE "unit_group"
ADD COLUMN "monthly_rent" DECIMAL,
ALTER COLUMN "flat_rent_value_from" SET DATA TYPE DECIMAL,
ALTER COLUMN "flat_rent_value_to" SET DATA TYPE DECIMAL;
27 changes: 23 additions & 4 deletions api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,24 @@ model ListingUtilities {
@@map("listing_utilities")
}

model ListingDocuments {
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)
socialSecurityCard Boolean? @map("social_security_card")
currentLandlordReference Boolean? @map("current_landlord_reference")
birthCertificate Boolean? @map("birth_certificate")
previousLandlordReference Boolean? @map("previous_landlord_reference")
governmentIssuedId Boolean? @map("government_issued_id")
proofOfAssets Boolean? @map("proof_of_assets")
proofOfIncome Boolean? @map("proof_of_income")
residencyDocuments Boolean? @map("residency_documents")
proofOfCustody Boolean? @map("proof_of_custody")
listings Listings?

@@map("listing_documents")
}

enum ListingTypeEnum {
regulated
nonRegulated
Expand Down Expand Up @@ -594,8 +612,6 @@ model Listings {
depositMax String? @map("deposit_max")
depositType DepositTypeEnum? @map("deposit_type")
depositValue Decimal? @map("deposit_value") @db.Decimal(8, 2)
depositRangeMin Int? @map("deposit_range_min")
depositRangeMax Int? @map("deposit_range_max")
depositHelperText String? @map("deposit_helper_text")
disableUnitsAccordion Boolean? @map("disable_units_accordion")
hasHudEbllClearance Boolean? @map("has_hud_ebll_clearance")
Expand All @@ -611,6 +627,7 @@ model Listings {
rentalAssistance String? @map("rental_assistance")
rentalHistory String? @map("rental_history")
requiredDocuments String? @map("required_documents")
requiredDocumentsList ListingDocuments? @relation(fields: [documentsId], references: [id], onDelete: NoAction, onUpdate: NoAction)
specialNotes String? @map("special_notes")
waitlistCurrentSize Int? @map("waitlist_current_size")
waitlistMaxSize Int? @map("waitlist_max_size")
Expand Down Expand Up @@ -644,6 +661,7 @@ 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
documentsId String? @unique() @map("documents_id") @db.Uuid
includeCommunityDisclaimer Boolean? @map("include_community_disclaimer")
communityDisclaimerTitle String? @map("community_disclaimer_title")
communityDisclaimerDescription String? @map("community_disclaimer_description")
Expand Down Expand Up @@ -1016,8 +1034,9 @@ model UnitGroup {
updatedAt DateTime @default(now()) @updatedAt @map("updated_at") @db.Timestamp(6)
maxOccupancy Int? @map("max_occupancy")
minOccupancy Int? @map("min_occupancy")
flatRentValueFrom Decimal? @map("flat_rent_value_from")
flatRentValueTo Decimal? @map("flat_rent_value_to")
flatRentValueFrom Decimal? @map("flat_rent_value_from") @db.Decimal
flatRentValueTo Decimal? @map("flat_rent_value_to") @db.Decimal
monthlyRent Decimal? @map("monthly_rent") @db.Decimal
floorMin Int? @map("floor_min")
floorMax Int? @map("floor_max")
totalCount Int? @map("total_count")
Expand Down
38 changes: 38 additions & 0 deletions api/prisma/seed-helpers/listing-factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
PrismaClient,
ReservedCommunityTypes,
ReviewOrderTypeEnum,
ListingTypeEnum,
} from '@prisma/client';
import { randomInt } from 'crypto';
import dayjs from 'dayjs';
Expand Down Expand Up @@ -51,6 +52,18 @@ type optionalFeatures = {
loweredCabinets?: boolean;
};

type requiredDocuments = {
socialSecurityCard?: boolean;
currentLandlordReference?: boolean;
birthCertificate?: boolean;
previousLandlordReference?: boolean;
governmentIssuedId?: boolean;
proofOfAssets?: boolean;
proofOfIncome?: boolean;
residencyDocuments?: boolean;
proofOfCustody?: boolean;
};

type optionalUtilities = {
water?: boolean;
gas?: boolean;
Expand Down Expand Up @@ -89,6 +102,7 @@ export const listingFactory = async (
unitGroups?: Prisma.UnitGroupCreateWithoutListingsInput[];
units?: Prisma.UnitsCreateWithoutListingsInput[];
userAccounts?: Prisma.UserAccountsWhereUniqueInput[];
requiredDocumentsList?: requiredDocuments;
},
): Promise<Prisma.ListingsCreateInput> => {
const previousListing = optionalParams?.listing || {};
Expand Down Expand Up @@ -260,6 +274,9 @@ export const listingFactory = async (
optionalParams?.optionalFeatures,
optionalParams?.optionalUtilities,
),
...(optionalParams?.listing?.listingType === ListingTypeEnum.nonRegulated
? listingsRequiredDocuments(optionalParams?.requiredDocumentsList)
: {}),
...previousListing,
};
};
Expand Down Expand Up @@ -289,6 +306,27 @@ const buildingFeatures = (includeBuildingFeatures: boolean) => {
};
};

export const listingsRequiredDocuments = (
requiredDocumentsList?: requiredDocuments,
): {
requiredDocumentsList;
} => ({
requiredDocumentsList: {
create: {
socialSecurityCard: randomBoolean(),
currentLandlordReference: randomBoolean(),
birthCertificate: randomBoolean(),
previousLandlordReference: randomBoolean(),
governmentIssuedId: randomBoolean(),
proofOfAssets: randomBoolean(),
proofOfIncome: randomBoolean(),
residencyDocuments: randomBoolean(),
proofOfCustody: randomBoolean(),
Comment thread
matzduniuk marked this conversation as resolved.
...requiredDocumentsList,
},
},
});

export const featuresAndUtilites = (
optionalFeatures?: optionalFeatures,
optionalUtilities?: optionalUtilities,
Expand Down
28 changes: 16 additions & 12 deletions api/src/decorators/validate-listing-deposit.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ValidatorOptions,
} from 'class-validator';
import Listing from '../dtos/listings/listing.dto';
import { DepositTypeEnum } from '@prisma/client';
import { DepositTypeEnum, ListingTypeEnum } from '@prisma/client';

export function ValidateListingDeposit(validationOptions?: ValidatorOptions) {
return function (object: object, propertyName: string) {
Expand All @@ -28,28 +28,32 @@ export class DepositValueConstraint implements ValidatorConstraintInterface {
}

validate(value: DepositTypeEnum, args: ValidationArguments) {
const { depositValue, depositRangeMin, depositRangeMax } =
const { depositValue, depositMin, depositMax, listingType } =
args.object as Listing;

if (!listingType || listingType === ListingTypeEnum.regulated) {
return true;
}

if (value === DepositTypeEnum.fixedDeposit) {
return (
!this.isFieldEmpty(depositValue) &&
this.isFieldEmpty(depositRangeMin) &&
this.isFieldEmpty(depositRangeMax)
);
return this.isFieldEmpty(depositMin) && this.isFieldEmpty(depositMax);
}
if (value === DepositTypeEnum.depositRange) {
return this.isFieldEmpty(depositValue);
}

// If no Deposit type is selected then validate that it's either just depositValue or just the range values
return (
this.isFieldEmpty(depositValue) &&
!this.isFieldEmpty(depositRangeMin) &&
!this.isFieldEmpty(depositRangeMax)
this.isFieldEmpty(depositValue) ||
(this.isFieldEmpty(depositMin) && this.isFieldEmpty(depositMax))
);
}
defaultMessage(args?: ValidationArguments): string {
const value = args.value as DepositTypeEnum;

if (value === DepositTypeEnum.fixedDeposit) {
return 'When deposit is of type "fixedDeposit" the "depositValue" must be filled and the "depositRangeMin"|"depositRangeMax" fields must be null';
return 'When deposit is of type "fixedDeposit" the "depositValue" must be filled and the "depositMin"|"depositMax" fields must be null';
}
return 'When deposit is of type "depositRange" the "depositRangeMin" and "depositRangeMax" fields must be filled and "depositValue" must be null';
return 'When deposit is of type "depositRange" the "depositMin" and "depositMax" fields must be filled and "depositValue" must be null';
}
}
2 changes: 1 addition & 1 deletion api/src/decorators/validate-unit-groups-rent.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
ValidatorConstraintInterface,
ValidatorOptions,
} from 'class-validator';
import UnitGroup from 'src/dtos/unit-groups/unit-group.dto';
import UnitGroup from '../dtos/unit-groups/unit-group.dto';

export function ValidateUnitGroupRent(validationOptions?: ValidatorOptions) {
return function (object: object, propertyName: string) {
Expand Down
58 changes: 58 additions & 0 deletions api/src/decorators/validate-units-rent.decorator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { RentTypeEnum } from '@prisma/client';
import {
registerDecorator,
ValidationArguments,
ValidationTypes,
ValidatorConstraint,
ValidatorConstraintInterface,
ValidatorOptions,
} from 'class-validator';
import UnitGroup from '../dtos/unit-groups/unit-group.dto';

export function ValidateUnitGroupRent(validationOptions?: ValidatorOptions) {
return function (object: object, propertyName: string) {
registerDecorator({
name: ValidationTypes.CUSTOM_VALIDATION,
target: object.constructor,
propertyName: propertyName,
options: validationOptions,
validator: RentValueConstraint,
});
};
}

@ValidatorConstraint()
export class RentValueConstraint implements ValidatorConstraintInterface {
isFieldEmpty(value): boolean {
return value === null || value === undefined;
}

validate(
value: RentTypeEnum,
validationArguments?: ValidationArguments,
): Promise<boolean> | boolean {
const { flatRentValueFrom, flatRentValueTo } =
validationArguments.object as UnitGroup;

if (value === RentTypeEnum.rentRange) {
return (
!this.isFieldEmpty(flatRentValueFrom) &&
!this.isFieldEmpty(flatRentValueTo)
);
} else {
return (
this.isFieldEmpty(flatRentValueFrom) &&
this.isFieldEmpty(flatRentValueTo)
);
}

return true;
}

defaultMessage(validationArguments?: ValidationArguments): string {
const rentType = validationArguments.value as RentTypeEnum;
if (rentType === RentTypeEnum.rentRange) {
return 'When rent is of type "rentRange" the "flatRentValueFrom" and "flatRentValueTo" fields must be filled';
}
}
}
51 changes: 51 additions & 0 deletions api/src/dtos/listings/listing-documents.dto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { ApiPropertyOptional } from '@nestjs/swagger';
import { Expose } from 'class-transformer';
import { IsBoolean } from 'class-validator';
import { ValidationsGroupsEnum } from '../../enums/shared/validation-groups-enum';

export class ListingDocuments {
@Expose()
@IsBoolean({ groups: [ValidationsGroupsEnum.default] })
@ApiPropertyOptional()
socialSecurityCard?: boolean;

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

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

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

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

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

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

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

@Expose()
@IsBoolean({ groups: [ValidationsGroupsEnum.default] })
@ApiPropertyOptional()
proofOfCustody?: boolean;
}
26 changes: 10 additions & 16 deletions api/src/dtos/listings/listing.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import {
ValidateOnlyUnitsOrUnitGroups,
} from '../../decorators/validate-units-required.decorator';
import { ValidateListingDeposit } from '../../decorators/validate-listing-deposit.decorator';
import { ListingDocuments } from './listing-documents.dto';

class Listing extends AbstractDTO {
@Expose()
Expand Down Expand Up @@ -398,22 +399,6 @@ class Listing extends AbstractDTO {
@ApiPropertyOptional()
depositValue?: number;

@Expose()
@ValidateListingPublish('depositRangeMin', {
groups: [ValidationsGroupsEnum.default],
})
@IsNumber()
@ApiPropertyOptional()
depositRangeMin?: number;

@Expose()
@ValidateListingPublish('depositRangeMax', {
groups: [ValidationsGroupsEnum.default],
})
@IsNumber()
@ApiPropertyOptional()
depositRangeMax?: number;

@Expose()
@ValidateListingPublish('depositHelperText', {
groups: [ValidationsGroupsEnum.default],
Expand Down Expand Up @@ -554,6 +539,15 @@ class Listing extends AbstractDTO {
@ApiPropertyOptional()
requiredDocuments?: string;

@Expose()
@ValidateListingPublish('requiredDocumentsList', {
groups: [ValidationsGroupsEnum.default],
})
@Type(() => ListingDocuments)
@ValidateNested({ groups: [ValidationsGroupsEnum.default], each: true })
@ApiPropertyOptional({ type: ListingDocuments })
requiredDocumentsList?: ListingDocuments;

@Expose()
@ValidateListingPublish('specialNotes', {
groups: [ValidationsGroupsEnum.default],
Expand Down
Loading
Loading