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

add employee field throughout files #267

Merged
merged 15 commits into from
Feb 9, 2025

Conversation

laurenbrissette
Copy link
Contributor

@laurenbrissette laurenbrissette commented Jan 25, 2025

Description

Added a scope field to Employee schema, dto, and Employee service. Also changed the signature of complete registration. Right now assigns default of base user, but we can add in the ability for users to choose this when they register or pull it from their account.

Motivation and Context

To allow for differentiation between admin and normal user functionality to be implemented.

Closes [#238 ]

How has this been tested?

The site was able to compile and run after the changes we made.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Co-authored-by: Gayatri Kondabathini <Gayatri-K26@users.noreply.github.com>
@laurenbrissette laurenbrissette linked an issue Jan 25, 2025 that may be closed by this pull request
4 tasks
Copy link

vercel bot commented Jan 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mfa-form-automator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 9, 2025 5:42am

ahweigl
ahweigl previously approved these changes Jan 25, 2025
Copy link
Contributor

@ahweigl ahweigl left a comment

Choose a reason for hiding this comment

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

🚀 🚀

@elvincheng3
Copy link
Contributor

Would using some form of scopes be more flexible?

@kaiyangzheng
Copy link
Collaborator

Would using some form of scopes be more flexible?

What would this look like? Many different roles, or defining what a user has access to?

@elvincheng3
Copy link
Contributor

elvincheng3 commented Jan 27, 2025

Would using some form of scopes be more flexible?

What would this look like? Many different roles, or defining what a user has access to?

Defining what a user has access to; would also make it easy to extend to roles in the future.


@ApiProperty()
signatureLink: string;
scope: EmployeeScope;
Copy link
Contributor

Choose a reason for hiding this comment

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

can you also add the enum param on the api property?

@ApiProperty({enum: EmployeeScope})

or something similar?

this will also change the type that the auto-generated client has as well

@laurenbrissette laurenbrissette marked this pull request as draft February 6, 2025 21:57
@@ -39,7 +44,7 @@ model Employee {
lastName String @db.VarChar(255)
email String @unique @db.VarChar(255)
signatureLink String @db.VarChar(255)
isAdmin Boolean @default(false) @db.Boolean
scope EmployeeScope @default(BASE_USER) // TODO @db tag
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is does TODO mean, we should have a @db tag here right?

Copy link
Collaborator

@kaiyangzheng kaiyangzheng left a comment

Choose a reason for hiding this comment

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

LGTM!

@kaiyangzheng kaiyangzheng merged commit b5009f3 into main Feb 9, 2025
7 checks passed
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.

[FEATURE] Create "admin" field for employees
4 participants