ChoreoService

Source: ChoreoService.ts:4

Service for managing choreographies, participants, and positions.


Constructor

new ChoreoService(): ChoreoService

Instance Methods

getByTeam(teamId: string): Promise.<Array>

Get all choreographies for a team.

Parameters

  • teamId (string) — ID of the team

Returns

  • Promise.<Array> — Array of choreographies

getById(choreoId: string): Promise.<Object>

Get a choreography by its ID.

Parameters

  • choreoId (string) — ID of the choreography

Returns

  • Promise.<Object> — Choreography object

changeName(choreoId: string, name: string): Promise.<Object>

Change the name of a choreography.

Parameters

  • choreoId (string) — ID of the choreography
  • name (string) — New name for the choreography

Returns

  • Promise.<Object> — Updated choreography

changeLength(choreoId: string, counts: number): Promise.<Object>

Change the length (counts) of a choreography.

Parameters

  • choreoId (string) — ID of the choreography
  • counts (number) — New length in counts

Returns

  • Promise.<Object> — Updated choreography

changeMatType( choreoId: string, matType: string, ): Promise.<Object>

Change the mat type of a choreography.

Parameters

  • choreoId (string) — ID of the choreography
  • matType (string) — New mat type

Returns

  • Promise.<Object> — Updated choreography

addParticipant( choreoId: string, MemberId: string, color: string, ): Promise.<Object>

Add a participant to a choreography.

Parameters

  • choreoId (string) — ID of the choreography
  • MemberId (string) — ID of the member to add
  • color (string) — Color for the participant

Returns

  • Promise.<Object> — Added participant

removeParticipant(choreoId: string, MemberId: string): Promise

Remove a participant from a choreography.

Parameters

  • choreoId (string) — ID of the choreography
  • MemberId (string) — ID of the member to remove

Returns

  • Promise

replaceParticipant( choreoId: string, memberToRemoveId: string, memberToAddId: string, ): Promise.<Object>

Replace a participant in a choreography.

Parameters

  • choreoId (string) — ID of the choreography
  • memberToRemoveId (string) — ID of the member to remove
  • memberToAddId (string) — ID of the member to add

Returns

  • Promise.<Object> — Updated participant list

changeParticipantColor( choreoId: string, participantId: string, color: string, ): Promise.<Object>

Change the color of a participant in a choreography.

Parameters

  • choreoId (string) — ID of the choreography
  • participantId (string) — ID of the participant
  • color (string) — New color for the participant

Returns

  • Promise.<Object> — Updated participant

create( name: string, counts: number, matType: string, seasonTeamId: string, participants: Array, ): Promise.<Object>

Create a new choreography.

Parameters

  • name (string) — Name of the choreography
  • counts (number) — Length of the choreography in counts
  • matType (string) — Mat type for the choreography
  • seasonTeamId (string) — ID of the season team
  • participants (Array) — Array of participant objects

Returns

  • Promise.<Object> — Created choreography

remove(choreoId: string): Promise

Remove a choreography by its ID.

Parameters

  • choreoId (string) — ID of the choreography to remove

Returns

  • Promise

getPositionsFromChoreoAndCount( choreo: Object, count: number, teamMembers: Array, ): Array

Get positions for all team members for a given count in a choreography.

Parameters

  • choreo (Object) — Choreography object
  • count (number) — Count for which to get positions
  • teamMembers (Array) — Array of team member objects

Returns

  • Array — Array of position objects

Instance Fields

matTypeOptions

Get mat type options for choreography creation.

Returns

  • Array — Array of mat type option objects