Skip to content

added repository, service, models and mappers#3

Open
Martynice wants to merge 3 commits into
mainfrom
hw-3
Open

added repository, service, models and mappers#3
Martynice wants to merge 3 commits into
mainfrom
hw-3

Conversation

@Martynice

Copy link
Copy Markdown
Owner

No description provided.

Comment on lines +17 to +18
private int id;
private int externalId;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private int id;
private int externalId;
private Long id;
private Long externalId;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

private int helpfulnessNumerator;
private int helpfulnessDenominator;
private int score;
private int time;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private int time;
private LocalDateTime time;

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Enumerated(EnumType.STRING)
private RoleName roleName;

public static Role of(String roleName) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's make the constructor private?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How will we use Role.of() then?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

будь уважним)) Ксенія говорила про конструктор, а не статичний метод

user.setExternalId(reviewDto.getUserId());
user.setProfileName(reviewDto.getProfileName());
user.setPassword(PASSWORD);
user.setRoles(Set.of(Role.of(ROLE_NAME)));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should create a separate class in our project where we add all the entities that were parsed from the file to the database

in this class we should fetch the role by rolename from the database (it should have id), and then set this role to the user

so, let's create that class and remove setting the roles and password from here

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@Enumerated(EnumType.STRING)
private RoleName roleName;

public static Role of(String roleName) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

будь уважним)) Ксенія говорила про конструктор, а не статичний метод


@Override
public List<Review> saveReviews(List<ReviewDto> data) {
List<Review> reviews = data.stream()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

де ми для рев'ю додаємо продукт і юзера?

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