HitService
Source: HitService.js:21
Service for managing Hit entities and their associations. Handles CRUD operations and member associations for Hits.
Constructor
new HitService(): HitServiceInstance Methods
getAll(
name: string,
count: number,
ChoreoId: UUID,
memberIds?: Array.<string>,
actingUserId: UUID,
): Promise.<Hit>
Find or create a Hit by name, count, and choreography, and associate members.
Parameters
name(string) — The Hit's name.count(number) — The count value.ChoreoId(UUID) — The choreography ID.memberIds(Array.<string>, optional, default: "[]") — Array of member IDs.actingUserId(UUID) — The acting user's UUID.
Returns
Promise.<Hit>— The found or created Hit.
findById(id: UUID, actingUserId: UUID): Promise.<(Hit|null)>
Find a Hit by its ID and user, including all associations.
Parameters
Returns
Promise.<(Hit|null)>— The found Hit or null.
findByName(
name: string,
ownerIds: Array.<UUID>,
actingUserId: UUID,
): Promise.<Array.<Hit>>
Find all Hits by name for a user, including all associations.
Parameters
name(string) — The Hit's name.ownerIds(Array.<UUID>) — Array of owner IDs the acting user has access to.actingUserId(UUID) — The acting user's UUID.
Returns
Promise.<Array.<Hit>>— List of matching Hits.
create(
name: string,
count: number,
ChoreoId: UUID,
memberIds?: Array.<string>,
ownerId: UUID,
actingUserId: UUID,
): Promise.<Hit>
Create a new Hit and associate members if provided.
Parameters
name(string) — The Hit's name.count(number) — The count value.ChoreoId(UUID) — The choreography ID.memberIds(Array.<string>, optional, default: "[]") — Array of member IDs.ownerId(UUID) — The owner's UUID.actingUserId(UUID) — The acting user's UUID.
Returns
Promise.<Hit>— The created Hit with members.
findOrCreate(
name: string,
count: number,
ChoreoId: UUID,
memberIds?: Array.<string>,
ownerId: UUID,
actingUserId: UUID,
): Promise.<Hit>
Find or create a Hit by name, count, and choreography, and associate members.
Parameters
name(string) — The Hit's name.count(number) — The count value.ChoreoId(UUID) — The choreography ID.memberIds(Array.<string>, optional, default: "[]") — Array of member IDs.ownerId(UUID) — The owner's UUID.actingUserId(UUID) — The acting user's UUID.
Returns
Promise.<Hit>— The found or created Hit.
update(
id: UUID,
data: Object,
actingUserId: UUID,
): Promise.<Hit>
Update a hit.
Parameters
id(UUID) — The Hit's ID.data(Object) — The update data.actingUserId(UUID) — The acting user's UUID.
Returns
Promise.<Hit>— The updated Hit.
remove(id: UUID, actingUserId: UUID): Promise.<void>
Remove a Hit by ID.
Parameters
Returns
Promise.<void>— Resolves when the Hit is removed.
mcpCreate()
MCP-optimized: Create a single hit with lightweight access checks. Avoids loading the full choreography object graph.
mcpBulkCreate()
MCP-optimized: Bulk create hits with lightweight access checks. Avoids loading the full choreography object graph.