Conversation
TheJolman
left a comment
There was a problem hiding this comment.
models look clean. TBH I don't understand adding go build to the check step, can you revert that commit to keep this PR focused? Also can you check out https://github.com/go-playground/validator ? I think it would be very useful here. Gonna test this a little more locally and get back to you with more feedback.
TheJolman
left a comment
There was a problem hiding this comment.
Also can you organize it like internal/dto/announcements.go and have both request/response dtos in the same file just to reduce the amount of files that we're going to have. When doing this you should name them like UpdateAnnouncementRequest and UpdateAnnouncementResponse to avoid name conflicts (I think the current naming would create some). Also I dont think you need to create a base Announcement or Officer dto for now, as the response payloads should contain all fields anyways. You can keep them if you want, just rename them to AnnouncementDto or something bc the generic Announcement will likely create naming conflicts.
c97a521 to
121272c
Compare
|
holy shit what did I do |
dude idk its fucked tho lol |
121272c to
c97a521
Compare
|
Can you also implement these new DTOs in at least one handler? I don't think it will make this too big and will let us verify they actually work. @GaballaGit |
|
I gotchu |
|
Okay now implementing in, I don't know if I make a handler use dto model in this pr @TheJolman . My reasoning is that, currently our handler calls a service that depends on a db model, that itself isnt bad, but then the service calls the database layer with the dbmodel, meaning that the repository layer must be implemented to test this, and with this also comes the mapper. I have tested the dto models in the other PR #159, where announcements has achieved functionality with DTO, Repository, and Domain models all together. |
What I had in mind is having the handlers use the DTOs and then just translating them to |
|
@TheJolman what happened? |
mb was deleting stale branches from my cli and accidentally hit this |
a22267e to
2bddaef
Compare
This PR introduces DTO models for the API. Currently there are 2 different ones, request and response. At the moment they are both similar, with the only difference of request having an extra Update Model since many more fields don't need to be inputted for an update. Response DTO model might be updated later depending on what we want the user to receive.
This PR also makes
make checkandmake testa little more pretty.