HackIllinois / api

The Official API supporting HackIllinois
https://api.hackillinois.org
Other
23 stars 51 forks source link

Add POST /event/staff/checkin #518

Closed Timothy-Gonzalez closed 1 year ago

Timothy-Gonzalez commented 1 year ago
Timothy-Gonzalez commented 1 year ago

This is blocked by #501.

I need the token generation function for testing.

image

Timothy-Gonzalez commented 1 year ago

501 merged, so I can proceed

Timothy-Gonzalez commented 1 year ago

No conflicts? Still have to fix a few things though...

Timothy-Gonzalez commented 1 year ago

Tests blocked by #494

Timothy-Gonzalez commented 1 year ago

494 was merged, will require a bit of reconfiguration but should be fine otherwise

Timothy-Gonzalez commented 1 year ago

Alright, now just staff checkin tests!

Timothy-Gonzalez commented 1 year ago

Ok, so auth jwts will use id for the user id, and staff checkin jwts will use userId like in the following format:

{
    "exp": Unix time,
    "userId": String,
}
Timothy-Gonzalez commented 1 year ago

Alright, this should be good to go! This was a journey (and yes, it did require one force push to fix things), but I think I've done what I set out to do.

Let me know if you find anything!

Timothy-Gonzalez commented 1 year ago

Also, checkin_service.go is reserved for calls to the Checkin microservice (similar to profile_service.go). Since event_service.go contains stuff related to the event endpoints, you think it would be better to move the code for /event/checkin/ and /event/staff/checkin/ from checkin_service.go to event_service.go? I would like to hear your thoughts on this because it might be better to put it in its own file (like event_checkin.go, similar to how in the Auth microservice, all the token stuff is in token_service.go).

Ah, that makes more sense. Wasn't totally sure about where to put the code, just wanted to extract it out. It definitely belongs in the event service, since it's a event endpoint anyways.

The event microservice is really becoming a macroservice. I wonder if at some point we might need to split some things out?

Either way, reviewed all the changes and everything should be good to go now. Let me know if you find anything else!

Timothy-Gonzalez commented 1 year ago

That should be it.

Timothy-Gonzalez commented 1 year ago

Okay, that should really be it.

Also, @Nydauron, note that the current deployed docs are out of date with the new changes on this branch, so we should try to get at least those commits live ASAP if teams are going to be looking at it.