-
Notifications
You must be signed in to change notification settings - Fork 25
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
Add AFS e2e tests to cover update scenario #1810
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
019133e
Add AFS e2e tests to cover update scenario
pbn4 6bf0a41
Update CHANGELOG.md
pbn4 fd7daca
Add constraint that leasing agent can only resolve AFS when listing i…
pbn4 8d6ac3d
Make application updates trigger AFS recalculations
pbn4 46fab10
merge upstream
seanmalbert 06dafc6
Add AFS e2e tests to cover update scenario
pbn4 ed7e4ca
Update CHANGELOG.md
pbn4 b98daa9
Add constraint that leasing agent can only resolve AFS when listing i…
pbn4 eaa959a
Make application updates trigger AFS recalculations
pbn4 9bcd1ab
Merge branch '1367/update_application_duplicates_on_edit' of github.c…
pbn4 87d4ff1
Improve query efficiency in onApplicationUpdate AFS module
pbn4 afbc79a
Merge remote-tracking branch 'remotes/upstream/dev' into 1367/update_…
seanmalbert 38ecb81
refactor(backend): simplify AFS filtering by applicationId query
pbn4 1007ffc
feat(backend): make AFS module take applications updates into account
pbn4 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 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 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 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
7 changes: 7 additions & 0 deletions
7
backend/core/src/application-flagged-sets/dto/application-flagged-set-pagination-meta.ts
This file contains 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,7 @@ | ||
import { PaginationMeta } from "../../shared/dto/pagination.dto" | ||
import { Expose } from "class-transformer" | ||
|
||
export class ApplicationFlaggedSetPaginationMeta extends PaginationMeta { | ||
@Expose() | ||
totalFlagged: number | ||
} |
18 changes: 18 additions & 0 deletions
18
backend/core/src/application-flagged-sets/dto/application-flagged-set-resolve.dto.ts
This file contains 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,18 @@ | ||
import { Expose, Type } from "class-transformer" | ||
import { ArrayMaxSize, IsArray, IsDefined, IsUUID, ValidateNested } from "class-validator" | ||
import { ValidationsGroupsEnum } from "../../shared/types/validations-groups-enum" | ||
import { IdDto } from "../../shared/dto/id.dto" | ||
|
||
export class ApplicationFlaggedSetResolveDto { | ||
@Expose() | ||
@IsUUID(4, { groups: [ValidationsGroupsEnum.default] }) | ||
afsId: string | ||
|
||
@Expose() | ||
@IsDefined({ groups: [ValidationsGroupsEnum.default] }) | ||
@IsArray({ groups: [ValidationsGroupsEnum.default] }) | ||
@ArrayMaxSize(512, { groups: [ValidationsGroupsEnum.default] }) | ||
@ValidateNested({ groups: [ValidationsGroupsEnum.default], each: true }) | ||
@Type(() => IdDto) | ||
applications: IdDto[] | ||
} |
This file contains 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
11 changes: 11 additions & 0 deletions
11
backend/core/src/application-flagged-sets/dto/paginated-application-flagged-set.dto.ts
This file contains 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,11 @@ | ||
import { PaginationFactory } from "../../shared/dto/pagination.dto" | ||
import { Expose } from "class-transformer" | ||
import { ApplicationFlaggedSetPaginationMeta } from "./application-flagged-set-pagination-meta" | ||
import { ApplicationFlaggedSetDto } from "./application-flagged-set.dto" | ||
|
||
export class PaginatedApplicationFlaggedSetDto extends PaginationFactory<ApplicationFlaggedSetDto>( | ||
ApplicationFlaggedSetDto | ||
) { | ||
@Expose() | ||
meta: ApplicationFlaggedSetPaginationMeta | ||
} |
This file contains 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
16 changes: 16 additions & 0 deletions
16
backend/core/src/application-flagged-sets/paginated-application-flagged-set-query-params.ts
This file contains 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,16 @@ | ||
import { PaginationQueryParams } from "../shared/dto/pagination.dto" | ||
import { Expose } from "class-transformer" | ||
import { ApiProperty } from "@nestjs/swagger" | ||
import { IsUUID } from "class-validator" | ||
import { ValidationsGroupsEnum } from "../shared/types/validations-groups-enum" | ||
|
||
export class PaginatedApplicationFlaggedSetQueryParams extends PaginationQueryParams { | ||
@Expose() | ||
@ApiProperty({ | ||
type: String, | ||
example: "listingId", | ||
required: true, | ||
}) | ||
@IsUUID(4, { groups: [ValidationsGroupsEnum.default] }) | ||
listingId: string | ||
} |
This file contains 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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're removing newApplication from the flagged and if there's one still in the flagged set, we're removing that one from the set, leaving only newApplication in the flagged set. Is that what we want?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of the code is reverting any AFS logic for given application id (as if it was never added to any AFS) and it's also removing logically incorrect AFSes. Once AFS containing application with given appId is found, the application is removed from it and since AFS with just 1 application left does not make sense, it's removed too. It will probably be recreated again by onApplicationSave logic but I just wanted it to be trivial and reuse what already works.