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

Oliinyk / Token PersonalInfo read replacement & Removing Subrole concept & Employee role #2649

Merged
merged 13 commits into from
Dec 13, 2024

Conversation

doliinyk
Copy link
Member

@doliinyk doliinyk commented Nov 7, 2024

This PR aims on removing Subrole concept, which was invented in purpose to differ provider users, for example:

  • none (provider)
  • provider deputy
  • provider admin

It's decided to remove this concept and migrate them to Role (only provider was known as Role).
Also, role, that was read from auth token, here's got from PersonalInfo endpoint because token payload will be encrypted due to its sensitive content.

Per 9/12 there's also fixes for new Employee role.

@humanmantis let's ignore current coverage issues since they're mostly detected as renamed files.

@doliinyk doliinyk requested review from DmyMi and humanmantis November 7, 2024 11:50
@doliinyk doliinyk self-assigned this Nov 7, 2024
@doliinyk doliinyk changed the title Oliinyk / Token PersonalInfo read replacement & Removing Subrole concept Oliinyk / Token PersonalInfo read replacement & Removing Subrole concept & Employee role Dec 9, 2024
…ializer, fixed pending applications fetch for provider while profile wasn't received already
@doliinyk doliinyk marked this pull request as ready for review December 9, 2024 17:41
export enum EntityType {
provider = 'provider',
workshop = 'workshop',
ProviderAdmin = 'provideradmin',
ProviderDeputy = 'provider',
providerDeputy = 'provider',
Copy link
Contributor

Choose a reason for hiding this comment

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

I would like to avoid using the same values for enums.
This was before your changes, but could you please check if it's not difficult to remove this

Copy link
Member Author

Choose a reason for hiding this comment

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

Possibly, in the past this enum was dedicated to be used in filtering ratings by type. However, in our project it's always workshop type is used and for provider rating is always returned within the provider info.
Backend also uses only workshop for rating https://github.com/ita-social-projects/OoS-Backend/blob/87d225785d61b617b627b958179417313ab63ef6/OutOfSchool/OutOfSchool.WebApi/Controllers/V1/RatingController.cs#L108
Though, I will remove this option

@@ -28,3 +25,5 @@ export enum UserTabParams {
parent,
child
}

export const ProviderRoles = [Role.provider, Role.providerDeputy, Role.employee];
Copy link
Contributor

Choose a reason for hiding this comment

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

We only use it in util, so we can probably remove it from here

@doliinyk doliinyk requested a review from humanmantis December 13, 2024 07:21
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
67.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@doliinyk doliinyk merged commit 8819174 into develop Dec 13, 2024
2 of 3 checks passed
@doliinyk doliinyk deleted the Oliinyk/TokenPersonalInfoReadReplacement branch December 13, 2024 16:07
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.

2 participants