-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AFS e2e tests to cover update scenario (#1810)
* Add AFS e2e tests to cover update scenario * Update CHANGELOG.md * Add constraint that leasing agent can only resolve AFS when listing is closed * Make application updates trigger AFS recalculations * Add AFS e2e tests to cover update scenario * Update CHANGELOG.md * Add constraint that leasing agent can only resolve AFS when listing is closed * Make application updates trigger AFS recalculations * Improve query efficiency in onApplicationUpdate AFS module * refactor(backend): simplify AFS filtering by applicationId query Co-authored-by: Sean Albert <[email protected]>
- Loading branch information
1 parent
57d84dc
commit e67582a
Showing
11 changed files
with
371 additions
and
82 deletions.
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.