-
Notifications
You must be signed in to change notification settings - Fork 17
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
EW-777 working on review account module Refactoring part #5406
base: main
Are you sure you want to change the base?
Conversation
|
||
class AccountRepoSpec extends AccountRepo { |
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.
Rename to "AccountTestRepo" to make its use better visible
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.
done
export class AccountRepo { | ||
constructor(private readonly em: EntityManager) {} | ||
export class AccountRepo extends BaseDomainObjectRepo<Account, AccountEntity> { | ||
protected mapDOToEntityProperties(entityDO: Account): EntityData<AccountEntity> { |
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.
Place this method after the constructor and getter.
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.
done
|
||
return entityProps; | ||
} | ||
|
||
public async save(account: Account): Promise<Account> { |
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.
Some methods are no longer needed now that this class derives from BaseDomainObjectRepo
.
Check if there are methods already in BaseDomainObjectRepo
like save
and saveAll
that can be removed here
mapDOToEntityPropertiesSpec(entityDO: Account): EntityData<AccountEntity> { | ||
return super.mapDOToEntityProperties(entityDO); | ||
} | ||
} | ||
describe('account repo', () => { |
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.
Use real name of class: AccountRepo
apps/server/src/modules/account/domain/services/account.service.ts
Outdated
Show resolved
Hide resolved
apps/server/src/modules/account/domain/services/account.service.ts
Outdated
Show resolved
Hide resolved
apps/server/src/modules/account/domain/services/account.service.ts
Outdated
Show resolved
Hide resolved
@@ -13,7 +13,7 @@ export class AccountByIdBodyParams { | |||
required: false, | |||
nullable: true, | |||
}) | |||
username?: string; |
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.
Use @ApiPropertyOptional for optional values (required: false, nullable: true) in this file
@@ -21,7 +21,7 @@ export class PatchMyAccountParams { | |||
required: false, | |||
nullable: true, | |||
}) | |||
passwordNew?: string; | |||
public passwordNew?: string; |
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.
Use @ApiPropertyOptional for optional values (required: false, nullable: true) in this file
|
||
export class ResolvedAccountDto { | ||
@IsOptional() | ||
@ApiPropertyOptional() |
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.
Not sure if we need ApiPropertyOptional here
Quality Gate passedIssues Measures |
Description
Links to Tickets or other pull requests
https://ticketsystem.dbildungscloud.de/browse/EW-777
Approval for review
generate-client:server
was executed in vue frontend and changes were tested and put in a PR with the same branch name.