website-backend icon indicating copy to clipboard operation
website-backend copied to clipboard

Feature/one time user colors

Open isVivek99 opened this issue 3 years ago • 8 comments

This is a one-time PR

Issue Ticket Number:- #712 API Contract: - API contract https://github.com/Real-Dev-Squad/website-api-contracts/pull/147 Frontend PR: https://github.com/Real-Dev-Squad/website-members/pull/396

Backend changes

  • [x] Yes
  • [ ] No

Frontend Changes

  • [ ] Yes
  • [x] No

Database changes

  • [x] Yes
  • [ ] No

Breaking changes (If your feature is breaking/missing something please mention pending tickets)

  • [ ] Yes
  • [x] No

Deployment notes None

Description

  • This PR will add a colors id for each user which will then be used on frontend for users to see their profile is a specific color.

Testing Stats: file: controllers/userMigrations.js

Screenshot 2023-08-15 at 11 15 11 AM

file: models/userMigrations.js

Screenshot 2023-08-09 at 10 35 55 AM

file utils/helpers.js

Screenshot 2023-08-15 at 11 18 19 AM

isVivek99 avatar Oct 06 '22 16:10 isVivek99

Other than the 2 comments above, everything looks good to me. We can proceed with merging after those are resolved. Thanks for the PR.

pallabez avatar Oct 17 '22 10:10 pallabez

Can you also update the API Contracts and Data Model as well in the ticket.

yes added

isVivek99 avatar Aug 05 '23 06:08 isVivek99

we are modifying user resource here ideally this route should be in users.

this was discussed with @pallabez , again the discussion took place long time ago and it was decided to use this route for migrations. It is a one time PR so the code will not exist after this. Let me know what should be done here

isVivek99 avatar Aug 08 '23 11:08 isVivek99

we are modifying user resource here ideally this route should be in users.

this was discussed with @pallabez , again the discussion took place long time ago and it was decided to use this route for migrations. It is a one time PR so the code will not exist after this. Let me know what should be done here

so do you mean that for new users this random color constant are being added. only for the old users this is a 1 time fix ?

heyrandhir avatar Aug 08 '23 17:08 heyrandhir

we are modifying user resource here ideally this route should be in users.

this was discussed with @pallabez , again the discussion took place long time ago and it was decided to use this route for migrations. It is a one time PR so the code will not exist after this. Let me know what should be done here

so do you mean that for new users this random color constant are being added. only for the old users this is a 1 time fix ?

this will only be for existing users, I am not sure if a new user signs up we are adding them a color property, we can also have a follow up PR for that

isVivek99 avatar Aug 09 '23 04:08 isVivek99

we are modifying user resource here ideally this route should be in users.

this was discussed with @pallabez , again the discussion took place long time ago and it was decided to use this route for migrations. It is a one time PR so the code will not exist after this. Let me know what should be done here

so do you mean that for new users this random color constant are being added. only for the old users this is a 1 time fix ?

this will only be for existing users, I am not sure if a new user signs up we are adding them a color property, we can also have a follow up PR for that

In this scenario, it seems more logical to write that part initially otherwise, the current script will function for all the current users, but the color property will be missing for new users and the super user will need to run this every time new users are added in the DB. Alternatively, if we add it for new users first, then we can ensure that everyone is covered. Once the script is executed, we can then remove the script for once and for all. What do you think @vivek-geekyants @isVivek99

heyrandhir avatar Aug 09 '23 05:08 heyrandhir

Just noticed model tests are missing 👀

will be updating

isVivek99 avatar Aug 09 '23 05:08 isVivek99

yes will raise a seperate PR for that, lets not stop this PR being approved for that.

isVivek99 avatar Aug 09 '23 06:08 isVivek99