PositionService

Source: PositionService.ts:3

Service for managing positions in a lineup.


Constructor

new PositionService(): PositionService

Instance Methods

create( lineupId: string, x: number, y: number, MemberId: string, timeOfManualUpdate: string, ): Promise.<Object>

Create a new position in a lineup.

Parameters

  • lineupId (string) — ID of the lineup
  • x (number) — X coordinate of the position
  • y (number) — Y coordinate of the position
  • MemberId (string) — ID of the member for this position
  • timeOfManualUpdate (string) — manually specified time of update

Returns

  • Promise.<Object> — Created position

getByLineupId(lineupId: string): Promise.<Array>

Get all positions for a lineup.

Parameters

  • lineupId (string) — ID of the lineup

Returns

  • Promise.<Array> — Array of position objects

update( lineupId: string, positionId: string, x: number, y: number, {timeOfManualUpdate}: string, ): Promise.<Object>

Update a position in a lineup.

Parameters

  • lineupId (string) — ID of the lineup
  • positionId (string) — ID of the position to update
  • x (number) — X coordinate of the position
  • y (number) — Y coordinate of the position
  • {timeOfManualUpdate} (string) — manually specified time of update

Returns

  • Promise.<Object> — Updated position

remove(positionId: string): Promise.<Object>

Remove a position by its ID.

Parameters

  • positionId (string) — ID of the position to remove

Returns

  • Promise.<Object> — Response data