-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/activity-duration-when-changing-role
- Loading branch information
Showing
112 changed files
with
1,463 additions
and
563 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
2 changes: 1 addition & 1 deletion
2
src/features/administration/features/project/application/block-project-cmd.test.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
8 changes: 3 additions & 5 deletions
8
src/features/administration/features/project/application/block-project-cmd.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
39 changes: 0 additions & 39 deletions
39
src/features/administration/features/project/application/get-projects-list-qry.ts
This file was deleted.
Oops, something went wrong.
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
41 changes: 41 additions & 0 deletions
41
...atures/administration/features/project/application/get-projects-with-blocker-user-name.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,41 @@ | ||
import { InvalidateCache, Query, UseCaseKey } from '@archimedes/arch' | ||
import { GetUsersListQry } from '../../../../shared/user/application/get-users-list-qry' | ||
import { singleton } from 'tsyringe' | ||
import { Id } from '../../../../../shared/types/id' | ||
import { Project } from '../../../../shared/project/domain/project' | ||
import { ProjectOrganizationFilters } from '../../../../shared/project/domain/project-organization-filters' | ||
import { ProjectsWithUserName } from '../domain/services/projects-with-user-name' | ||
import { GetProjectsQry } from '../../../../shared/project/application/binnacle/get-projects-qry' | ||
|
||
@UseCaseKey('GetProjectsWithBlockerUserName') | ||
@InvalidateCache | ||
@singleton() | ||
export class GetProjectsWithBlockerUserName extends Query<Project[], ProjectOrganizationFilters> { | ||
constructor( | ||
private getProjectsQry: GetProjectsQry, | ||
private getUsersListQry: GetUsersListQry, | ||
private projectsWithUserName: ProjectsWithUserName | ||
) { | ||
super() | ||
} | ||
|
||
async internalExecute(organizationStatus?: ProjectOrganizationFilters): Promise<Project[]> { | ||
if (organizationStatus) { | ||
const projects = await this.getProjectsQry.execute(organizationStatus) | ||
|
||
const blockerUserIds = projects | ||
.map((project) => project.blockedByUser) | ||
.filter((id) => id !== null) as Id[] | ||
|
||
if (blockerUserIds.length > 0) { | ||
const uniqueBlockerUserIds = Array.from(new Set(blockerUserIds)) | ||
const usersList = await this.getUsersListQry.execute({ | ||
ids: uniqueBlockerUserIds | ||
}) | ||
return this.projectsWithUserName.addProjectBlockerUserName(projects, usersList) | ||
} | ||
return projects | ||
} | ||
return [] | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/features/administration/features/project/application/unblock-project-cmd.test.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
8 changes: 3 additions & 5 deletions
8
src/features/administration/features/project/application/unblock-project-cmd.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
6 changes: 0 additions & 6 deletions
6
src/features/administration/features/project/domain/organization-status.ts
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
src/features/administration/features/project/domain/project-repository.ts
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/features/administration/features/project/domain/services/projects-with-user-name.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
112 changes: 0 additions & 112 deletions
112
src/features/administration/features/project/domain/tests/project-mother.ts
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
src/features/administration/features/project/infrastructure/fake-project-repository.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.