Documentation
¶
Index ¶
- type AccountDTO
- type AccountRoleDTO
- type AccountTypePublicView
- type Age
- type AthleteCompetitionEntryViewModel
- type AthleteCompetitionRegistrationForm
- type AthleteDetailedProfile
- type AthleteEventEntryViewModel
- type AthleteSummaryProfile
- type AthleteTinyViewModel
- type City
- type CompetitionDate
- type CompetitionEntryListViewModel
- type CompetitionOfficialProfileDTO
- type CompetitionStatus
- type CompetitionViewModel
- type Country
- type CoupleCompetitionEntryViewModel
- type CoupleEventEntryViewModel
- type CreateAccountDTO
- type CreateCity
- type CreateCompetition
- type CreateCompetitionOfficialInvitationDTO
- type CreateCountry
- type CreateEventForm
- type CreatePartnershipRequest
- type Dance
- type DeleteCity
- type DeleteCountry
- type DeleteEventForm
- type DivisionViewModel
- type EventDanceViewModel
- type EventEntryListViewModel
- type EventViewModel
- type Federation
- type Gender
- type OrganizerProvisionSummary
- type OrganizerSearchEventCriteria
- type Partnership
- type PartnershipRequest
- type PartnershipRequestBlacklistReasonViewModel
- type PartnershipRequestResponse
- type PartnershipRequestStatus
- type PartnershipRole
- type PartnershipTinyViewModel
- type Proficiency
- type RESTAPIResult
- type RatingProfile
- type RespondRoleApplication
- type RoleApplicationAdminView
- type RoleApplicationStatusViewModel
- type School
- type SearchAccountDTO
- type SearchAge
- type SearchAthleteProfileForm
- type SearchCompetitionEventTemplateForm
- type SearchDivisionViewModel
- type SearchEligibleCompetitionOfficialDTO
- type SearchEntryForm
- type SearchPartnershipProfileForm
- type SearchPartnershipRequestViewModel
- type SearchRoleApplicationCriteriaViewModel
- type State
- type Studio
- type Style
- type SubmitRoleApplication
- type UpdateCity
- type UpdateCompetitionDTO
- type UpdateCountry
- type UpdateProvision
- type UserPreferenceViewModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountDTO ¶
type AccountDTO struct {
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
Email string `json:"email"`
Phone string `json:"phone"`
Roles []int `json:"roles"`
DateTimeCreated time.Time `json:"createdOn"`
DateTimeUpdated time.Time `json:"updatedOn"`
}
func (*AccountDTO) Extract ¶
func (dto *AccountDTO) Extract(account businesslogic.Account)
type AccountRoleDTO ¶
func AccountRoleToAccountRoleDTO ¶
func AccountRoleToAccountRoleDTO(role businesslogic.AccountRole) AccountRoleDTO
type AccountTypePublicView ¶
func NewAccountTypePublicView ¶
func NewAccountTypePublicView(model businesslogic.AccountType) AccountTypePublicView
NewAccountTypePublicView creates the Public-view object of AccountType
type Age ¶
type Age struct {
ID int `json:"id"`
Name string `json:"name"`
Division int `json:"division"`
Enforced bool `json:"enforced"`
Minimum int `json:"minimum"`
Maximum int `json:"maximum"`
}
func AgeDataModelToViewModel ¶
func AgeDataModelToViewModel(dm businesslogic.Age) Age
type AthleteCompetitionEntryViewModel ¶
type AthleteCompetitionEntryViewModel struct {
EntryID int `json:"id"`
CompetitionID int `json:"competitionId"`
Athlete AthleteTinyViewModel `json:"athlete"`
IsLead bool `json:"isLead"`
LeadTag int `json:"leadTag"`
}
AthleteCompetitionEntryViewModel
func AthleteCompetitionEntryToViewModel ¶
func AthleteCompetitionEntryToViewModel(entry businesslogic.AthleteCompetitionEntry) AthleteCompetitionEntryViewModel
type AthleteCompetitionRegistrationForm ¶
type AthleteCompetitionRegistrationForm struct {
CompetitionID int `json:"competitionId" validate:"nonzero"`
PartnershipID int `json:"partnershipId" validate:"min=1"`
AddedEvents []int `json:"addedEvents"`
DroppedEvents []int `json:"droppedEvents"`
Representation struct {
CountryId int `json:"countryId,omitempty"`
StateId int `json:"stateId,omitempty"`
SchoolId int `json:"schoolId,omitempty"`
StudioId int `json:"studioId,omitempty"`
} `json:"representation,omitempty"`
}
AthleteCompetitionRegistrationForm is the payload that should be submitted by athlete to sign up for a competition This form should only contain events that the couple would compete. If an existing registration
type AthleteDetailedProfile ¶
type AthleteEventEntryViewModel ¶
type AthleteEventEntryViewModel struct {
EventID int `json:"eventId"`
Athlete AthleteTinyViewModel `json:"athlete"`
}
type AthleteSummaryProfile ¶
type AthleteTinyViewModel ¶
type AthleteTinyViewModel struct {
UID string `json:"uid"`
FirstName string `json:"firstName"`
LastName string `json:"lastName"`
}
AthleteTinyViewModel is the minimum data of an athlete
func AthleteToTinyViewModel ¶
func AthleteToTinyViewModel(athlete businesslogic.Account) AthleteTinyViewModel
type CompetitionDate ¶
func (*CompetitionDate) MarshalJSON ¶
func (cd *CompetitionDate) MarshalJSON() ([]byte, error)
func (*CompetitionDate) UnmarshalJSON ¶
func (cd *CompetitionDate) UnmarshalJSON(input []byte) error
type CompetitionEntryListViewModel ¶
type CompetitionEntryListViewModel struct {
Competition CompetitionViewModel `json:"competition"`
AthleteEntries []AthleteCompetitionEntryViewModel `json:"athleteEntries"`
CoupleEntries []CoupleCompetitionEntryViewModel `json:"partnershipEntries"`
}
func CompetitionEntriesToViewModel ¶
func CompetitionEntriesToViewModel(entries businesslogic.CompetitionEntryList) CompetitionEntryListViewModel
type CompetitionOfficialProfileDTO ¶
type CompetitionOfficialProfileDTO struct {
ID string `json:"id"`
Name string `json:"name"`
IsAdjudicator bool `json:"isAdjudicator"`
IsScrutineer bool `json:"isScrutineer"`
IsDeckCaptain bool `json:"isDeckCaptain"`
IsEmcee bool `json:"isEmcee"`
}
func (*CompetitionOfficialProfileDTO) Populate ¶
func (dto *CompetitionOfficialProfileDTO) Populate(account businesslogic.Account)
type CompetitionStatus ¶
func CompetitionStatusDataModelToViewModel ¶
func CompetitionStatusDataModelToViewModel(status businesslogic.CompetitionStatus) CompetitionStatus
type CompetitionViewModel ¶
type CompetitionViewModel struct {
ID int `json:"id"`
Federation int `json:"federationId"`
Name string `json:"name"`
Website string `json:"website"`
Status int `json:"statusId"`
CountryID int `json:"countryId"`
StateID int `json:"stateId"`
CityID int `json:"cityId"`
Address string `json:"address"`
StartDate time.Time `json:"start"`
EndDate time.Time `json:"end"`
Attendance int `json:"attendance"`
ContactName string `json:"contact"`
ContactPhone string `json:"phone"`
ContactEmail string `json:"email"`
}
func CompetitionDataModelToViewModel ¶
func CompetitionDataModelToViewModel(competition businesslogic.Competition, accountType int) CompetitionViewModel
type Country ¶
type Country struct {
ID int `json:"id"`
Name string `json:"name"`
Abbreviation string `json:"abbreviation"`
}
Country is the view model of a Country object
func CountriesToViewModel ¶
func CountriesToViewModel(countries []businesslogic.Country) []Country
type CoupleCompetitionEntryViewModel ¶
type CoupleCompetitionEntryViewModel struct {
EntryID int `json:"id"`
CompetitionID int `json:"competitionId"`
Couple PartnershipTinyViewModel `json:"partnership"`
}
type CoupleEventEntryViewModel ¶
type CoupleEventEntryViewModel struct {
EntryID int `json:"entryId"`
EventID int `json:"eventId"`
CoupleID int `json:"partnershipId"`
Lead AthleteTinyViewModel `json:"lead"`
Follow AthleteTinyViewModel `json:"follow"`
}
func CoupleEventEntryToViewModel ¶
func CoupleEventEntryToViewModel(entries []businesslogic.PartnershipEventEntry) []CoupleEventEntryViewModel
type CreateAccountDTO ¶
type CreateAccountDTO struct {
Email string `json:"email" validate:"regexp=^[0-9a-z]+@[0-9a-z]+(\\.[0-9a-z]+)+$"`
Phone string `json:"phone"`
FirstName string `json:"firstName" validate:"nonzero"`
LastName string `json:"lastName" validate:"nonzero"`
ToSAccepted bool `json:"tosAccepted" validate:"true"`
PPAccepted bool `json:"ppaAccepted" validate:"true"`
}
CreateAccountDTO is the JSON payload for request POST /api/v1.0/account/register
func (CreateAccountDTO) ToAccountModel ¶
func (dto CreateAccountDTO) ToAccountModel() businesslogic.Account
type CreateCity ¶
func (CreateCity) ToCityDataModel ¶
func (create CreateCity) ToCityDataModel() businesslogic.City
type CreateCompetition ¶
type CreateCompetition struct {
FederationID int `json:"federationId" validate:"min=1"`
Name string `json:"name" validate:"min=3"`
Start time.Time `json:"start"`
End time.Time `json:"end"`
Status int `json:"statusId"`
Website string `json:"website" validate:"min=10"` // TODO: still requires regex check
VenueStreet string `json:"address" validate:"min=4"`
VenueCityID int `json:"cityId" validate:"min=1"`
VenueStateID int `json:"stateId" validate:"min=1"`
VenueCountryID int `json:"countryId" validate:"min=1"`
ContactName string `json:"contact" validate:"min=3"`
ContactPhone string `json:"phone" validate:"min=5"`
ContactEmail string `json:"email" validate:"min=9"`
CreateUserID string `json:"createdby,omitempty"`
}
CreateCompetition defines the JSON payload for creating a competition
func (CreateCompetition) ToCompetitionDataModel ¶
func (createDTO CreateCompetition) ToCompetitionDataModel(user businesslogic.Account) businesslogic.Competition
type CreateCompetitionOfficialInvitationDTO ¶
type CreateCompetitionOfficialInvitationDTO struct {
RecipientEmail string `json:"recipientEmail"`
}
type CreateCountry ¶
type CreateCountry struct {
Name string `json:"name" validate:"min=3"`
Abbreviation string `json:"abbreviation" validate:"min=3,max=3"` // Abbreviation is the Olympic country code
}
CreateCountry defines the form data for creating a country record
func (*CreateCountry) ToDataModel ¶
func (cc *CreateCountry) ToDataModel() businesslogic.Country
type CreateEventForm ¶
type CreateEventForm struct {
CompetitionID int `json:"competition" validate:"min=1"`
EventCategoryID int `json:"category" validate:"min=1"`
FederationID int `json:"federation" validate:"min=1"`
DivisionID int `json:"division" validate:"min=1"`
AgeID int `json:"age" validate:"min=1"`
ProficiencyID int `json:"proficiency" validate:"min=1"`
StyleID int `json:"style" validate:"min=1"`
Dances []int `json:"dances"`
Template int `json:"template,omitempty"`
}
CreateEventForm defines the payload for creating an Event
func (CreateEventForm) ToDomainModel ¶
func (dto CreateEventForm) ToDomainModel(user businesslogic.Account) *businesslogic.Event
ToDomainModel converts the caller CreateEventForm to the Event domain model
type CreatePartnershipRequest ¶
type CreatePartnershipRequest struct {
SenderID int `json:"sender" validate:"min=1"`
RecipientEmail string `json:"recipient" validate:"min=5"`
RecipientRole int `json:"roleId" validate:"min=1,max=2"`
Message string `json:"message"`
}
CreatePartnershipRequest defines the JSON payload structure for creating a partnership request.
type DeleteCity ¶
type DeleteCity struct {
ID int `json:"id"`
}
type DeleteCountry ¶
type DeleteEventForm ¶
type DeleteEventForm struct {
ID int `json:"eventId";validate:"min=1"`
}
type DivisionViewModel ¶
type EventDanceViewModel ¶
type EventDanceViewModel struct {
ID int `json:"eventDanceId"`
EventId int `json:"eventId"`
DanceId int `json:"danceId"`
}
EventDanceViewModel defines the JSON structure of EventDance
func (*EventDanceViewModel) PopulateViewModel ¶
func (view *EventDanceViewModel) PopulateViewModel(model businesslogic.EventDance)
type EventEntryListViewModel ¶
type EventEntryListViewModel struct {
Event EventViewModel `json:"event"`
AthleteEntries []AthleteEventEntryViewModel `json:"athleteEntries"`
CoupleEntries []CoupleEventEntryViewModel `json:"partnershipEntries"`
}
func EventEntriesToViewModel ¶
func EventEntriesToViewModel(entries businesslogic.EventEntryList) EventEntryListViewModel
type EventViewModel ¶
type EventViewModel struct {
ID int `json:"eventId"`
CompetitionID int `json:"competitionId"`
FederationID int `json:"federationId"`
DivisionID int `json:"divisionId"`
AgeID int `json:"ageId"`
ProficiencyID int `json:"proficiencyId"`
StyleID int `json:"styleId"`
Dances []int `json:"dances"`
EventDances []EventDanceViewModel `json:"eventDances"`
}
EventViewModel defines the JSON structure of Event which is used in outbound API
func (*EventViewModel) PopulateViewModel ¶
func (view *EventViewModel) PopulateViewModel(model businesslogic.Event)
PopulateViewModel populates the caller EventViewModel data fields with data from business logic Event
type Federation ¶
type Gender ¶
func GenderDataModelToViewModel ¶
func GenderDataModelToViewModel(gender businesslogic.Gender) Gender
type OrganizerProvisionSummary ¶
type OrganizerProvisionSummary struct {
OrganizerID string `json:"uuid"`
Name string `json:"name"`
Available int `json:"available"`
Hosted int `json:"hosted"`
}
OrganizerProvisionSummary specifies payload for Organizer Provision
func (*OrganizerProvisionSummary) Summarize ¶
func (summary *OrganizerProvisionSummary) Summarize(provision businesslogic.OrganizerProvision)
type OrganizerSearchEventCriteria ¶
type OrganizerSearchEventCriteria struct {
FederationID int `schema:"federationId"`
CompetitionID int `schema:"competitionId"`
EventID int `schema:"eventId"`
DivisionID int `schema:"divisionId"`
AgeID int `schema:"ageId"`
ProficiencyID int `schema:"proficiencyId"`
StyleID int `schema:"styleId"`
OrganizerID int `schema:"organizerId,omitempty"`
}
OrganizerSearchEventCriteria defines the query string that Organizer can submit to search events that the organizer created
func (OrganizerSearchEventCriteria) ToBusinessModel ¶
func (criteria OrganizerSearchEventCriteria) ToBusinessModel() businesslogic.SearchEventCriteria
type Partnership ¶
type Partnership struct {
ID int `json:"id"`
LeadName string `json:"lead"`
FollowName string `json:"follow"`
Since time.Time `json:"since"`
SameSexIND bool `json:"samesex"`
Favorite bool `json:"favorite"`
}
func PartnershipDataModelToViewModel ¶
func PartnershipDataModelToViewModel(currentUser businesslogic.Account, partnership businesslogic.Partnership) Partnership
type PartnershipRequest ¶
type PartnershipRequest struct {
ID int `json:"id"`
Sender string `json:"sender"`
Recipient string `json:"recipient"`
Message string `json:"message"`
Status int `json:"statusId"`
Role string `json:"role"`
DateTimeCreated time.Time `json:"sent"`
}
PartnershipRequest view model
type PartnershipRequestStatus ¶
PartnershipRequestStatus defines the JSON structure of reference data PartnershipRequestStatus.
type PartnershipRole ¶
PartnershipRole defines the JSON structure reference data PartnershipRole
func PartnershipRoleDataModelToViewModel ¶
func PartnershipRoleDataModelToViewModel(dataModel businesslogic.PartnershipRole) PartnershipRole
type PartnershipTinyViewModel ¶
type PartnershipTinyViewModel struct {
ID int `json:"id"`
Lead string `json:"lead"`
Follow string `json:"follow"`
}
func PartnershipToTinyViewModel ¶
func PartnershipToTinyViewModel(partnership businesslogic.Partnership) PartnershipTinyViewModel
type Proficiency ¶
type Proficiency struct {
ProficiencyID int `json:"id"`
Name string `json:"name"`
Division int `json:"division"`
}
func ProficiencyDataModelToViewModel ¶
func ProficiencyDataModelToViewModel(dm businesslogic.Proficiency) Proficiency
type RESTAPIResult ¶
type RatingProfile ¶
type RespondRoleApplication ¶
type RespondRoleApplication struct {
ApplicationID int `json:"applicationId" validate:"min=1"`
Response int `json:"responseId" validate:"min=1,max=2"`
}
RespondRoleApplication specifies the payload for responding a role application
type RoleApplicationStatusViewModel ¶
func (*RoleApplicationStatusViewModel) PopulateFromModel ¶
func (model *RoleApplicationStatusViewModel) PopulateFromModel(status businesslogic.RoleApplicationStatus)
type School ¶
func SchoolDataModelToViewModel ¶
func SchoolDataModelToViewModel(school businesslogic.School) School
type SearchAccountDTO ¶
type SearchAccountDTO struct {
FirstName string `schema:"firstName"`
LastName string `schema:"lastName"`
RoleID int `schema:"roleId"`
Email string `schema:"email"`
Phone string `schema:"phone"`
}
SearchAccountDTO defines the HTTP search parameters for account search
func (SearchAccountDTO) Populate ¶
func (dto SearchAccountDTO) Populate(criteria *businesslogic.SearchAccountCriteria)
type SearchAthleteProfileForm ¶
type SearchAthleteProfileForm struct {
CountryId int `schema:"countryId" validate:"min=0"`
StateId int `schema:"stateId" validate:"min=0"`
FirstName string `schema:"firstName" validate:""`
}
SearchAthleteProfileForm
type SearchDivisionViewModel ¶
type SearchEligibleCompetitionOfficialDTO ¶
type SearchEligibleCompetitionOfficialDTO struct {
AccountTypeID int `schema:"accountTypeId"`
}
type SearchEntryForm ¶
type SearchEntryForm struct {
CompetitionID int `schema:"competitionId"`
EventID int `schema:"eventId"`
FederationID int `schema:"federationId"`
DivisionID int `schema:"divisionId"`
AgeID int `schema:"ageId"`
ProficiencyID int `schema:"proficiencyId"`
StyleID int `schema:"styleId"`
PartnershipID int `schema:"partnershipId,omitempty"`
AthleteID int `schema:"athleteId,omitempty"`
}
SearchEntryForm defines the acceptable parameters that can be used to query competition and event entries
type SearchPartnershipProfileForm ¶
type SearchPartnershipProfileForm struct {
CountryId int `schema:"countryId" validate:"min=0"`
StateId int `schema:"stateId" validate:"min=0"`
LeadFirstName string `schema:"leadFirstName"`
LeadLastName string `schema:"leadLastName"`
FollowFirstName string `schema:"followFirstName"`
FollowLastName string `schema:"followLastName"`
}
SearchPartnershipProfileForm
type SearchRoleApplicationCriteriaViewModel ¶
type SearchRoleApplicationCriteriaViewModel struct {
ID int `schema:"id"`
AccountID int `schema:"applicant"`
AppliedRoleID int `schema:"appliedRole"`
StatusID int `schema:"statusId"`
ApprovalUserID int `schema:"approvedBy"`
Responded bool `schema:"responded"`
}
SearchRoleApplicationCriteria specifies the search criteria for role application
type State ¶
type State struct {
ID int `json:"id"`
Name string `json:"name"`
Abbreviation string `json:"abbreviation"`
CountryID int `json:"country"`
}
func StateDataModelToViewModel ¶
func StateDataModelToViewModel(dm businesslogic.State) State
type Studio ¶
type Studio struct {
ID int `json:"id"`
Name string `json:"name"`
Address string `json:"address"`
CityID int `json:"city"`
Website string `json:"website"`
}
func StudioDataModelToViewModel ¶
func StudioDataModelToViewModel(dm businesslogic.Studio) Studio
type SubmitRoleApplication ¶
type SubmitRoleApplication struct {
RoleID int `json:"roleId" validate:"min=2,max=6"` // CAUTION! hard coded role ID here!
Description string `json:"description" validate:"min=20"`
}
SubmitRoleApplication is the payload for role application submission
type UpdateCity ¶
type UpdateCompetitionDTO ¶
type UpdateCompetitionDTO struct {
CompetitionID int `json:"competition"`
Name string `json:"name"`
Website string `json:"website"`
Status int `json:"status"`
Address string `json:"street"`
ContactName string `json:"contact"`
ContactEmail string `json:"email"`
ContactPhone string `json:"phone"`
StartDate time.Time `json:"start"`
EndDate time.Time `json:"end"`
UpdateUserID int
}
type UpdateCountry ¶
type UpdateProvision ¶
type UpdateProvision struct {
OrganizerID string `json:"organizer"`
AmountAllocated int `json:"allocate"`
Note string `json:"note"`
}
UpdateProvision specifies the payload that admin user need to submit to update organizer's provision
type UserPreferenceViewModel ¶
type UserPreferenceViewModel struct {
DefaultRole int `json:"defaultRole"`
}
func UserPreferenceDataModelToViewModel ¶
func UserPreferenceDataModelToViewModel(model businesslogic.UserPreference) UserPreferenceViewModel