Skip to content
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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

MajedAlaitwniCap
Copy link
Contributor

Description

Links to Tickets or other pull requests

https://ticketsystem.dbildungscloud.de/browse/EW-777

Approval for review

  • DEV: If api was changed - generate-client:server was executed in vue frontend and changes were tested and put in a PR with the same branch name.
  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.

@alweber-cap alweber-cap self-requested a review January 3, 2025 12:57

class AccountRepoSpec extends AccountRepo {
Copy link
Contributor

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

Copy link
Contributor Author

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> {
Copy link
Contributor

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.

Copy link
Contributor Author

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> {
Copy link
Contributor

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', () => {
Copy link
Contributor

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

@@ -13,7 +13,7 @@ export class AccountByIdBodyParams {
required: false,
nullable: true,
})
username?: string;
Copy link
Contributor

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;
Copy link
Contributor

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()
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants