-
Notifications
You must be signed in to change notification settings - Fork 40
feat: housing advocate user updates #5877
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
53 commits
Select commit
Hold shift + click to select a range
f668a83
chore: add new Advocate User related fields to user DTO
matzduniuk 686424e
chore: remove generic user update and create DTOs
matzduniuk d689c52
chore: add a new public user update and create DTOs
matzduniuk 87c1b9f
chore: add a new partner user update and create DTOs
matzduniuk a1297c5
chore: add a new advocate user update and create DTOs
matzduniuk 338bf34
chore: update user invite DTO to be partner user specific
matzduniuk 5f08240
chore: upadte the user controller and service methods to work with ne…
matzduniuk 0b6993d
chore: remove unused imports
matzduniuk 29752a8
fix: uupdate import path to relative format
matzduniuk 3353d85
fix: update the partner creation pipeline to use the userRoles field
matzduniuk 0169139
chore: add missing update DTOs as additional models to user controller
matzduniuk 4b6350c
fix: update the advocate user update dto to use AdressUpdate type
matzduniuk 7e60d6f
chore: add missing advocate user related fields to user update pipeline
matzduniuk 1f84ab3
fix: fix imports to relative paths
matzduniuk b21c324
fix: generate new swagger types
matzduniuk 1cc0967
fix: update api layer tests to use new endpoints and DTO
matzduniuk da61df5
Merge branch 'main' into 5719/housing-advocate-user-updates
matzduniuk f0003f2
fix: remove unusued service
matzduniuk b01047d
chore: update the jurisdiction field for user creation and updates
matzduniuk b0e13ca
fix: fix failing user controller integration tests
matzduniuk a75e3e9
chore: gupdate update sergice function to accept entire request objec…
matzduniuk b3382ca
chore: update and re-generate swagger API types
matzduniuk ef59f4f
chore: update userService usage to new creation and update methods
matzduniuk c334f53
chore: remove the user from the update service function arguments
matzduniuk 443909b
fix: update failing user service tests
matzduniuk 6a9b836
fix: fix failing tests
matzduniuk e3dc8de
Merge branch 'main' into 5719/housing-advocate-user-updates
matzduniuk 6cf0364
fix: fix public page integration tests
matzduniuk 2531b3d
fix: fix partner sites integration tests
matzduniuk 1be9591
chore: update partner creation endpoints guards
matzduniuk 50f1d4f
chore: remove the partner user invite DTO and endpoint
matzduniuk 0c99054
Merge branch 'main' into 5719/housing-advocate-user-updates
matzduniuk 39667ff
Merge branch 'main' into 5719/housing-advocate-user-updates
matzduniuk 5c488ef
fix: fix main branch merge resolve errors
matzduniuk 6c4382d
fix: fix failing user service integration tests
matzduniuk a5cf16b
fix: fix partners site integration tests
matzduniuk 2741b7d
fix: add a activity log interceptor to the partner creation endpoint
matzduniuk 31d26ab
chore: add a user service tests for creating an advocate user
matzduniuk e3ad934
chore: add user controller advocate user creation test case
matzduniuk f37de70
fix: fix user controller failing test
matzduniuk d9554fd
Merge branch 'main' into 5719/housing-advocate-user-updates
matzduniuk 4a1562f
fix: remove listing redirect appURL from partner creation
matzduniuk 9afc2ec
fix: fix import paths
matzduniuk 5850f14
chore: update creation address handling to use the transactions array
matzduniuk d1486ef
fix: skip id when updating and exiting users address
matzduniuk aa03f30
fix: remove redundant listings and jurisdictions handling from final …
matzduniuk b5a1695
chore: move agency handling to a separated call for more graniular ha…
matzduniuk 85ef057
fix: simplify jurisdictions creation for user creation pipeline
matzduniuk e2095a7
fix: fix wrong agency id usage for diconnect
matzduniuk 86717b2
chore: fix failing tests
matzduniuk 97186cc
chore: add integration tests for agency connecting and disconnecting
matzduniuk 14f3dc1
Merge branch 'main' into 5719/housing-advocate-user-updates
matzduniuk f71ee2e
fix: remaining relative path
emilyjablonski 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
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,23 @@ | ||
| import { OmitType } from '@nestjs/swagger'; | ||
| import { AdvocateUserUpdate } from './advocate-user-update.dto'; | ||
| export class AdvocateUserCreate extends OmitType(AdvocateUserUpdate, [ | ||
| 'id', | ||
| 'newEmail', | ||
| 'currentPassword', | ||
| 'password', | ||
| 'title', | ||
| 'phoneNumber', | ||
| 'phoneType', | ||
| 'phoneExtension', | ||
| 'additionalPhoneNumber', | ||
| 'additionalPhoneNumberType', | ||
| 'additionalPhoneExtension', | ||
| ] as const) { | ||
| /* Fields inherited from AdvocateUserUpdate: | ||
| * - firstName (inherited as required from AdvocateUserUpdate) | ||
| * - middleName (inherited as optional from AdvocateUserUpdate) | ||
| * - lastName (inherited as required from AdvocateUserUpdate) | ||
| * - agency (inherited as required from AdvocateUserUpdate) | ||
| * - email (inherited as required from AdvocateUserUpdate) | ||
| **/ | ||
| } |
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,99 @@ | ||
| import { ApiProperty, ApiPropertyOptional, OmitType } from '@nestjs/swagger'; | ||
| import { Expose, Type } from 'class-transformer'; | ||
| import { | ||
| IsArray, | ||
| IsEmail, | ||
| IsNotEmpty, | ||
| IsPhoneNumber, | ||
| IsString, | ||
| Matches, | ||
| MaxLength, | ||
| ValidateIf, | ||
| ValidateNested, | ||
| } from 'class-validator'; | ||
| import { ValidationsGroupsEnum } from '../../enums/shared/validation-groups-enum'; | ||
| import Agency from '../agency/agency.dto'; | ||
| import { User } from './user.dto'; | ||
| import { EnforceLowerCase } from '../../decorators/enforce-lower-case.decorator'; | ||
| import { passwordRegex } from '../../utilities/password-regex'; | ||
| import { AddressUpdate } from '../addresses/address-update.dto'; | ||
| import { IdDTO } from '../shared/id.dto'; | ||
|
|
||
| export class AdvocateUserUpdate extends OmitType(User, [ | ||
| 'createdAt', | ||
| 'updatedAt', | ||
| 'agency', | ||
| 'address', | ||
| 'phoneNumber', | ||
| 'passwordUpdatedAt', | ||
| 'passwordValidForDays', | ||
| 'passwordUpdatedAt', | ||
| 'jurisdictions', | ||
| ] as const) { | ||
| /* Fields inherited from BaseUser: | ||
| * - firstName (inherited as required from BaseUser) | ||
| * - middleName (inherited as optional from BaseUser) | ||
| * - lastName (inherited as required from BaseUser) | ||
| * - email (inherited as required from BaseUser) | ||
| * - title (inherited as optional from BaseUserUpdate) | ||
| * - phoneExtension (inherited as optional from BaseUserUpdate) | ||
| * - additionalPhoneNumber (inherited as optional from BaseUserUpdate) | ||
| * - additionalPhoneNumberType (inherited as optional from BaseUserUpdate) | ||
| * - additionalPhoneExtension (inherited as optional from BaseUserUpdate) | ||
| **/ | ||
|
|
||
| @Expose() | ||
| @ValidateNested({ groups: [ValidationsGroupsEnum.default] }) | ||
| @Type(() => Agency) | ||
| @ApiProperty({ type: Agency }) | ||
| agency: Agency; | ||
|
|
||
| @Expose() | ||
| @ValidateNested({ groups: [ValidationsGroupsEnum.default] }) | ||
| @Type(() => AddressUpdate) | ||
| @ApiProperty({ type: AddressUpdate }) | ||
| address: AddressUpdate; | ||
|
|
||
| @Expose() | ||
| @IsPhoneNumber('US', { groups: [ValidationsGroupsEnum.default] }) | ||
| @ApiProperty() | ||
| phoneNumber: string; | ||
|
|
||
| @Expose() | ||
| @IsString({ groups: [ValidationsGroupsEnum.default] }) | ||
| @ApiProperty() | ||
| phoneType: string; | ||
|
|
||
| @Expose() | ||
| @ApiPropertyOptional() | ||
| @IsEmail({}, { groups: [ValidationsGroupsEnum.default] }) | ||
| @EnforceLowerCase() | ||
| newEmail?: string; | ||
|
|
||
| @Expose() | ||
| @ApiPropertyOptional() | ||
| @IsString({ groups: [ValidationsGroupsEnum.default] }) | ||
| @Matches(passwordRegex, { | ||
| message: 'passwordTooWeak', | ||
| groups: [ValidationsGroupsEnum.default], | ||
| }) | ||
| password?: string; | ||
|
|
||
| @Expose() | ||
| @ValidateIf((o) => o.password, { groups: [ValidationsGroupsEnum.default] }) | ||
| @IsNotEmpty({ groups: [ValidationsGroupsEnum.default] }) | ||
| @ApiPropertyOptional() | ||
| currentPassword?: string; | ||
|
|
||
| @Expose() | ||
| @IsString({ groups: [ValidationsGroupsEnum.default] }) | ||
| @MaxLength(256, { groups: [ValidationsGroupsEnum.default] }) | ||
| @ApiPropertyOptional() | ||
| appUrl?: string; | ||
|
|
||
| @Expose() | ||
| @Type(() => IdDTO) | ||
| @IsArray({ groups: [ValidationsGroupsEnum.default] }) | ||
| @ApiPropertyOptional({ type: IdDTO, isArray: true }) | ||
| jurisdictions?: IdDTO[]; | ||
| } |
30 changes: 11 additions & 19 deletions
30
api/src/dtos/users/user-invite.dto.ts → ...src/dtos/users/partner-user-create.dto.ts
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.