added tag model #79
added tag model #79
Conversation
Codecov Report
@@ Coverage Diff @@
## master #79 +/- ##
==========================================
- Coverage 80.57% 80.44% -0.12%
==========================================
Files 23 24 +1
Lines 746 782 +36
Branches 4 4
==========================================
+ Hits 601 629 +28
- Misses 105 109 +4
- Partials 40 44 +4
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wow thanks for getting this PR in! π
first of all, make sure you have a gofmt
plugin installed on your IDE - I recommend using Visual Studio Code alongside the official Go plugin
it'll help you fix a lot of common errors (at a glance I see a few) and help keep our code consistent!
Yea that sounds so helpful ill definitely use it. |
@adesouky hm interesting... although on that front, I think there might have been a slight misunderstanding - there shouldn't be a need for a name change function, just the ability to add and remove tags from an applicant we can clarify in a few hours, get some rest! π |
Well good to know π |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work! π See if you can model the tests after the new tests the way we talked about them yesterday! Great use of the go test -run TestTag
suggestion as well
I think @srijonsaha should have a look at this too before we land this PR
Thanks! π
Oh yeah and don't worry about the merge conflicts too much - I can handle them for you before you merge if you want (but I recommend you give it a try locally! just run |
I'll leave this up to @adesouky ! Anas, just add the "Ready for Review" label back to this PR when you've addressed the comments regarding the tests and the code cleanup (comments, etc.) - up to you if you want to add the changes for integrating with the club table - and I'll fix up the merge conflicts and we can merge this π |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work cleaning this up @adesouky ! π
Left one super minor comment regarding naming - once that's fixed, I think we're good to merge this π
core/database/tag.go
Outdated
} | ||
|
||
// GetTag gets the tag associated with Applicant_ID, Period_ID, & Event_ID | ||
func (db *Database) GetTag(ApplicantID string, PeriodID string, EventID string, c *model.Club) (*model.Tag, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in Go, variable names should be lowercased, as uppercased names have a special meaning in a lot of contexts (exports)
func (db *Database) GetTag(ApplicantID string, PeriodID string, EventID string, c *model.Club) (*model.Tag, error) { | |
func (db *Database) GetTag(applicantID string, periodID string, eventID string, c *model.Club) (*model.Tag, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it!
&model.Club{ | ||
ID: "1234", | ||
Name: "Launchpad", | ||
Description: "1337 h4x0r", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π
@@ -0,0 +1,8 @@ | |||
package model | |||
|
|||
// Tag model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
succinct, but it works π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great stuff, thanks @adesouky !
@ubclaunchpad/pinpoint as always, please take a look when yall have a chance |
ποΈ Ticket(s): Closes #49
π· Changes
Added tag models and create, get, delete, and change name operations
π¦ Testing Instructions
go to core/database and run "go test -run TestTag"