businesslogic

package
Version: v0.0.0-...-b16b3cf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AccountTypeUnauthorized is the constant for failing authorization
	AccountTypeUnauthorized = -1
	// AccountTypeNoAuth is the constant for No Authentication is required
	AccountTypeNoAuth = 0
	// AccountTypeAthlete is the constant for Athlete-level authorization requirement
	AccountTypeAthlete = 1
	// AccountTypeAdjudicator is the constant for Adjudicator-level authorization requirement
	AccountTypeAdjudicator = 2
	// AccountTypeScrutineer is the constant for Scrutineer-level authorization requirement
	AccountTypeScrutineer = 3
	// AccountTypeOrganizer is the constant for Organizer-level authorization requirement
	AccountTypeOrganizer = 4
	// AccountTypeDeckCaptain is the constant for Deck Captain-level authorization requirement
	AccountTypeDeckCaptain = 5
	// AccountTypeEmcee is the constant for Emcee-level authorization requirement
	AccountTypeEmcee = 6
	// AccountTypeAdministrator is the constant for Administrator-level authorization requirement
	AccountTypeAdministrator = 7
)
View Source
const (
	// AccountStatusActivated sets a flag that account is activated and can function
	AccountStatusActivated = 1
	// AccountStatusUnverified is the status for most newly created accounts
	AccountStatusUnverified = 2
	// AccountStatusSuspended is the status for accounts that violates ToS or Privacy Policies
	AccountStatusSuspended = 3
	// AccountStatusLocked is the status for accounts that are locked due to security issues
	AccountStatusLocked = 4
)
View Source
const (
	// RoleApplicationStatusApproved marks the role application as "approved"
	RoleApplicationStatusApproved = 1
	// RoleApplicationStatusDenied marks the role application as "denied"
	RoleApplicationStatusDenied = 2
	// RoleApplicationStatusPending marks the role application as "pending"
	RoleApplicationStatusPending = 3
)
View Source
const (
	CompetitionStatusPreRegistration    = 1
	CompetitionStatusOpenRegistration   = 2
	CompetitionStatusClosedRegistration = 3
	CompetitionStatusInProgress         = 4
	CompetitionStatusProcessing         = 5
	CompetitionStatusClosed             = 6
	CompetitionStatusCancelled          = 7
)
View Source
const (
	COMPETITION_INVITATION_STATUS_ACCEPTED = "Accepted"
	COMPETITION_INVITATION_STATUS_REJECTED = "Rejected"
	COMPETITION_INVITATION_STATUS_PENDING  = "Pending"
	COMPETITION_INVITATION_STATUS_REVOKED  = "Revoked"
	COMPETITION_INVITATION_STATUS_EXPIRED  = "Expired"
)
View Source
const (
	// EVENT_STATUS_DRAFT is the stage where it is newly created not open to registration or competition
	EVENT_STATUS_DRAFT = 1
	// EVENT_STATUS_OPEN is the stage where it is open to registration, but competition has not started
	EVENT_STATUS_OPEN = 2
	// EVENT_STATUS_RUNNING is the stage where the event is currently danced. Adding entries is prohibited but dropping entries is okay.
	EVENT_STATUS_RUNNING = 3
	// EVENT_STATUS_CLOSED is the stage where the final round of the event is danced (Regardless of the posting of placement)
	EVENT_STATUS_CLOSED = 4
	// EVENT_STATUS_CANCELED is the stage where the event is canceled due to non-technical reasons while the competition is running
	EVENT_STATUS_CANCELED = 5
)
View Source
const (
	// EventCategoryCompetitiveBallroom is a constant for Competitive Ballroom events
	EventCategoryCompetitiveBallroom = 1
	// EventCategoryShowDance is a constant for Show Dance events
	EventCategoryShowDance = 2
	// EventCategoryCabaret is a constant for Cabaret events
	EventCategoryCabaret = 3
	// EventCategoryTheatreArt is a constant for Theatre Art events
	EventCategoryTheatreArt = 4
)
View Source
const (
	// NotificationCategoryNewPartnershipRequestReceived is the value for New Partnership Request Received notification
	NotificationCategoryNewPartnershipRequestReceived = 1
	NotificationCategoryPartnershipRequestResponded   = 2
	NotificationCategoryRoleApplicationResponded      = 3
	NotificationCategoryRegistrationOpened            = 4
)
View Source
const (
	// PartnershipRequestReceived labels the request as "received", once it's viewed by recipient
	PartnershipRequestReceived = 1
	// PartnershipRequestSent labels the request at "sent", once it's sent out by sender
	PartnershipRequestSent = 2
)
View Source
const (
	// PartnershipRoleLead is the reference value for the Lead role
	PartnershipRoleLead = 2
	// PartnershipRoleFollow is the reference value for the Follow role
	PartnershipRoleFollow = 1
)
View Source
const (
	// PartnershipRequestStatusAccepted is the status of a request when it is accepted by the recipient
	PartnershipRequestStatusAccepted = 1
	// PartnershipRequestStatusPending is the status of a request when it is sent out, but not responded by recipient
	PartnershipRequestStatusPending = 2
	// PartnershipRequestStatusDeclined is the status of a request when it is declined by the recipient
	PartnershipRequestStatusDeclined = 3
)
View Source
const (
	GENDER_MALE    = 2
	GENDER_FEMALE  = 1
	GENDER_UNKNOWN = 3 // registering a new account no longer requires specifying gender
)

Variables

This section is empty.

Functions

func CreateCompetition

func CreateCompetition(competition Competition, competitionRepo ICompetitionRepository,
	provisionRepo IOrganizerProvisionRepository, historyRepo IOrganizerProvisionHistoryRepository) error

CreateCompetition creates competition in competitionRepo, update records in provisionRepo, and add a new record to historyRepo

func CreatePartnershipEventEntry

func CreatePartnershipEventEntry(entry PartnershipEventEntry, entryRepo IPartnershipEventEntryRepository) error

CreatePartnershipEventEntry checks if an entry for the specified PartnershipID already exists in the specified Event. If not, a new PartnershipEventEntry will be created for the specified event in the provided repository

func CreatePartnershipRequest

func CreatePartnershipRequest(request PartnershipRequest, partnershipRepo IPartnershipRepository,
	requestRepo IPartnershipRequestRepository, accountRepo IAccountRepository,
	blacklistRepo IPartnershipRequestBlacklistRepository) error

CreatePartnershipRequest will create the partnership request with validation. Validation includes 1. Role validation: must be opposite role 2. Blacklist check: sender must not be blacklisted by recipient 3. Existing partnership check: sender and recipient must not be in a partnership with specified role 4. There is no pending request for the same role (this is applied to request from either party) Note: if sender and recipient are in a partnership of opposite role, then it's considered as a different partnership. If the request is valid, then request will be created.

func CreatePartnershipRoundEntry

func CreatePartnershipRoundEntry(entry *PartnershipRoundEntry, repo IPartnershipRoundEntryRepository) error

CreatePartnershipRoundEntry checks if provided entry already exists in the repository, and create a new entry if the specified partnership has no entry at the specified round.

func RespondPartnershipRequest

func RespondPartnershipRequest(response PartnershipRequestResponse,
	requestRepo IPartnershipRequestRepository,
	accountRepo IAccountRepository,
	partnershipRepo IPartnershipRepository) error

func UpdateCompetition

func UpdateCompetition(user *Account, competition OrganizerUpdateCompetition, repo ICompetitionRepository) error

UpdateCompetition updates the existing competition with the information provided in OrganizerUpdateCompetition

Types

type Account

type Account struct {
	ID  int    // userID will be account ID, too
	UID string // uuid that will be used in communicating with client. This is firebase UID

	AccountStatusID       int
	UserGenderID          int
	FirstName             string
	MiddleNames           string
	LastName              string
	DateOfBirth           time.Time
	Email                 string // can be used as login user name
	Phone                 string // for raw input
	DateTimeCreated       time.Time
	DateTimeModified      time.Time
	ToSAccepted           bool // users who do not accept ToS cannot proceed anything until accepted
	PrivacyPolicyAccepted bool
	ByGuardian            bool
	Signature             string
	// contains filtered or unexported fields
}

Account is the base account data for all users in DAS. Some fields are required with others are not

func GetAccountByID

func GetAccountByID(accountID int, repo IAccountRepository) Account

GetAccountByID will retrieve account from repo by ID. This function will return either a matched account or an empty account

func GetAccountByUUID

func GetAccountByUUID(uuid string, repo IAccountRepository) Account

GetAccountByUUID will retrieve account from repo by UID. This function will return either a matched account or an empty account

func (Account) FullName

func (account Account) FullName() string

FullName returns the full name of a user (excluding middle name, if any)

func (Account) GetAccountRoles

func (account Account) GetAccountRoles() []AccountRole

GetAccountRoles returns slice of AccountRole objects to caller

func (Account) GetAllPartnerships

func (account Account) GetAllPartnerships(repo IPartnershipRepository) ([]Partnership, error)

GetAllPartnerships returns all the partnerships that caller account is in, including as a lead and as a follow

func (Account) GetBlacklistedAccounts

func (account Account) GetBlacklistedAccounts(accountRepo IAccountRepository, blacklistRepo IPartnershipRequestBlacklistRepository) ([]Account, error)

GetBlacklistedAccounts searches all records of Blacklist reports, finds blacklisted accounts, and returns those accounts that were blacklisted

func (*Account) GetRoles

func (account *Account) GetRoles() []int

GetRoles returns all the roles that the caller account is associated with

func (*Account) HasRole

func (account *Account) HasRole(roleID int) bool

HasRole checks if account has a particular role

func (Account) MeetMinimalRequirement

func (account Account) MeetMinimalRequirement() error

func (*Account) SetRoles

func (account *Account) SetRoles(roles []AccountRole)

SetRoles set a list of roles to Account

type AccountRole

type AccountRole struct {
	ID              int
	AccountID       int
	AccountTypeID   int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

AccountRole defines the role that an account can be associated with

func NewAccountRole

func NewAccountRole(user Account, accountType int) AccountRole

type AccountStatus

type AccountStatus struct {
	ID              int
	Name            string
	Abbreviation    string
	Description     string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

AccountStatus defines the status that a DAS account could be. The status of an account can affect the authorization of some actions.

type AccountType

type AccountType struct {
	ID              int
	Name            string
	Description     string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

AccountType defines the data to specify an account type. There are seven account types in DAS

type AdjudicatorCompetitionEntry

type AdjudicatorCompetitionEntry struct {
	ID              int
	AdjudicatorID   int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

AdjudicatorCompetitionEntry defines the presence of an Adjudicator at a Competition

type AdjudicatorEventEntry

type AdjudicatorEventEntry struct {
	ID            int
	EventEntry    EventEntry
	AdjudicatorID int
}

AdjudicatorEventEntry defines the participation of an Adjudicator at an Event.

type AdjudicatorEventEntryList

type AdjudicatorEventEntryList struct {
	EventID   int
	EntryList []AdjudicatorEventEntry
}

AdjudicatorEventEntryList contains the ID of an event and the Adjudicators that are assigned to this event

type AdjudicatorProfile

type AdjudicatorProfile struct {
	ID              int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

type AdjudicatorRoundEntry

type AdjudicatorRoundEntry struct {
	ID                 int
	AdjudicatorEntryID int
	RoundEntry         RoundEntry
}

AdjudicatorRoundEntry defines the Round Entry of an Adjudicator

type AdministratorProfile

type AdministratorProfile struct {
	ID              int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

AdministratorProfile stores the user profile and preference as an Administrator role. Administrator profile should not be created through web services but through direct database insertion.

type Age

type Age struct {
	ID              int
	Name            string
	Description     string
	DivisionID      int
	Enforced        bool // if required, AgeMinimum and AgeMaximum must have non-zero value
	AgeMinimum      int
	AgeMaximum      int
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

Age contains data for the age category requirement for events Age is associated with Division, which is associated with Federation

type AthleteCompetitionEntry

type AthleteCompetitionEntry struct {
	ID                       int
	Athlete                  Account
	Competition              Competition
	IsLead                   bool
	LeadTag                  int
	CheckedIn                bool
	DateTimeCheckedIn        time.Time
	OrganizerNote            string // Organizer may need to add notes to the entry
	PaymentReceivedIndicator bool
	DateTimeOfPayment        time.Time
	CreateUserID             int
	DateTimeCreated          time.Time
	UpdateUserID             int
	DateTimeUpdated          time.Time
}

AthleteCompetitionEntry wraps BaseCompetitionEntry and adds additional data to manage payment status for Athletes. It also allows quick indexing of competition attendance

type AthleteCompetitionEntryService

type AthleteCompetitionEntryService struct {
	// contains filtered or unexported fields
}

AthleteCompetitionEntryService encapsulates the data flow of Athlete's Competition Entry, including data validation and sanitization.

func NewAthleteCompetitionEntryService

func NewAthleteCompetitionEntryService(accountRepo IAccountRepository, competitionRepo ICompetitionRepository, athleteCompEntryRepo IAthleteCompetitionEntryRepository) AthleteCompetitionEntryService

NewAthleteCompetitionEntryService instantiates a new AthleteCompetitionEntryService.

func (AthleteCompetitionEntryService) CreateAthleteCompetitionEntry

func (service AthleteCompetitionEntryService) CreateAthleteCompetitionEntry(entry *AthleteCompetitionEntry) error

CreateAthleteCompetitionEntry attempts to create competition for an athlete if following checks pass: - If the create user is authorized

- If the create user is the athlete: proceed
- If the create user is an organizer or scrutineer of this competition

- If current entry exists in the repository:

- yes, return error
- no: proceed

- If Competition is in open registration stage:

- yes: proceed
- no: return error

func (AthleteCompetitionEntryService) DeleteAthleteCompetitionEntry

func (service AthleteCompetitionEntryService) DeleteAthleteCompetitionEntry(entry AthleteCompetitionEntry) error

func (AthleteCompetitionEntryService) SearchAthleteCompetitionEntry

func (service AthleteCompetitionEntryService) SearchAthleteCompetitionEntry(currentUser Account, criteria SearchAthleteCompetitionEntryCriteria) ([]AthleteCompetitionEntry, error)

type AthleteEventEntry

type AthleteEventEntry struct {
	ID                int
	Athlete           Account
	Competition       Competition
	Event             Event
	CompetitorTag     int
	CheckedIn         bool
	DateTimeCheckedIn bool
	Placement         int // default should be 0: unplaced
	CreateUserID      int
	DateTimeCreated   time.Time
	UpdateUserID      int
	DateTimeUpdated   time.Time
}

type AthleteEventEntryService

type AthleteEventEntryService struct {
}

AthleteEventEntryService imposes requirements of DAS on AthleteEventEntry management.

func (AthleteEventEntryService) CreateAthleteEventEntry

func (service AthleteEventEntryService) CreateAthleteEventEntry(currentUser Account, entry AthleteEventEntry) error

func (AthleteEventEntryService) DeleteAthleteEventEntry

func (service AthleteEventEntryService) DeleteAthleteEventEntry(currentUser Account, entry AthleteEventEntry) error

func (AthleteEventEntryService) SearchAthleteEventEntry

func (service AthleteEventEntryService) SearchAthleteEventEntry(criteria SearchAthleteEventEntryCriteria) ([]AthleteEventEntry, error)

func (AthleteEventEntryService) UpdateAthleteEventEntry

func (service AthleteEventEntryService) UpdateAthleteEventEntry(currentUser Account, entry AthleteEventEntry) error

type AthleteProfile

type AthleteProfile struct {
	UID       string
	FirstName string
	LastName  string
}

AthleteProfile specifies the data that is contained in an AthleteProfile

type ByDanceID

type ByDanceID []Dance

ByDanceID allows sort a slice of dances by their IDs

func (ByDanceID) Len

func (d ByDanceID) Len() int

func (ByDanceID) Less

func (d ByDanceID) Less(i, j int) bool

func (ByDanceID) Swap

func (d ByDanceID) Swap(i, j int)

type City

type City struct {
	ID              int
	Name            string
	StateID         int
	CreateUserID    *int // 2017-10-17 yubing24: use pointer so that if the value is nil, it will be ignored
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

City contains data to represent a City object in DAS. City is associated with State, which is associated with Country

func (City) GetSchools

func (city City) GetSchools(repo ISchoolRepository) ([]School, error)

GetSchools retrieves all schools that are in the caller city and from the repository

func (City) GetStudios

func (city City) GetStudios(repo IStudioRepository) ([]Studio, error)

GetStudios retrieves all the studios that are in the caller city and from the repository

type Competition

type Competition struct {
	ID              int
	FederationID    int
	Name            string
	Street          string
	City            City
	State           State
	Country         Country
	StartDateTime   time.Time
	EndDateTime     time.Time
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
	ContactName     string
	ContactEmail    string
	ContactPhone    string

	Website                   string
	Attendance                int
	RegistrationOpenDateTime  time.Time
	RegistrationCloseDateTime time.Time
	// contains filtered or unexported fields
}

Competition provides the base data structure for a competitive ballroom dance. All competitions in DAS must have some affiliation with a dancesport federation (Not Affiliated/Independent is also a Federation,)

func (*Competition) AddOfficial

func (comp *Competition) AddOfficial(role int, official Account) error

func (Competition) GetEventUniqueAges

func (comp Competition) GetEventUniqueAges(eventRepository IEventMetaRepository) ([]Age, error)

func (Competition) GetEventUniqueDivisions

func (comp Competition) GetEventUniqueDivisions(eventRepository IEventMetaRepository) ([]Division, error)

func (Competition) GetEventUniqueFederations

func (comp Competition) GetEventUniqueFederations(eventRepository IEventMetaRepository) ([]Federation, error)

Get a list of unique federations that a competition has

func (Competition) GetEventUniqueProficiencies

func (comp Competition) GetEventUniqueProficiencies(eventRepository IEventMetaRepository) ([]Proficiency, error)

func (Competition) GetEventUniqueStyles

func (comp Competition) GetEventUniqueStyles(eventRepository IEventMetaRepository) ([]Style, error)

func (Competition) GetOfficials

func (comp Competition) GetOfficials(role int) ([]Account, error)

func (Competition) GetStatus

func (comp Competition) GetStatus() int

func (*Competition) UpdateStatus

func (comp *Competition) UpdateStatus(statusID int) error

UpdateStatus will attempt to change the status of the caller competition to statusID, if the change is in logical order

type CompetitionEntryList

type CompetitionEntryList struct {
	Competition    Competition
	AthleteEntries []AthleteCompetitionEntry
	CoupleEntries  []PartnershipCompetitionEntry
}

type CompetitionEventFactory

type CompetitionEventFactory struct {
	FederationRepo  IFederationRepository
	DivisionRepo    IDivisionRepository
	AgeRepo         IAgeRepository
	ProficiencyRepo IProficiencyRepository
	StyleRepo       IStyleRepository
	DanceRepo       IDanceRepository
}

CompetitionEventFactory can generate event based on specification of event attributes

func (CompetitionEventFactory) GenerateEvent

func (factory CompetitionEventFactory) GenerateEvent(federationName, divisionName, ageName, proficiencyName, styleName string, danceNames []string) (Event, error)

type CompetitionEventTemplate

type CompetitionEventTemplate struct {
	ID               int
	Name             string
	Description      string
	TargetFederation Federation
	TemplateEvents   []EventTemplate
	DateTimeCreate   time.Time
}

type CompetitionLeadTag

type CompetitionLeadTag struct {
	ID              int
	CompetitionID   int
	LeadID          int
	Tag             int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

CompetitionLeadTag maps a competition with a lead and that lead's number tag

type CompetitionLeadTagCollection

type CompetitionLeadTagCollection struct {
	// contains filtered or unexported fields
}

CompetitionLeadTagCollection is an alias type of []CompetitionLeadTag

func (CompetitionLeadTagCollection) HasLead

func (collection CompetitionLeadTagCollection) HasLead(accountId int) bool

func (CompetitionLeadTagCollection) Len

func (collection CompetitionLeadTagCollection) Len() int

func (CompetitionLeadTagCollection) Less

func (collection CompetitionLeadTagCollection) Less(i, j int) bool

func (*CompetitionLeadTagCollection) SetTags

func (collection *CompetitionLeadTagCollection) SetTags(tags []CompetitionLeadTag)

func (*CompetitionLeadTagCollection) Swap

func (collection *CompetitionLeadTagCollection) Swap(i, j int)

type CompetitionOfficial

type CompetitionOfficial struct {
	ID              int
	Competition     Competition
	Official        Account   // the ID for AccountRole
	OfficialRoleID  int       // the ID for AccountType
	EffectiveFrom   time.Time // have privileged access to competition data
	EffectiveUntil  time.Time
	AssignedBy      int // ID of an AccountRole object, must be an organizer. TODO: may use invitation instead of assignment
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

func (CompetitionOfficial) Active

func (official CompetitionOfficial) Active() bool

Active checks if the status of this position is still active.

type CompetitionOfficialInvitation

type CompetitionOfficialInvitation struct {
	ID                 int
	Sender             Account
	Recipient          Account
	ServiceCompetition Competition // the competition that the recipient will serve at if accepted
	AssignedRoleID     int         // only allow Adjudicator, Scrutineer, Deck Captain, Emcee
	Message            string
	InvitationStatus   string
	ExpirationDate     time.Time
	CreateUserID       int
	DateTimeCreated    time.Time
	UpdateUserID       int
	DateTimeUpdated    time.Time
}

CompetitionOfficialInvitation is an invitation that can only be sent by organizers to recipients who have provisioned competition official role.

type CompetitionOfficialInvitationService

type CompetitionOfficialInvitationService struct {
	// contains filtered or unexported fields
}

CompetitionOfficialInvitationService defines the service that can provide search

func (CompetitionOfficialInvitationService) CreateCompetitionOfficialInvitation

func (service CompetitionOfficialInvitationService) CreateCompetitionOfficialInvitation(sender, recipient Account, serviceRole int, comp Competition) (CompetitionOfficialInvitation, error)

func (CompetitionOfficialInvitationService) SearchCompetitionOfficialInvitation

func (CompetitionOfficialInvitationService) UpdateCompetitionOfficialInvitation

func (service CompetitionOfficialInvitationService) UpdateCompetitionOfficialInvitation(currentUser Account, invitation CompetitionOfficialInvitation, response string) error

type CompetitionRegistrationService

type CompetitionRegistrationService struct {
	AccountRepository               IAccountRepository
	PartnershipRepository           IPartnershipRepository
	CompetitionRepository           ICompetitionRepository
	EventRepository                 IEventRepository
	AthleteCompetitionEntryRepo     IAthleteCompetitionEntryRepository
	PartnershipCompetitionEntryRepo IPartnershipCompetitionEntryRepository

	PartnershipEventEntryRepo      IPartnershipEventEntryRepository
	AthleteCompetitionEntryService AthleteCompetitionEntryService
	// contains filtered or unexported fields
}

CompetitionRegistrationService provides a high level operation for Competition Registration

func NewCompetitionRegistrationService

func NewCompetitionRegistrationService(
	accountRepo IAccountRepository,
	partnershipRepo IPartnershipRepository,
	competitionRepo ICompetitionRepository,
	eventRepo IEventRepository,
	athleteCompetitionEntryRepo IAthleteCompetitionEntryRepository,
	athleteEventEntryRepo IAthleteEventEntryRepository,
	coupleCompetitionEntryRepo IPartnershipCompetitionEntryRepository,
	coupleEventEntryRepo IPartnershipEventEntryRepository) CompetitionRegistrationService

func (CompetitionRegistrationService) CreateAndUpdateAthleteCompetitionEntry

func (service CompetitionRegistrationService) CreateAndUpdateAthleteCompetitionEntry(currentUser Account, registration EventRegistrationForm) error

CreateAndUpdateAthleteCompetitionEntry takes the current user and the registration data and create new Competition Entry for each of the athlete

func (CompetitionRegistrationService) CreateAndUpdatePartnershipCompetitionEntry

func (service CompetitionRegistrationService) CreateAndUpdatePartnershipCompetitionEntry(currentUser Account, registration EventRegistrationForm) error

CreateAndUpdatePartnershipCompetitionEntry takes the current user and registration data and create a Competition Entry for this Partnership

func (CompetitionRegistrationService) CreateAndUpdatePartnershipEventEntries

func (service CompetitionRegistrationService) CreateAndUpdatePartnershipEventEntries(currentUser Account, registration EventRegistrationForm) error

CreatePartnershipEventEntries takes the current user and registration data to create a new Event Entry for this partnership

func (CompetitionRegistrationService) CreateAndUpdateRegistration

func (service CompetitionRegistrationService) CreateAndUpdateRegistration(currentUser Account, registration EventRegistrationForm) error

CreateAndUpdateRegistration is the only method that handles registration. This methods handles the following situations - Create new entries, if entries are not created - Delete entries, if exists

func (CompetitionRegistrationService) DropPartnershipCompetitionEntry

func (service CompetitionRegistrationService) DropPartnershipCompetitionEntry(partnershipID, competitionID int) error

DropPartnershipCompetitionEntry removes the competition entry of the specified partnership from the provided competition if that partnership, competition, or entry does not exist, and error will be thrown

func (CompetitionRegistrationService) DropPartnershipEventEntries

func (service CompetitionRegistrationService) DropPartnershipEventEntries(currentUser Account, registration EventRegistrationForm) error

DropPartnershipEventEntries takes the current user and registration data and removes specified entries from the event

func (CompetitionRegistrationService) SearchCompetitionEntries

func (service CompetitionRegistrationService) SearchCompetitionEntries(criteria SearchEntryCriteria) (CompetitionEntryList, error)

func (CompetitionRegistrationService) SearchEventEntries

func (service CompetitionRegistrationService) SearchEventEntries(criteria SearchEntryCriteria) ([]EventEntryList, error)

SearchEventEntries searches the entries of one event. Parameters specified in the criteria will be used to locate all eligible events. For each event, a list of entries will be returned

func (CompetitionRegistrationService) SearchPartnershipEventEntries

func (service CompetitionRegistrationService) SearchPartnershipEventEntries(criteria SearchEntryCriteria) ([]PartnershipEventEntry, error)

func (CompetitionRegistrationService) ValidateEventRegistration

func (service CompetitionRegistrationService) ValidateEventRegistration(currentUser Account, registration EventRegistrationForm) error

ValidateEventRegistration validates if the registration data is valid. This does not create the registration

type CompetitionStatus

type CompetitionStatus struct {
	ID              int
	Name            string
	Abbreviation    string
	Description     string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

CompetitionStatus defines the data that is required to label the status of a Competition

type Country

type Country struct {
	ID              int
	Name            string
	Abbreviation    string
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

Country specifies the data needed to serve as reference data

func (Country) GetFederations

func (country Country) GetFederations(repo IFederationRepository) ([]Federation, error)

GetFederations retrieves all the federations that are associated with the caller Country from the repository

func (Country) GetStates

func (country Country) GetStates(repo IStateRepository) ([]State, error)

GetStates retrieves all the states that are associated with the caller Country from the repository

type Dance

type Dance struct {
	ID              int
	Name            string
	Description     string
	Abbreviation    string
	StyleID         int
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

Dance is style-dependent. For example, Cha Cha of American Rhythm is different from Cha Cha of International Latin

type DeckCaptainProfile

type DeckCaptainProfile struct {
	ID              int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

type Division

type Division struct {
	ID              int
	Name            string
	Abbreviation    string
	Description     string
	FederationID    int
	Note            string
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

type EmceeProfile

type EmceeProfile struct {
	ID              int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

type Event

type Event struct {
	ID            int
	CompetitionID int
	CategoryID    int // ballroom, cabaret, theater art
	Description   string
	StatusID      int
	Prefix        string // Organizer can use prefix to customize event
	Suffix        string // Organizer can use suffix to customize event
	FederationID  int
	Federation    Federation
	DivisionID    int
	Division      Division
	AgeID         int
	Age           Age
	ProficiencyID int
	Proficiency   Proficiency
	StyleID       int
	Style         Style

	Rounds          []int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
	// contains filtered or unexported fields
}

Event contains data that are used for a generic competitive ballroom event, though it can be used for theatre art or cabaret events as well by leaving unnecessary fields empty or with default values.

func NewEvent

func NewEvent() *Event

NewEvent create a new

func (*Event) AddDance

func (event *Event) AddDance(danceID int)

AddDance adds a dance's ID

func (*Event) AddEventDance

func (event *Event) AddEventDance(eveDance EventDance)

func (Event) EquivalentTo

func (event Event) EquivalentTo(other Event) bool

EquivalentTo checks if two events are equivalent in Federation, Division, Age, Proficiency, Style, and dances

func (Event) GetDances

func (event Event) GetDances() []int

GetDances returns the ID of dances of the caller event

func (Event) GetEventDances

func (event Event) GetEventDances() []EventDance

func (Event) HasDance

func (event Event) HasDance(danceID int) bool

HasDance checks if a dance of the provided ID is in the event

func (*Event) RemoveDance

func (event *Event) RemoveDance(danceID int)

RemoveDance removes the dance of the provided ID from the event

func (*Event) SetDances

func (event *Event) SetDances(dances []int)

SetDances replaces the dances of the event with the new dances

func (Event) ToString

func (event Event) ToString() string

ToString returns the String representation of an event

type EventDance

type EventDance struct {
	ID              int
	EventID         int
	DanceID         int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

EventDance represents the many-to-many relationship between competition event and dance references.

func NewEventDance

func NewEventDance(event Event, danceID int) *EventDance

type EventEntry

type EventEntry struct {
	ID              int
	EventID         int
	CheckInTime     time.Time
	CompetitorTag   int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

EventEntry defines the base struct of an Entry at an Event

type EventEntryList

type EventEntryList struct {
	Event          Event
	AthleteEntries []AthleteEventEntry
	CoupleEntries  []PartnershipEventEntry
}

EventEntryList contains the event, and the athletes and couples who are competing in this event

type EventRegistrationForm

type EventRegistrationForm struct {
	Competition        Competition
	Couple             Partnership
	EventsAdded        []Event
	EventsDropped      []Event
	CountryRepresented Country
	StateRepresented   State
	SchoolRepresented  School
	StudioRepresented  Studio
}

EventRegistrationForm specifies the data needed to create/update/drop event registration

func GetEventRegistration

func GetEventRegistration(competitionID int, partnershipID int, user *Account, partnershipRepo IPartnershipRepository) (EventRegistrationForm, error)

GetEventRegistration get event registration for the provided competition and partnership

type EventStatus

type EventStatus struct {
	ID              int
	Name            string
	Abbreviation    string
	Description     string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

EventStatus defines status of an event

type EventTemplate

type EventTemplate struct {
	Federation  string   `json:"federation"`
	Division    string   `json:"division"`
	Age         string   `json:"age"`
	Proficiency string   `json:"proficiency"`
	Style       string   `json:"style"`
	Dances      []string `json:"dances"`
}

type Federation

type Federation struct {
	ID              int
	Name            string
	Abbreviation    string
	Description     string
	YearFounded     int
	CountryID       int
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

func (Federation) GetDivisions

func (federation Federation) GetDivisions(repo IDivisionRepository) ([]Division, error)

type Gender

type Gender struct {
	ID              int
	Name            string
	Abbreviation    string
	Description     string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

type GenderRule

type GenderRule struct {
	AllowSameSex bool
	IAccountRepository
	IPartnershipRepository
}

func (GenderRule) Apply

func (rule GenderRule) Apply(registration EventRegistrationForm) error

type IAccountRepository

type IAccountRepository interface {
	SearchAccount(criteria SearchAccountCriteria) ([]Account, error)
	CreateAccount(account *Account) error
	UpdateAccount(account Account) error
	DeleteAccount(account Account) error
}

IAccountRepository specifies the interface that an account repository needs to implement.

type IAccountRoleRepository

type IAccountRoleRepository interface {
	CreateAccountRole(role *AccountRole) error
	SearchAccountRole(criteria SearchAccountRoleCriteria) ([]AccountRole, error)
}

IAccountRoleRepository defines the functions that an account role repository should implement

type IAccountStatusRepository

type IAccountStatusRepository interface {
	GetAccountStatus() ([]AccountStatus, error)
}

IAccountStatusRepository specifies the requirements

type IAccountTypeRepository

type IAccountTypeRepository interface {
	GetAccountTypes() ([]AccountType, error)
}

IAccountTypeRepository specifies the functiosn that need to be implemented for looking up account types in DAS

type IAdjudicatorCompetitionEntryRepository

type IAdjudicatorCompetitionEntryRepository interface {
	CreateEntry(entry *AdjudicatorCompetitionEntry) error
	DeleteEntry(entry AdjudicatorCompetitionEntry) error
	SearchEntry(criteria SearchAdjudicatorCompetitionEntryCriteria) ([]AdjudicatorCompetitionEntry, error)
	UpdateEntry(entry AdjudicatorCompetitionEntry) error
}

IAdjudicatorCompetitionEntryRepository specifies the methods that should be implemented to provide repository function for businesslogic

type IAdjudicatorEventEntryRepository

type IAdjudicatorEventEntryRepository interface {
	CreateEventEntry(entry *AdjudicatorEventEntry) error
	DeleteEventEntry(entry AdjudicatorEventEntry) error
	SearchEventEntry(criteria SearchAdjudicatorEventEntryCriteria) ([]AdjudicatorEventEntry, error)
	UpdateEventEntry(entry AdjudicatorEventEntry) error
}

type IAdjudicatorProfileRepository

type IAdjudicatorProfileRepository interface {
	CreateProfile(profile *AdjudicatorProfile) error
	UpdateProfile(profile AdjudicatorProfile) error
	SearchProfile(criteria SearchAdjudicatorProfileCriteria) ([]AdjudicatorProfile, error)
}

type IAdjudicatorRoundEntryRepository

type IAdjudicatorRoundEntryRepository interface {
	CreateAdjudicatorRoundEntry(entry *AdjudicatorRoundEntry) error
	DeleteAdjudicatorRoundEntry(entry AdjudicatorRoundEntry) error
	SearchAdjudicatorRoundEntry(criteria SearchAdjudicatorRoundEntryCriteria) ([]AdjudicatorRoundEntry, error)
	UpdateAdjudicatorRoundEntry(entry AdjudicatorRoundEntry) error
}

IAdjudicatorRoundEntryRepository specifies the functions that need to be implemented to perform CRUD operations

type IAgeRepository

type IAgeRepository interface {
	CreateAge(age *Age) error
	SearchAge(criteria SearchAgeCriteria) ([]Age, error)
	UpdateAge(age Age) error
	DeleteAge(age Age) error
}

IAgeRepository provides an interface for other businesslogic code to access Age data

type IAthleteCompetitionEntryRepository

type IAthleteCompetitionEntryRepository interface {
	CreateEntry(entry *AthleteCompetitionEntry) error
	DeleteEntry(entry AthleteCompetitionEntry) error
	SearchEntry(criteria SearchAthleteCompetitionEntryCriteria) ([]AthleteCompetitionEntry, error)
	UpdateEntry(entry AthleteCompetitionEntry) error
	NextAvailableLeadTag(competition Competition) (int, error)
	GetEntriesByCompetition(competitionId int) ([]AthleteCompetitionEntry, error)
}

IAthleteCompetitionEntryRepository specifies the interface that data source should implement to perform CRUD operations for AthleteCompetitionEntry

type IAthleteEventEntryRepository

type IAthleteEventEntryRepository interface {
	CreateAthleteEventEntry(entry *AthleteEventEntry) error
	DeleteAthleteEventEntry(entry AthleteEventEntry) error
	SearchAthleteEventEntry(criteria SearchAthleteEventEntryCriteria) ([]AthleteEventEntry, error)
	UpdateAthleteEventEntry(entry AthleteEventEntry) error
}

type IAthleteProfileRepository

type IAthleteProfileRepository interface {
	SearchProfile(criteria SearchAthleteProfileCriteria) ([]AthleteProfile, error)
}

type ICityRepository

type ICityRepository interface {
	CreateCity(city *City) error
	SearchCity(criteria SearchCityCriteria) ([]City, error)
	UpdateCity(city City) error
	DeleteCity(city City) error
}

ICityRepository specifies the interface that data access layer code should implement

type ICompetitionEventTemplateRepository

type ICompetitionEventTemplateRepository interface {
	SearchCompetitionEventTemplates(criteria SearchCompetitionEventTemplateCriteria) ([]CompetitionEventTemplate, error)
}

type ICompetitionLeadTagRepository

type ICompetitionLeadTagRepository interface {
	CreateCompetitionLeadTag(tag *CompetitionLeadTag) error
	DeleteCompetitionLeadTag(tag CompetitionLeadTag) error
	SearchCompetitionLeadTag(criteria SearchCompetitionLeadTagCriteria) (CompetitionLeadTagCollection, error)
	UpdateCompetitionLeadTag(tag CompetitionLeadTag) error
}

ICompetitionLeadTagRepository defines the interface that a lead tag repository should implement.

type ICompetitionOfficialInvitationRepository

type ICompetitionOfficialInvitationRepository interface {
	CreateCompetitionOfficialInvitationRepository(invitation *CompetitionOfficialInvitation) error
	DeleteCompetitionOfficialInvitationRepository(invitation CompetitionOfficialInvitation) error
	SearchCompetitionOfficialInvitationRepository(criteria SearchCompetitionOfficialInvitationCriteria) ([]CompetitionOfficialInvitation, error)
	UpdateCompetitionOfficialInvitationRepository(invitation CompetitionOfficialInvitation) error
}

ICompetitionOfficialInvitationRepository defines the interface that a CompetitionOfficialInvitation repository should implement, including creating, deleting, searching, and updating the invitation.

type ICompetitionOfficialRepository

type ICompetitionOfficialRepository interface {
	CreateCompetitionOfficial(official *CompetitionOfficial) error
	DeleteCompetitionOfficial(official CompetitionOfficial) error
	SearchCompetitionOfficial(criteria SearchCompetitionOfficialCriteria) ([]CompetitionOfficial, error)
	UpdateCompetitionOfficial(official CompetitionOfficial) error
}

type ICompetitionRepository

type ICompetitionRepository interface {
	CreateCompetition(competition *Competition) error
	SearchCompetition(criteria SearchCompetitionCriteria) ([]Competition, error)
	UpdateCompetition(competition Competition) error
	DeleteCompetition(competition Competition) error
}

ICompetitionRepository specifies the interface that a competition repository needs to implement to provide CRUD operations in the data repository

type ICompetitionStatusRepository

type ICompetitionStatusRepository interface {
	GetCompetitionAllStatus() ([]CompetitionStatus, error)
}

ICompetitionStatusRepository defines the function that a CompetitionStatusRepository should implement

type ICountryRepository

type ICountryRepository interface {
	CreateCountry(country *Country) error
	SearchCountry(criteria SearchCountryCriteria) ([]Country, error)
	DeleteCountry(country Country) error
	UpdateCountry(country Country) error
}

ICountryRepository specifies the functions that a repository needs to implement

type ICreateAccountStrategy

type ICreateAccountStrategy interface {
	CreateAccount(account Account, password string) error
}

ICreateAccountStrategy specifies the interface that account creation strategy needs to implement.

type IDanceRepository

type IDanceRepository interface {
	CreateDance(dance *Dance) error
	SearchDance(criteria SearchDanceCriteria) ([]Dance, error)
	UpdateDance(dance Dance) error
	DeleteDance(dance Dance) error
}

IDanceRepository specifies the interface that needs to be implemented to functions as a repository for dance

type IDeckCaptainProfileRepository

type IDeckCaptainProfileRepository interface {
	CreateProfile(profile *DeckCaptainProfile) error
	UpdateProfile(profile DeckCaptainProfile) error
	SearchProfile(criteria SearchDeckCaptainProfileCriteria) ([]DeckCaptainProfile, error)
}

type IDivisionRepository

type IDivisionRepository interface {
	CreateDivision(division *Division) error
	SearchDivision(criteria SearchDivisionCriteria) ([]Division, error)
	UpdateDivision(division Division) error
	DeleteDivision(division Division) error
}

type IEmceeProfileRepository

type IEmceeProfileRepository interface {
	CreateProfile(profile *EmceeProfile) error
	UpdateProfile(profile EmceeProfile) error
	SearchProfile(criteria SearchEmceeProfileCriteria) ([]EmceeProfile, error)
}

type IEventDanceRepository

type IEventDanceRepository interface {
	SearchEventDance(criteria SearchEventDanceCriteria) ([]EventDance, error)
	CreateEventDance(eventDance *EventDance) error
	DeleteEventDance(eventDance EventDance) error
	UpdateEventDance(eventDance EventDance) error
}

type IEventMetaRepository

type IEventMetaRepository interface {
	GetEventUniqueFederations(competition Competition) ([]Federation, error)
	GetEventUniqueDivisions(competition Competition) ([]Division, error)
	GetEventUniqueAges(competition Competition) ([]Age, error)
	GetEventUniqueProficiencies(competition Competition) ([]Proficiency, error)
	GetEventUniqueStyles(competition Competition) ([]Style, error)
}

type IEventRepository

type IEventRepository interface {
	SearchEvent(criteria SearchEventCriteria) ([]Event, error)
	CreateEvent(event *Event) error
	UpdateEvent(event Event) error
	DeleteEvent(event Event) error
}

IEventRepository specifies the interface that a struct need to implement to function as a repository for businesslogic

type IEventStatusRepository

type IEventStatusRepository interface {
	// GetEventStatus should return *all* the stored event status in the repository
	GetEventStatus() ([]EventStatus, error)
}

IEventStatusRepository defines the method that a EventStatus Repository should implement.

type IFederationRepository

type IFederationRepository interface {
	CreateFederation(federation *Federation) error
	SearchFederation(criteria SearchFederationCriteria) ([]Federation, error)
	UpdateFederation(federation Federation) error
	DeleteFederation(federation Federation) error
}

type IGenderRepository

type IGenderRepository interface {
	GetAllGenders() ([]Gender, error)
}

type INotificationCategoryRepository

type INotificationCategoryRepository interface {
	GetAllNotificationCategories() ([]NotificationCategory, error)
}

INotificationCategoryRepository specifies the interface that a NotificationCategoryRepository should implement

type INotificationPreferenceRepository

type INotificationPreferenceRepository interface {
	CreateNotificationPreference(pref *NotificationPreference) error
	DeleteNotificationPreference(pref NotificationPreference) error
	SearchNotificationPreference(criteria SearchNotificationPreferenceCriteria) ([]NotificationPreference, error)
	UpdateNotificationPreference(pref NotificationPreference) error
}

INotificationPreferenceRepository specifies the interface that a Notification Preference repository should implement

type INotificationRepository

type INotificationRepository interface {
	CreateNotification(notification *Notification) error
	DeleteNotification(notification Notification) error
	SearchNotification(criteria SearchNotificationCriteria) ([]Notification, error)
	UpdateNotification(notification Notification) error
}

INotificationRepository specifies the interface that a Notification Repository should implement

type IOrganizerProfileRepository

type IOrganizerProfileRepository interface {
	CreateProfile(profile *OrganizerProfile) error
	UpdateProfile(profile OrganizerProfile) error
	SearchProfile(criteria SearchOrganizerProfileCriteria) ([]OrganizerProfile, error)
}

type IOrganizerProvisionHistoryRepository

type IOrganizerProvisionHistoryRepository interface {
	SearchOrganizerProvisionHistory(criteria SearchOrganizerProvisionHistoryCriteria) ([]OrganizerProvisionHistoryEntry, error)
	CreateOrganizerProvisionHistory(history *OrganizerProvisionHistoryEntry) error
}

type IOrganizerProvisionRepository

type IOrganizerProvisionRepository interface {
	CreateOrganizerProvision(provision *OrganizerProvision) error
	UpdateOrganizerProvision(provision OrganizerProvision) error
	DeleteOrganizerProvision(provision OrganizerProvision) error
	SearchOrganizerProvision(criteria SearchOrganizerProvisionCriteria) ([]OrganizerProvision, error)
}

IOrganizerProvisionRepository specifies the interface that a repository should implement for Organizer Provision

type IPartnershipCompetitionEntryRepository

type IPartnershipCompetitionEntryRepository interface {
	CreateEntry(entry *PartnershipCompetitionEntry) error
	DeleteEntry(entry PartnershipCompetitionEntry) error
	SearchEntry(criteria SearchPartnershipCompetitionEntryCriteria) ([]PartnershipCompetitionEntry, error)
	UpdateEntry(entry PartnershipCompetitionEntry) error
}

IPartnershipCompetitionEntryRepository specifies functions that should be implemented to provide CRUD operations on PartnershipCompetitionEntry

type IPartnershipEventEntryRepository

type IPartnershipEventEntryRepository interface {
	CreatePartnershipEventEntry(entry *PartnershipEventEntry) error
	DeletePartnershipEventEntry(entry PartnershipEventEntry) error
	SearchPartnershipEventEntry(criteria SearchPartnershipEventEntryCriteria) ([]PartnershipEventEntry, error)
	UpdatePartnershipEventEntry(entry PartnershipEventEntry) error
}

IPartnershipEventEntryRepository defines the functions that need to be implemented to perform CRUD function for businesslogic to use

type IPartnershipRepository

type IPartnershipRepository interface {
	CreatePartnership(partnership *Partnership) error
	SearchPartnership(criteria SearchPartnershipCriteria) ([]Partnership, error)
	UpdatePartnership(partnership Partnership) error
	DeletePartnership(partnership Partnership) error
}

IPartnershipRepository defines the interface that a partnership repository should implement

type IPartnershipRequestBlacklistReasonRepository

type IPartnershipRequestBlacklistReasonRepository interface {
	GetPartnershipRequestBlacklistReasons() ([]PartnershipRequestBlacklistReason, error)
}

type IPartnershipRequestBlacklistRepository

type IPartnershipRequestBlacklistRepository interface {
	SearchPartnershipRequestBlacklist(criteria SearchPartnershipRequestBlacklistCriteria) ([]PartnershipRequestBlacklistEntry, error)
	CreatePartnershipRequestBlacklist(blacklist *PartnershipRequestBlacklistEntry) error
	DeletePartnershipRequestBlacklist(blacklist PartnershipRequestBlacklistEntry) error
	UpdatePartnershipRequestBlacklist(blacklist PartnershipRequestBlacklistEntry) error
}

IPartnershipRequestBlacklistRepository defines the interface that a partnership request blacklist repository should implement

type IPartnershipRequestRepository

type IPartnershipRequestRepository interface {
	CreatePartnershipRequest(request *PartnershipRequest) error
	SearchPartnershipRequest(criteria SearchPartnershipRequestCriteria) ([]PartnershipRequest, error)
	DeletePartnershipRequest(request PartnershipRequest) error
	UpdatePartnershipRequest(request PartnershipRequest) error
	GetReceivedRequests(recipientID int) ([]PartnershipRequest, error)
	GetSentRequests(senderID int) ([]PartnershipRequest, error)
}

IPartnershipRequestRepository specifies the functions that need to be implemented to allow CRUD operations on Partnership Request

type IPartnershipRequestStatusRepository

type IPartnershipRequestStatusRepository interface {
	GetPartnershipRequestStatus() ([]PartnershipRequestStatus, error)
}

type IPartnershipRoleRepository

type IPartnershipRoleRepository interface {
	GetAllPartnershipRoles() ([]PartnershipRole, error)
}

IPartnershipRoleRepository specifies the interface that a PartnershipRoleRepository should implement

type IPartnershipRoundEntryRepository

type IPartnershipRoundEntryRepository interface {
	CreatePartnershipRoundEntry(entry *PartnershipRoundEntry) error
	DeletePartnershipRoundEntry(entry PartnershipRoundEntry) error
	SearchPartnershipRoundEntry(criteria SearchPartnershipRoundEntryCriteria) ([]PartnershipRoundEntry, error)
	UpdatePartnershipRoundEntry(entry PartnershipRoundEntry) error
}

IPartnershipRoundEntryRepository specifies the functions that need to be implemented to perform CRUD operations

type IPartnershipStatusRepository

type IPartnershipStatusRepository interface {
	GetAllPartnershipStatus() ([]PartnershipStatus, error)
}

type IPlacementRepository

type IPlacementRepository interface {
	CreatePlacement(placement *Placement) error
	DeletePlacement(placement Placement) error
	SearchPlacement(criteria SearchPlacementCriteria) ([]Placement, error)
	UpdatePlacement(placement Placement) error
}

IPlacementRepository specifies the functions that a Placement Repository should implement

type IProficiencyRepository

type IProficiencyRepository interface {
	SearchProficiency(criteria SearchProficiencyCriteria) ([]Proficiency, error)
	CreateProficiency(proficiency *Proficiency) error
	UpdateProficiency(proficiency Proficiency) error
	DeleteProficiency(proficiency Proficiency) error
}

type IRoleApplicationRepository

type IRoleApplicationRepository interface {
	CreateApplication(application *RoleApplication) error
	SearchApplication(criteria SearchRoleApplicationCriteria) ([]RoleApplication, error)
	UpdateApplication(application RoleApplication) error
}

IRoleApplicationRepository specifies the interface that a Role Application Repository should implement

type IRoleApplicationStatusRepository

type IRoleApplicationStatusRepository interface {
	GetAllRoleApplicationStatus() ([]RoleApplicationStatus, error)
}

IRoleApplicationStatusRepository defines the interface that a Role Application Status Repository should implement

type IRoundRepository

type IRoundRepository interface {
	CreateRound(round *Round) error
	DeleteRound(round Round) error
	SearchRound(criteria SearchRoundCriteria) ([]Round, error)
	UpdateRound(round Round) error
}

IRoundRepository specifies the interface that a Round Repository should implement

type IRule

type IRule interface {
	Apply(registration EventRegistrationForm) error
}

type ISchoolRepository

type ISchoolRepository interface {
	CreateSchool(school *School) error
	SearchSchool(criteria SearchSchoolCriteria) ([]School, error)
	UpdateSchool(school School) error
	DeleteSchool(school School) error
}

type IScrutineerProfileRepository

type IScrutineerProfileRepository interface {
	CreateProfile(profile *ScrutineerProfile) error
	UpdateProfile(profile ScrutineerProfile) error
	SearchProfile(criteria SearchScrutineerProfileCriteria) ([]ScrutineerProfile, error)
}

type IStateRepository

type IStateRepository interface {
	CreateState(state *State) error
	SearchState(criteria SearchStateCriteria) ([]State, error)
	UpdateState(state State) error
	DeleteState(state State) error
}

type IStudioRepository

type IStudioRepository interface {
	CreateStudio(studio *Studio) error
	SearchStudio(criteria SearchStudioCriteria) ([]Studio, error)
	DeleteStudio(studio Studio) error
	UpdateStudio(studio Studio) error
}

type IStyleRepository

type IStyleRepository interface {
	CreateStyle(style *Style) error
	SearchStyle(criteria SearchStyleCriteria) ([]Style, error)
	UpdateStyle(style Style) error
	DeleteStyle(style Style) error
}

type IUserPreferenceRepository

type IUserPreferenceRepository interface {
	CreatePreference(preference *UserPreference) error
	SearchPreference(criteria SearchUserPreferenceCriteria) ([]UserPreference, error)
	UpdatePreference(preference UserPreference) error
}

type Notification

type Notification struct {
	ID                     int
	AccountID              int
	NotificationCategoryID int
	HasRead                bool
	DateTimeCreated        time.Time
}

Notification stores the content of a notification and the status of it

type NotificationCategory

type NotificationCategory struct {
	ID              int
	Name            string
	Abbreviation    string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

NotificationCategory defines different categories of notifications

type NotificationPreference

type NotificationPreference struct {
	ID              int
	AccountID       int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

NotificationPreference stores the preference of how user would like to receive system-generated notification

type OrganizerEventService

type OrganizerEventService struct {
	// contains filtered or unexported fields
}

OrganizerEventService provides a layer of abstraction of services used by organizers to manage events of competitions

func NewOrganizerEventService

func NewOrganizerEventService(accountRepo IAccountRepository,
	roleRepo IAccountRoleRepository,
	compRepo ICompetitionRepository,
	eventRepo IEventRepository,
	eventDanceRepo IEventDanceRepository,
	eventTemplateRepo ICompetitionEventTemplateRepository,
	federationRepo IFederationRepository,
	divisionRepo IDivisionRepository,
	ageRepo IAgeRepository,
	proficiencyRepo IProficiencyRepository,
	styleRepo IStyleRepository,
	danceRepo IDanceRepository) OrganizerEventService

func (OrganizerEventService) ApplyCollegiateTemplate

func (service OrganizerEventService) ApplyCollegiateTemplate(competitionID int) error

func (OrganizerEventService) ApplyNDCATemplate

func (service OrganizerEventService) ApplyNDCATemplate(competitionID int) error

func (OrganizerEventService) CreateEvent

func (service OrganizerEventService) CreateEvent(event *Event) error

func (OrganizerEventService) DeleteEvent

func (service OrganizerEventService) DeleteEvent(event Event, currentUser Account) error

func (OrganizerEventService) GenerateEventsFromTemplate

func (service OrganizerEventService) GenerateEventsFromTemplate(competitionID int, templateID int) error

func (OrganizerEventService) SearchCompetitionEventTemplate

func (service OrganizerEventService) SearchCompetitionEventTemplate(criteria SearchCompetitionEventTemplateCriteria) ([]CompetitionEventTemplate, error)

func (OrganizerEventService) SearchEvents

func (service OrganizerEventService) SearchEvents(criteria SearchEventCriteria) ([]Event, error)

func (OrganizerEventService) ValidateEvent

func (service OrganizerEventService) ValidateEvent(event Event) error

type OrganizerProfile

type OrganizerProfile struct {
	ID              int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

type OrganizerProvision

type OrganizerProvision struct {
	ID              int
	AccountID       int
	OrganizerRoleID int
	Organizer       Account
	Available       int
	Hosted          int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

OrganizerProvision provision organizer competition slots for creating and hosting competitions

type OrganizerProvisionHistoryEntry

type OrganizerProvisionHistoryEntry struct {
	ID              int
	OrganizerRoleID int
	Amount          int
	Note            string
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

type OrganizerProvisionService

type OrganizerProvisionService struct {
	// contains filtered or unexported fields
}

OrganizerProvisionServices provides functions that allows provisioning Organizer's Competition, including updating and querying Organizer's Competition Provision.

func NewOrganizerProvisionService

func NewOrganizerProvisionService(
	accountRepo IAccountRepository,
	accountRoleRepo IAccountRoleRepository,
	organizerProvisionRepo IOrganizerProvisionRepository,
	organizerProvisionHistoryRepo IOrganizerProvisionHistoryRepository) OrganizerProvisionService

func (OrganizerProvisionService) NewInitialOrganizerProvisionHistoryEntry

func (service OrganizerProvisionService) NewInitialOrganizerProvisionHistoryEntry(accountRoleID, currentUserID int) OrganizerProvisionHistoryEntry

NewInitialOrganizerProvisionHistoryEntry initialize the first provision history for an Organizer.

func (OrganizerProvisionService) NewOrganizerProvision

func (service OrganizerProvisionService) NewOrganizerProvision(accountRoleID, currentUserID int) (OrganizerProvision, error)

func (OrganizerProvisionService) SearchOrganizerProvision

func (service OrganizerProvisionService) SearchOrganizerProvision(criteria SearchOrganizerProvisionCriteria) ([]OrganizerProvision, error)

func (OrganizerProvisionService) UpdateOrganizerCompetitionProvision

func (service OrganizerProvisionService) UpdateOrganizerCompetitionProvision(update UpdateOrganizerProvision) error

type OrganizerStripeSettings

type OrganizerStripeSettings struct {
	ID                  int
	StripePublicKey     string
	StripeRestrictedKey string
}

type OrganizerUpdateCompetition

type OrganizerUpdateCompetition struct {
	CompetitionID int       `json:"competitionId"`
	Name          string    `json:"name"`
	Website       string    `json:"website"`
	Status        int       `json:"statusId"`
	Address       string    `json:"street"`
	CityID        int       `json:"cityId"`
	StateID       int       `json:"stateId"`
	CountryID     int       `json:"countryId"`
	FederationID  int       `json:"federationId"`
	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 Partnership

type Partnership struct {
	ID                   int
	Lead                 Account
	Follow               Account
	SameSex              bool
	FavoriteByLead       bool
	FavoriteByFollow     bool
	CompetitionsAttended int
	EventsAttended       int
	DateTimeCreated      time.Time
	DateTimeUpdated      time.Time
}

Partnership defines the combination of a lead and a follow. A partnership is uniquely identified if the lead and follow are confirmed.

func GetPartnershipByID

func GetPartnershipByID(id int, repo IPartnershipRepository) (Partnership, error)

GetPartnershipByID retrieves the Partnership in the provided repository by the specified ID

func MustGetPartnershipByID

func MustGetPartnershipByID(id int, repo IPartnershipRepository) Partnership

MustGetPartnershipByID uses an known ID and a concrete PartnershipRepository to find the partnership by the ID provided. If such partnership is not found, system will panic.

func (Partnership) HasAthlete

func (partnership Partnership) HasAthlete(athleteID int) bool

HasAthlete checks if the provided Athlete ID is in this partnership

type PartnershipCompetitionEntry

type PartnershipCompetitionEntry struct {
	ID                int
	Couple            Partnership
	Competition       Competition
	CheckedIn         bool
	DateTimeCheckedIn time.Time
	CreateUserID      int
	DateTimeCreated   time.Time
	UpdateUserID      int
	DateTimeUpdated   time.Time
}

PartnershipCompetitionEntry defines a partnership's participation of a competition

type PartnershipCompetitionEntryService

type PartnershipCompetitionEntryService struct {
	// contains filtered or unexported fields
}

func (PartnershipCompetitionEntryService) CreatePartnershipCompetitionEntry

func (service PartnershipCompetitionEntryService) CreatePartnershipCompetitionEntry() error

func (PartnershipCompetitionEntryService) DeletePartnershipCompetitionEntry

func (service PartnershipCompetitionEntryService) DeletePartnershipCompetitionEntry() error

func (PartnershipCompetitionEntryService) GetAllLeadEntries

func (service PartnershipCompetitionEntryService) GetAllLeadEntries(competition Competition) ([]AthleteCompetitionEntry, error)

GetAllLeadEntries returns all the unique leads at the specified competition, if any

func (PartnershipCompetitionEntryService) SearchPartnershipCompetitionEntry

func (service PartnershipCompetitionEntryService) SearchPartnershipCompetitionEntry() error

type PartnershipCompetitionRepresentation

type PartnershipCompetitionRepresentation struct {
	ID                            int
	PartnershipCompetitionEntryID int
	CountryID                     *int
	StateID                       *int
	StudioID                      *int
	SchoolID                      *int
	CreateUserID                  int
	DateTimeCreated               time.Time
	UpdateUserID                  int
	DateTimeUpdated               time.Time
}

PartnershipCompetitionRepresentation specifies the Country, State, Studio, School that a partnership represents at a Competition

type PartnershipEventEntry

type PartnershipEventEntry struct {
	ID                int
	Couple            Partnership
	Competition       Competition
	Event             Event
	CompetitorTag     int
	CheckedIn         bool
	DateTimeCheckedIn *time.Time
	Placement         int
	CreateUserID      int
	DateTimeCreated   time.Time
	UpdateUserID      int
	DateTimeUpdated   time.Time
}

PartnershipEventEntry defines the Entry of a PartnershipID at an Event

type PartnershipEventEntryService

type PartnershipEventEntryService struct{}

type PartnershipRequest

type PartnershipRequest struct {
	PartnershipRequestID int
	SenderID             int
	RecipientID          int
	SenderAccount        *Account
	RecipientAccount     *Account
	SenderRole           int
	RecipientRole        int
	Message              string
	Status               int
	CreateUserID         int
	DateTimeCreated      time.Time
	UpdateUserID         int
	DateTimeUpdated      time.Time
}

PartnershipRequest is a request of partnership that can only be sent between Athletes who are not in the requested Partnership

type PartnershipRequestBlacklistEntry

type PartnershipRequestBlacklistEntry struct {
	ID              int
	Reporter        Account
	BlockedUser     Account
	BlockedReason   PartnershipRequestBlacklistReason
	Detail          string
	Whitelisted     bool
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

type PartnershipRequestBlacklistReason

type PartnershipRequestBlacklistReason struct {
	ID              int
	Name            string
	Description     string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

type PartnershipRequestResponse

type PartnershipRequestResponse struct {
	RequestID       int
	RecipientID     int
	Response        int
	DateTimeCreated time.Time
}

PartnershipRequestResponse is the response that recipient can make towards a request

type PartnershipRequestService

type PartnershipRequestService struct {
	// contains filtered or unexported fields
}

func NewPartnershipRequestService

func NewPartnershipRequestService(accountRepo IAccountRepository, partnershipRepo IPartnershipRepository, blacklistRepo IPartnershipRequestBlacklistRepository) *PartnershipRequestService

func (PartnershipRequestService) CreatePartnershipRequest

func (service PartnershipRequestService) CreatePartnershipRequest(currentUser Account, request PartnershipRequest) error

type PartnershipRequestStatus

type PartnershipRequestStatus struct {
	ID              int
	Code            string
	Description     string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

type PartnershipRole

type PartnershipRole struct {
	ID              int
	Name            string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

PartnershipRole defines roles within a Partnership: lead and follow

type PartnershipRoundEntry

type PartnershipRoundEntry struct {
	ID            int
	RoundEntry    RoundEntry
	PartnershipID int
}

PartnershipRoundEntry is the Round Entry of a Partnership

type PartnershipStatus

type PartnershipStatus struct {
	ID              int
	Name            string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

type Placement

type Placement struct {
	ID                        int
	AdjudicatorRoundEntryID   int
	PartnershipRoundEntryID   int
	RoundDanceID              int
	PreliminaryRoundIndicator bool
	Placement                 int
	CreateUserID              int
	DateTimeCreated           time.Time
	UpdateUserID              int
	DateTimeUpdated           time.Time
}

Placement defines the minimal data for a dance placement: Round + Dance + Adjudicator + Partnership + Placement together defines a unique placement

type Proficiency

type Proficiency struct {
	ID              int
	Name            string
	Description     string
	DivisionID      int
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTImeUpdated time.Time
}

type RoleApplication

type RoleApplication struct {
	ID               int
	AccountID        int
	Account          Account
	AppliedRoleID    int
	Description      string
	StatusID         int
	ApprovalUserID   *int
	DateTimeApproved time.Time
	CreateUserID     int
	DateTimeCreated  time.Time
	UpdateUserID     int
	DateTimeUpdated  time.Time
}

RoleApplication is an application for restricted roles, including adjudicator, scrutineer, and organizer. Non-restrictive roles such as emcee and deck captain can be approved by competition organizers

type RoleApplicationStatus

type RoleApplicationStatus struct {
	ID              int
	Name            string
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

RoleApplicationStatus contains the status of a role application

type RoleProvisionService

type RoleProvisionService struct {
	// contains filtered or unexported fields
}

RoleProvisionService is a service that handles Role Application and provision

func NewRoleProvisionService

func NewRoleProvisionService(
	accountRepo IAccountRepository,
	roleApplicationRepo IRoleApplicationRepository,
	roleApplicationStatusRepo IRoleApplicationStatusRepository,
	roleRepo IAccountRoleRepository,
	organizerProvisionRepo IOrganizerProvisionRepository,
	organizerProvisionHistoryRepo IOrganizerProvisionHistoryRepository,
) *RoleProvisionService

NewRoleProvisionService create a service that serves Role Provision

func (RoleProvisionService) CreateRoleApplication

func (service RoleProvisionService) CreateRoleApplication(currentUser Account, application *RoleApplication) error

CreateRoleApplication check the validity of the role application and create it if it's valid

func (RoleProvisionService) GetAllRoleApplicationStatuses

func (service RoleProvisionService) GetAllRoleApplicationStatuses() ([]RoleApplicationStatus, error)

func (RoleProvisionService) SearchRoleApplication

func (service RoleProvisionService) SearchRoleApplication(currentUser Account, criteria SearchRoleApplicationCriteria) ([]RoleApplication, error)

SearchRoleApplication searches the available role application based on current user's privilege

func (RoleProvisionService) UpdateApplication

func (service RoleProvisionService) UpdateApplication(currentUser Account, application *RoleApplication, action int) error

UpdateApplication attempts to approve the Role application based on the privilege of current user. If current user is admin, any application can be approved If current user is organizer, only emcee and deck-captain can be approved If current user is other roles, current user will be prohibited from performing such action

type Round

type Round struct {
	ID              int
	EventID         int
	Order           RoundOrder
	Entries         []EventEntry
	StartTime       time.Time
	EndTime         time.Time
	DateTimeCreated time.Time
	CreateUserID    int
	DateTimeUpdated time.Time
	UpdateUserID    int
}

Round defines the round for each event

type RoundEntry

type RoundEntry struct {
	RoundID         int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

RoundEntry is the base entry for a round that can be used for adjudicator and partnership.

type RoundOrder

type RoundOrder struct {
	ID              int
	Rank            int
	DateTimeCreated time.Time
	DateTimeUpdated time.Time
}

RoundOrder defines the order of the round, from lowest to the highest

type School

type School struct {
	ID              int
	Name            string
	CityID          int
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

type ScrutineerProfile

type ScrutineerProfile struct {
	ID              int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

type SearchAccountCriteria

type SearchAccountCriteria struct {
	ID            int
	UUID          string
	Email         string
	Phone         string
	FirstName     string
	LastName      string
	DateOfBirth   time.Time
	Gender        int
	AccountType   int
	AccountStatus int
}

SearchAccountCriteria provides the parameters that an IAccountRepository can use to search by

type SearchAccountRoleCriteria

type SearchAccountRoleCriteria struct {
	ID            int
	AccountID     int
	AccountTypeID int
}

SearchAccountRoleCriteria specifies the parameters that can be used to search Account Roles in a repository

type SearchAdjudicatorCompetitionEntryCriteria

type SearchAdjudicatorCompetitionEntryCriteria struct {
	ID            int
	AdjudicatorID int
	CompetitionID int
}

SearchAdjudicatorCompetitionEntryCriteria specifies the parameters that can be used to search Adjudicator's participation at competitions

type SearchAdjudicatorEventEntryCriteria

type SearchAdjudicatorEventEntryCriteria struct {
	CompetitionID int `schema:"competition"`
	EventID       int
	PartnershipID int
	Federation    int `schema:"federation"`
	Division      int `schema:"division"`
	Age           int `schema:"age"`
	Proficiency   int `schema:"proficiency"`
	Style         int `schema:"style"`
}

SearchAdjudicatorEventEntryCriteria specifies the parameters that can be used to search the Event Entry of a Adjudicator in DAS

type SearchAdjudicatorProfileCriteria

type SearchAdjudicatorProfileCriteria struct{}

type SearchAdjudicatorRoundEntryCriteria

type SearchAdjudicatorRoundEntryCriteria struct {
}

SearchAdjudicatorRoundEntryCriteria specifies the parameters that can be used to search the Round Entry of Adjudicator

type SearchAgeCriteria

type SearchAgeCriteria struct {
	Name       string `schema:"name"`
	DivisionID int    `schema:"division"`
	AgeID      int    `schema:"id"`
}

SearchAgeCriteria provides parameters when searching Age in IAgeRepository

type SearchAthleteCompetitionEntryCriteria

type SearchAthleteCompetitionEntryCriteria struct {
	ID            int  `schema:"id"`
	AthleteID     int  `schema:"athlete"`
	CompetitionID int  `schema:"competition"`
	IsLead        bool `schema:"isLead"`
	Tag           int  `schema:"leadTag"`
}

SearchAthleteCompetitionEntryCriteria specifies the parameters that can be used to search Athlete Competition Entries in DAS

type SearchAthleteEventEntryCriteria

type SearchAthleteEventEntryCriteria struct {
	ID            int
	AthleteID     int
	CompetitionID int
	EventID       int
}

type SearchAthleteProfileCriteria

type SearchAthleteProfileCriteria struct {
	FirstName string
	LastName  string
}

type SearchCityCriteria

type SearchCityCriteria struct {
	CityID  int    `schema:"id"`
	Name    string `schema:"name"`
	StateID int    `schema:"state"`
}

SearchCityCriteria provides the parameter for search City in ICityRepository. This criteria can be used as parameters in REST API or internally

type SearchCompetitionCriteria

type SearchCompetitionCriteria struct {
	ID            int       `schema:"id"`
	Name          string    `schema:"name"`
	FederationID  int       `schema:"federation"`
	StateID       int       `schema:"state"`
	CountryID     int       `schema:"country"`
	StartDateTime time.Time `schema:"start"`
	OrganizerID   int
	StatusID      int `schema:"status"`
}

SearchCompetitionCriteria specifies the parameters that can be used to search a Competition

type SearchCompetitionEventTemplateCriteria

type SearchCompetitionEventTemplateCriteria struct {
	ID           int
	Name         string
	CreateUserID int
}

type SearchCompetitionLeadTagCriteria

type SearchCompetitionLeadTagCriteria struct {
	ID            int
	CompetitionID int
	LeadID        int
	Tag           int
	CreateUserID  int
}

SearchCompetitionLeadTagCriteria defines the parameters that can be used to search lead's tags at competitions

type SearchCompetitionOfficialCriteria

type SearchCompetitionOfficialCriteria struct {
	ID             int
	CompetitionID  int
	OfficialID     string
	OfficialRoleID int
}

type SearchCompetitionOfficialInvitationCriteria

type SearchCompetitionOfficialInvitationCriteria struct {
	SenderID             int
	RecipientID          int
	ServiceCompetitionID int
	AssignedRoleID       int
	Status               string
	CreateUserID         int
	UpdateUserID         int
}

SearchCompetitionOfficialInvitationCriteria defines the search criteria that can be used to search CompetitionOfficialInvitation within a Invitation repository.

type SearchCountryCriteria

type SearchCountryCriteria struct {
	CountryID    int    `schema:"id"`
	Name         string `schema:"name"`
	Abbreviation string `schema:"abbreviation"`
}

SearchCountryCriteria specifies the parameters that can be used to search certain countries in DAS

type SearchDanceCriteria

type SearchDanceCriteria struct {
	StyleID int    `schema:"style"`
	DanceID int    `schema:"id"`
	Name    string `schema:"name"`
}

SearchDanceCriteria specifies the parameters that can be used to to search dances in DAS

type SearchDeckCaptainProfileCriteria

type SearchDeckCaptainProfileCriteria struct{}

type SearchDivisionCriteria

type SearchDivisionCriteria struct {
	ID           int    `schema:"id"`
	Name         string `schema:"name"`
	FederationID int    `schema:"federation"`
}

type SearchEmceeProfileCriteria

type SearchEmceeProfileCriteria struct{}

type SearchEntryCriteria

type SearchEntryCriteria struct {
	CompetitionID int
	EventID       int
	FederationID  int
	DivisionID    int
	AgeID         int
	ProficiencyID int
	StyleID       int
	AthleteID     int // if AthleteID is provided, the search will look for all the event that the athlete's partnership participates
	PartnershipID int
}

type SearchEventCriteria

type SearchEventCriteria struct {
	EventID       int `schema:"id"`
	CompetitionID int `schema:"competitionId,required"`
	CategoryID    int `schema:"category"`
	FederationID  int `schema:"federationId"`
	DivisionID    int `schema:"divisionId"`
	AgeID         int `schema:"ageId"`
	ProficiencyID int `schema:"proficiencyId"`
	StyleID       int `schema:"styleId"`
	StatusID      int `schema:"status"`
	OrganizerID   int `schema:"organizerID"`
}

SearchEventCriteria specifies the parameters that can be used to search events

type SearchEventDanceCriteria

type SearchEventDanceCriteria struct {
	EventDanceID  int
	CompetitionID int
	EventID       int
}

type SearchFederationCriteria

type SearchFederationCriteria struct {
	ID        int    `schema:"id"`
	Name      string `schema:"name"`
	CountryID int    `schema:"country"`
}

type SearchNotificationCriteria

type SearchNotificationCriteria struct {
	AccountID              int
	NotificationCategoryID int
}

SearchNotificationCriteria specifies the parameters that can be used to search notifications in a rep

type SearchNotificationPreferenceCriteria

type SearchNotificationPreferenceCriteria struct {
	AccountID int
}

SearchNotificationPreferenceCriteria specifies the parameters that can be used to search notification preferences in a repo

type SearchOrganizerProfileCriteria

type SearchOrganizerProfileCriteria struct{}

type SearchOrganizerProvisionCriteria

type SearchOrganizerProvisionCriteria struct {
	ID           int    `schema:"id"`
	OrganizerID  int    `schema:"organizerID"`  // organizer's account ID, not type-account id
	OrganizerUID string `schema:"organizerUID"` // Organizer's UID,
}

SearchOrganizerProvisionCriteria specifies the search criteria of Organizer's provision information

type SearchOrganizerProvisionHistoryCriteria

type SearchOrganizerProvisionHistoryCriteria struct {
	OrganizerID int
}

type SearchPartnershipCompetitionEntryCriteria

type SearchPartnershipCompetitionEntryCriteria struct {
	ID            int `schema:"id"`
	PartnershipID int `schema:"partnership"`
	CompetitionID int `schema:"competition"`
}

SearchPartnershipCompetitionEntryCriteria specifies parameters that can be used to search the Competition Entry of a Partnership

type SearchPartnershipCriteria

type SearchPartnershipCriteria struct {
	PartnershipID int `schema:"id"`
	LeadID        int `schema:"lead"`
	FollowID      int `schema:"follow"`
	AccountID     int
}

SearchPartnershipCriteria provides the parameters that an IPartnershipRepository can use to search by

type SearchPartnershipEventEntryCriteria

type SearchPartnershipEventEntryCriteria struct {
	CompetitionID int
	AthleteID     int
	PartnershipID int
	EventID       int
}

SearchPartnershipEventEntryCriteria specifies the parameters that can be used to search the Event Entry of a PartnershipID

type SearchPartnershipRequestBlacklistCriteria

type SearchPartnershipRequestBlacklistCriteria struct {
	ReporterID    int
	BlockedUserID int
	Whitelisted   bool
	ReasonID      int
}

type SearchPartnershipRequestCriteria

type SearchPartnershipRequestCriteria struct {
	RequestID       int `schema:"id"`
	Type            int `schema:"typeId"`
	Sender          int `schema:"sender"`
	Recipient       int `schema:"recipient"`
	RequestStatusID int `schema:"statusId"`
}

SearchPartnershipRequestCriteria defines the parameters that can be used to search particular partnership requests

type SearchPartnershipRoundEntryCriteria

type SearchPartnershipRoundEntryCriteria struct {
	ID            int `schema:"entry"`
	RoundID       int `schema:"round"`
	PartnershipID int `schema:"partnership"`
	EventID       int `schema:"eventdal"`
}

SearchPartnershipRoundEntryCriteria specifies the parameters that can be used to search the Round Entry of Partnership

type SearchPlacementCriteria

type SearchPlacementCriteria struct {
	CompetitionID int
	EventID       int
	PartnershipID int
}

SearchPlacementCriteria specifies the parameters that can be used to search Placement in a repository

type SearchProficiencyCriteria

type SearchProficiencyCriteria struct {
	ProficiencyID int    `schema:"id"`
	DivisionID    int    `schema:"division"`
	Name          string `schema:"name"`
}

type SearchRoleApplicationCriteria

type SearchRoleApplicationCriteria struct {
	ID             int
	AccountID      int
	AppliedRoleID  int
	StatusID       int
	ApprovalUserID int
	Responded      bool
}

SearchRoleApplicationCriteria specifies the search criteria for role application

type SearchRoundCriteria

type SearchRoundCriteria struct {
	CompetitionID int
	EventID       int
	RoundOrderID  int
}

SearchRoundCriteria specifies the parameters that can be used to search Rounds in a Repository

type SearchSchoolCriteria

type SearchSchoolCriteria struct {
	ID      int    `schema:"id"`
	Name    string `schema:"name"`
	CityID  int    `schema:"city"`
	StateID int    `schema:"state"`
}

type SearchScrutineerProfileCriteria

type SearchScrutineerProfileCriteria struct{}

type SearchStateCriteria

type SearchStateCriteria struct {
	StateID   int    `schema:"id"`
	Name      string `schema:"name"`
	CountryID int    `schema:"country"`
}

SearchStateCriteria defines the criteria that states can be searched by

type SearchStudioCriteria

type SearchStudioCriteria struct {
	ID        int    `schema:"id"`
	Name      string `schema:"name"`
	CityID    int    `schema:"city"`
	StateID   int    `schema:"state"`
	CountryID int    `schema:"country"`
}

type SearchStyleCriteria

type SearchStyleCriteria struct {
	StyleID int    `schema:"id"`
	Name    string `schema:"name"`
}

type SearchUserPreferenceCriteria

type SearchUserPreferenceCriteria struct {
	AccountID int
}

type State

type State struct {
	ID              int
	Name            string
	Abbreviation    string
	CountryID       int
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

State defines the state/province of a country

func (State) GetCities

func (state State) GetCities(repo ICityRepository) ([]City, error)

type Studio

type Studio struct {
	ID              int
	Name            string
	Address         string
	CityID          int
	Website         string
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

type Style

type Style struct {
	ID              int
	Name            string
	Description     string
	CreateUserID    *int
	DateTimeCreated time.Time
	UpdateUserID    *int
	DateTimeUpdated time.Time
}

type UpdateOrganizerProvision

type UpdateOrganizerProvision struct {
	OrganizerID   int
	Amount        int
	Note          string
	CurrentUserID int
}

type UserPreference

type UserPreference struct {
	ID              int
	AccountID       int
	DefaultRole     int
	CreateUserID    int
	DateTimeCreated time.Time
	UpdateUserID    int
	DateTimeUpdated time.Time
}

UserPreference stores the basic preferences of user

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL