Skip to content

Commit

Permalink
add autograph fields to play metadata (#145)
Browse files Browse the repository at this point in the history
* Add autograph fields to play metadata

* add player prefix to autograph fields
  • Loading branch information
yeukovichd authored May 31, 2022
1 parent af0924d commit 337f1f5
Showing 1 changed file with 51 additions and 45 deletions.
96 changes: 51 additions & 45 deletions lib/go/templates/data/play_metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,63 @@ package data
// It also does not allow for null values, so we will be omitting them if empty
// Reference: https://docs.google.com/spreadsheets/d/1muUZowii0pqoyi6OPK1VPNJi7keSc8_5zI9vu_QvfOY/edit#gid=375111836
type PlayMetadata struct {
FullName string
FirstName string
LastName string
Birthdate string
Birthplace string
JerseyNumber string
DraftTeam string `json:",omitempty"` // Not all plays have draft information. Can be blank
DraftYear *int32 `json:",omitempty,string"` // Not all plays have draft information. Can be blank
DraftSelection string `json:",omitempty"` // Not all plays have draft information. Can be blank
DraftRound string `json:",omitempty"` // Not all plays have draft information. Can be blank
TeamAtMomentNBAID string
TeamAtMoment string
PrimaryPosition string
PlayerPosition string
Height *int32 `json:",string"`
Weight *int32 `json:",string"`
TotalYearsExperience string
NbaSeason string
DateOfMoment string
PlayCategory string
PlayType string
HomeTeamName string
AwayTeamName string
HomeTeamScore *int32 `json:",string"`
AwayTeamScore *int32 `json:",string"`
FullName string
FirstName string
LastName string
Birthdate string
Birthplace string
JerseyNumber string
DraftTeam string `json:",omitempty"` // Not all plays have draft information. Can be blank
DraftYear *int32 `json:",omitempty,string"` // Not all plays have draft information. Can be blank
DraftSelection string `json:",omitempty"` // Not all plays have draft information. Can be blank
DraftRound string `json:",omitempty"` // Not all plays have draft information. Can be blank
TeamAtMomentNBAID string
TeamAtMoment string
PrimaryPosition string
PlayerPosition string
Height *int32 `json:",string"`
Weight *int32 `json:",string"`
TotalYearsExperience string
NbaSeason string
DateOfMoment string
PlayCategory string
PlayType string
HomeTeamName string
AwayTeamName string
HomeTeamScore *int32 `json:",string"`
AwayTeamScore *int32 `json:",string"`
PlayerAutographType string `json:",omitempty"`
PlayerAutographDate string `json:",omitempty"`
PlayerAutographSigner string `json:",omitempty"`
}

// GenerateEmptyPlay generates a play with all its fields
// empty except for FullName for testing
func GenerateEmptyPlay(fullName string) PlayMetadata {
num := int32(10)
return PlayMetadata{FullName: fullName,
FirstName: "",
LastName: "",
Birthdate: "",
Birthplace: "",
JerseyNumber: "",
TeamAtMomentNBAID: "",
TeamAtMoment: "",
PrimaryPosition: "",
PlayerPosition: "",
Height: &num,
Weight: &num,
TotalYearsExperience: "",
NbaSeason: "",
DateOfMoment: "",
PlayCategory: "",
PlayType: "",
HomeTeamName: "",
AwayTeamName: "",
HomeTeamScore: &num,
AwayTeamScore: &num,
FirstName: "",
LastName: "",
Birthdate: "",
Birthplace: "",
JerseyNumber: "",
TeamAtMomentNBAID: "",
TeamAtMoment: "",
PrimaryPosition: "",
PlayerPosition: "",
Height: &num,
Weight: &num,
TotalYearsExperience: "",
NbaSeason: "",
DateOfMoment: "",
PlayCategory: "",
PlayType: "",
HomeTeamName: "",
AwayTeamName: "",
HomeTeamScore: &num,
AwayTeamScore: &num,
PlayerAutographType: "",
PlayerAutographDate: "",
PlayerAutographSigner: "",
}
}

0 comments on commit 337f1f5

Please sign in to comment.