fbl773 / point-b_ank

Forked from PCubed by the marvelous 371 team 4
Apache License 2.0
0 stars 0 forks source link

23 mongo middleware #24

Closed fbl773 closed 1 month ago

fbl773 commented 2 months ago

Closes #9 Closes #4

Important Changes

Details

All routes were tested via postman and match the routes from the original. Seeing as we are using mongo, put/post routes are expecting a JSON object that matches the spec of its corresponding mongo collection. That is, the body of a POST request to /material should implement IMaterial (save for the ID of course because mongo handles that).

Remaining

Requesting Feedback On

fbl773 commented 2 months ago

Nice work on the conversion man! I'm going to review this properly after I get some sleep.

Initial thought: I think it would have been great to have the typescript conversion done as a PR and then the mongo conversion done as a PR. That way we can incrementally check to see if each conversion broke something. By doing it both at the same time it'll be a bit harder to figure out which conversion causes a particular issue. Maybe it's a mixture of both?

Yea, you're not wrong on that. I just had issues with how they were handling requests, seemed like a lot of code to switch to typescript that we likely weren't going to keep. Big regression potential for sure.

DanielleDPowell commented 1 month ago

The tester role was used to identify the testing team. So,

Admin - developers Tester - testing team

On Sat, Apr 27, 2024, 9:55 a.m. fbl773 @.***> wrote:

@.**** commented on this pull request.

In backend_tsc/src/entitites/user.ts https://github.com/fbl773/point-b_ank/pull/24#discussion_r1581850985:

+import {IMongo_Entity} from "./mongo_entity"; + +export interface IUser extends IMongo_Entity{

  • username:string,
  • password:string,
  • active:boolean
  • role:string
  • +}

  • +type UserModel = Model; +const userSchema= new Schema<IUser,UserModel>({

  • username:{type:String, required:true,trim:true},
  • password:{type:String, required:true,trim:true},
  • active:{type:Boolean, required:true, default:true},
  • role:{type:String,required:true,enum:["admin","tester"]}//wtf is tester?

@DanielleDPowell https://github.com/DanielleDPowell Do you have any insight on this? What is the tester role all about?

— Reply to this email directly, view it on GitHub https://github.com/fbl773/point-b_ank/pull/24#discussion_r1581850985, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAR354OGDZ32Z6FVG6XWCALY7PC7HAVCNFSM6AAAAABG3WUHF2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAMRWGY3TAMBWGU . You are receiving this because you were mentioned.Message ID: @.***>

fbl773 commented 1 month ago

The tester role was used to identify the testing team. So, Admin - developers Tester - testing team On Sat, Apr 27, 2024, 9:55 a.m. fbl773 @.> wrote: @*.*** commented on this pull request. ------------------------------ In backend_tsc/src/entitites/user.ts <#24 (comment)>: > +import {IMongo_Entity} from "./mongo_entity"; + +export interface IUser extends IMongo_Entity{ + username:string, + password:string, + active:boolean + role:string + +} + +type UserModel = Model; +const userSchema= new Schema<IUser,UserModel>({ + username:{type:String, required:true,trim:true}, + password:{type:String, required:true,trim:true}, + active:{type:Boolean, required:true, default:true}, + role:{type:String,required:true,enum:["admin","tester"]}//wtf is tester? @DanielleDPowell https://github.com/DanielleDPowell Do you have any insight on this? What is the tester role all about? — Reply to this email directly, view it on GitHub <#24 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAR354OGDZ32Z6FVG6XWCALY7PC7HAVCNFSM6AAAAABG3WUHF2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDAMRWGY3TAMBWGU . You are receiving this because you were mentioned.Message ID: @.>

Is there anything that will break if I don't include it in the upgrade? Did it have any privilege that the admin account didn't?