-
Notifications
You must be signed in to change notification settings - Fork 43
feat: non-regulated fields implementation #5455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
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 6db2a67
chore: add new enum types
matzduniuk 6ee3134
chore: add new Listings model fields
matzduniuk 19e2d5e
chore: add new fields to the UnitGroup model
matzduniuk a082fd7
chore: update DTO's to changes in schema
matzduniuk 2dcb632
chore: generate new swagger types
matzduniuk ca450a1
chore: add migration for new schema updates
matzduniuk 9a6d37d
fix: update depositValue field decimal range
matzduniuk 4b9c250
Merge branch 'main' into 5376/database-schema-updates
matzduniuk 1bcf860
Merge branch 'main' into 5376/database-schema-updates
matzduniuk f05c50d
fix: add missing field names
matzduniuk 7d78997
chore: add custom deposit validation decorator
matzduniuk cdd4c2a
chore: add unit group rent type validation
matzduniuk ceb9ee8
fix: remove unnecessary import
matzduniuk b39299a
chore: update sunit summary DTO to contain new fields
matzduniuk dfc3173
chore: update service layer
matzduniuk ada8d52
fix: remove unnecessary migration update
matzduniuk eeb5bfa
fix: update db fields
matzduniuk e506251
Merge branch '5376/database-schema-updates' into 5377/non-regulated-l…
matzduniuk 5250427
chore: update rent validation decorator
matzduniuk 1bf8c66
chore: add the cocInfo to the listing DTO
matzduniuk da79ff3
chore: regenerate backend swagger
matzduniuk bde59a9
chore: add listing type selector
matzduniuk f3d8fdb
chore: add unit form non regulated rent fields
matzduniuk 84fa3c5
fix: fix invalid logic
matzduniuk 8a1300e
chore: update prop to and optional value
matzduniuk 51e13db
chore: add rent type fields for unit group form
matzduniuk 1d6a74b
chore: hide additional fields for non regulated listings
matzduniuk 53b3a6b
chore: add fields for the deposit types
matzduniuk 460d55a
chore: update labels
matzduniuk f1ca76a
chore: update community types fields
matzduniuk fff8934
chore: add listing ebll clearance field
matzduniuk c288da6
chore: update built year filed rendering logic
matzduniuk 3afdfed
Merge branch 'main' into 5377/non-regulated-listings-api-layer-updates
matzduniuk 006f9bc
chore: fix field decorator error
matzduniuk d237066
fix: fix decorators import paths
matzduniuk 16373ee
chore: update required documents form fields
matzduniuk 6118b98
Merge branch 'main' into 5377/non-regulated-listings-api-layer-updates
matzduniuk f22d168
Merge branch '5377/non-regulated-listings-api-layer-updates' into 538…
matzduniuk 1507925
chore: update the schema to include the new required documents list t…
matzduniuk 1afaf3b
fix: remove unused import
matzduniuk ad195fc
chore: update listings factory to include the new required documents …
matzduniuk 85226fb
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk 11f0874
chore: hide non regulated switch field based on feature flag
matzduniuk 914a2db
chore: retain the original required documents field
matzduniuk 10be0f9
Revert "chore: hide non regulated switch field based on feature flag"
matzduniuk 319599b
fix: add missing fields validation
matzduniuk 8b9611f
fix: update imports
matzduniuk 1da2a62
fix: remove the package manager filed in package JSON
matzduniuk e9ef75a
fix: update the hasHudEbllClearance field
matzduniuk df5fa5d
fix: remove unused import
matzduniuk dfc7714
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk 278efcf
chore: update the label to match the current listing type
matzduniuk 7239564
fix: fix the application fee full width field
matzduniuk b30668b
fix: hide the new deposit and rent fields for regulated units
matzduniuk de66bca
fix: boolean ebll formatting for form submission
matzduniuk 475bb36
chore: add non regulated listing fields to intro and fees sections
matzduniuk f561204
chore: add missing documents model column mapping
matzduniuk d0a6ccd
fix: udpdate form subssion for the new required documents field
matzduniuk 6160064
chore: add required documents preview in the details
matzduniuk ba55947
fix: add feature flag based regulated fields control
matzduniuk c1e9605
chore: update the validation decorator
matzduniuk eb745c9
chore: update listing details page to new jest standard
matzduniuk 92b1e04
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk 5625199
fix: fix failing backend API tests
matzduniuk b5ece3b
fix: fix backend integration tests
matzduniuk 24c6abf
fix: fix decorator logic
matzduniuk e9936bb
fix: add unit group rent range revalidation triggering
matzduniuk 09ddfb2
fix: fix unwanted initial ebll field reset
matzduniuk 36c5a01
fix: required documents preview filtering
matzduniuk 597e840
fix: update the developer field title switching on listing preview page
matzduniuk edade1b
fix: hide new fields on listing preview based on the non-regulated fe…
matzduniuk d61a472
fix: fix label typo
matzduniuk 76c226d
fix: update new required documents field label formatting
matzduniuk d7afcd9
fix: hide the new documents field group on regulated listings
matzduniuk 63f1600
fix: remove unused import
matzduniuk 1006fc0
fix: add missing monthly rent field to database
matzduniuk 291d321
fix: fix unit groups integration tests
matzduniuk 306232c
fix: paper listing form failing tests
matzduniuk e465ef4
chore: rename migration files
matzduniuk 592cae9
fix: clean-up merge conflict resolve
matzduniuk c8ff3c5
fix: remove unnecessary listing service code
matzduniuk 1da4d98
fix: hide the new required documents field from preview page based on…
matzduniuk 03ed802
fix: remove unused prop
matzduniuk c9b5b7d
fix: update the listings factory to add new required documents only f…
matzduniuk 71a26af
chore: add logic to disconnect and delete documents table entry autom…
matzduniuk f76c969
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk 9535528
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk 27ac650
fix: fix Units component feature flag detection code
matzduniuk 51f1cab
chore: add integration tests for non regulated listing preview
matzduniuk 6e70cf0
chore: add integration tests for the ListingIntro section
matzduniuk eadcbc2
chore: add integration tests for AdditionalDetails form section compo…
matzduniuk 5e27a79
chore: add deposit type default field for the listing form
matzduniuk 4377a7f
chore: add integration tests for the AdditionalFees listing form comp…
matzduniuk c4b0258
chore: add integration tests for the unit group form for non-regulate…
matzduniuk fe00e85
fix: update the listing service to remove the documents entry after c…
matzduniuk e7b61b0
fix: revert the CommunityType component logic
matzduniuk a61f19d
chore: partially revert additional fees section logic
matzduniuk e535fa6
fix: update the listingType field clearing to undefined
matzduniuk 16f0e1f
fix: remove unused imports
matzduniuk 7aa5cbc
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk 09ec8e0
fix: revert changes for unit form
matzduniuk 2ae4837
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk f605050
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk c3e16bf
test: re-run testing suite
matzduniuk 987b734
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk d60363f
chore: remove the depositRangeMin and depositRangeMax fields
matzduniuk 0baa29c
chore: update the data formatter to handle different deposit type values
matzduniuk 8952aeb
fix: update api integration tests to new changes
matzduniuk 98b5456
fix: fix csv export integration tests
matzduniuk edb77e1
test: re-run testing suite
matzduniuk 1efbca4
fix: update partners site integration tests
matzduniuk a3d85a1
test: re-run testing suite
matzduniuk 0a2b691
fix: remove unnecessary console log
matzduniuk 545fbb8
fix: clear deposit on save and continue (#5598)
ludtkemorgan cd9453d
Merge branch 'main' into 5380/non-regulated-fields-implementation
matzduniuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
api/prisma/migrations/37_add_required_documents_list_model/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
4 changes: 4 additions & 0 deletions
4
api/prisma/migrations/38_add_monthly_rent_to_unit_group/migration.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'; | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.