-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
78 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package domain | ||
|
||
import ( | ||
"time" | ||
|
||
"gorm.io/gorm" | ||
) | ||
|
||
type ( | ||
BaseModel struct { | ||
*gorm.Model | ||
ID uint `gorm:"primarykey" json:"id"` | ||
CreatedAt time.Time `json:"createdAt"` | ||
UpdatedAt time.Time `json:"updatedAt"` | ||
DeletedAt gorm.DeletedAt `gorm:"index" json:"deletedAt"` | ||
} | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package domain | ||
|
||
import "time" | ||
|
||
type Match struct { | ||
BaseModel | ||
Start time.Time `json:"start"` | ||
End time.Time `json:"end"` | ||
Location string `json:"location"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package domain | ||
|
||
type Player struct { | ||
BaseModel | ||
FirstName string `json:"firstName"` | ||
LastName string `json:"lastName"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package domain | ||
|
||
type Registration struct { | ||
BaseModel | ||
PlayerId int64 `json:"playerId"` | ||
MatchId int64 `json:"matchId"` | ||
IsPaid bool `json:"isPaid"` | ||
Comment string `json:"comment"` | ||
} | ||
|
||
func (reg *Registration) MarkPaid() { | ||
reg.IsPaid = true | ||
} | ||
|
||
func (reg *Registration) MarkUnpaid() { | ||
reg.IsPaid = false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters