-
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.
Feat/add information on user bucket assignment in modal (#127)
* feat: add buckets join for user admin endpoint * chore: slight dialog refactor * feat: add popovers, disable on user having access * fix: remove console log * fix: build errors
- Loading branch information
1 parent
c96e21e
commit 8be45bf
Showing
25 changed files
with
870 additions
and
234 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
17 changes: 17 additions & 0 deletions
17
...cation/queryHandlers/findUsersWithBucketsQueryHandler/findUsersWithBucketsQueryHandler.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,17 @@ | ||
import { type QueryHandler } from '../../../../../common/types/queryHandler.js'; | ||
import { type UserWithBuckets } from '../../../domain/entities/user/user.js'; | ||
|
||
export interface FindUsersWithBucketsQueryHandlerPayload { | ||
readonly page: number; | ||
readonly pageSize: number; | ||
} | ||
|
||
export interface FindUsersWithBucketsQueryHandlerResult { | ||
readonly users: UserWithBuckets[]; | ||
readonly totalUsers: number; | ||
} | ||
|
||
export type FindUsersWithBucketsQueryHandler = QueryHandler< | ||
FindUsersWithBucketsQueryHandlerPayload, | ||
FindUsersWithBucketsQueryHandlerResult | ||
>; |
29 changes: 29 additions & 0 deletions
29
...on/queryHandlers/findUsersWithBucketsQueryHandler/findUsersWithBucketsQueryHandlerImpl.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,29 @@ | ||
import { | ||
type FindUsersWithBucketsQueryHandler, | ||
type FindUsersWithBucketsQueryHandlerPayload, | ||
type FindUsersWithBucketsQueryHandlerResult, | ||
} from './findUsersWithBucketsQueryHandler.js'; | ||
import { type UserRepository } from '../../../domain/repositories/userRepository/userRepository.js'; | ||
|
||
export class FindUsersWithBucketsQueryHandlerImpl implements FindUsersWithBucketsQueryHandler { | ||
public constructor(private readonly userRepository: UserRepository) {} | ||
|
||
public async execute( | ||
payload: FindUsersWithBucketsQueryHandlerPayload, | ||
): Promise<FindUsersWithBucketsQueryHandlerResult> { | ||
const { page, pageSize } = payload; | ||
|
||
const [usersWithBuckets, totalUsers] = await Promise.all([ | ||
this.userRepository.findUsersWithBuckets({ | ||
page, | ||
pageSize, | ||
}), | ||
this.userRepository.countUsers(), | ||
]); | ||
|
||
return { | ||
users: usersWithBuckets, | ||
totalUsers, | ||
}; | ||
} | ||
} |
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
8 changes: 6 additions & 2 deletions
8
...rc/modules/userModule/infrastructure/repositories/userRepository/userMapper/userMapper.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 |
---|---|---|
@@ -1,6 +1,10 @@ | ||
import { type User } from '../../../../domain/entities/user/user.js'; | ||
import { type UserRawEntity } from '../../../databases/userDatabase/tables/userTable/userRawEntity.js'; | ||
import { type UserWithBuckets, type User } from '../../../../domain/entities/user/user.js'; | ||
import { | ||
type UserWithBucketsJoinRawEntity, | ||
type UserRawEntity, | ||
} from '../../../databases/userDatabase/tables/userTable/userRawEntity.js'; | ||
|
||
export interface UserMapper { | ||
mapToDomain(rawEntity: UserRawEntity): User; | ||
mapToDomainWithBuckets(rawEntities: UserWithBucketsJoinRawEntity[]): UserWithBuckets[]; | ||
} |
56 changes: 54 additions & 2 deletions
56
...odules/userModule/infrastructure/repositories/userRepository/userMapper/userMapperImpl.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
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
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.