Skip to content

Conversation

@vas3a
Copy link
Collaborator

@vas3a vas3a commented Sep 12, 2025

https://topcoder.atlassian.net/browse/PM-1894 - prisma middleware to automatically set updated by & created by based on request context.

  • had to drop "not null" from all createdBy & updatedBy columns so we can call .create() and .update() without those params.
  • modified the tokenRole guard and moved jwt check to tokenRequestValidator.middleware. This way the user is attached to request early and can be used in the request context.

…ere are deeply nested objects, and add audit fields to those as well
Copy link
Collaborator

@jmgasper jmgasper left a comment

Choose a reason for hiding this comment

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

I think this looks good - we shouldn't have to rebuild the database, correct? That's pretty time consuming, since we have to import all legacy data.

@vas3a
Copy link
Collaborator Author

vas3a commented Sep 15, 2025

I only worked on the current schema. No updates to the prisma schema were produced. So, there shouldn't be necessary any database rebuild either.

…into PM-1897_prisma-middleware-for-audit-fields
…into PM-1897_prisma-middleware-for-audit-fields
@vas3a vas3a merged commit 8fb73c3 into develop Sep 16, 2025
1 check passed
@vas3a vas3a deleted the PM-1897_prisma-middleware-for-audit-fields branch September 16, 2025 06:20
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