ZoneService

ZoneService

Contains methods relating to Zone entities.

Signature

class ZoneService {
  constructor(connection: TransactionalConnection, configService: ConfigService, eventBus: EventBus, translator: TranslatorService, listQueryBuilder: ListQueryBuilder)
  async findAll(ctx: RequestContext, options?: ListQueryOptions<Zone>) => Promise<PaginatedList<Zone>>;
  findOne(ctx: RequestContext, zoneId: ID) => Promise<Zone | undefined>;
  async getAllWithMembers(ctx: RequestContext) => Promise<Zone[]>;
  async create(ctx: RequestContext, input: CreateZoneInput) => Promise<Zone>;
  async update(ctx: RequestContext, input: UpdateZoneInput) => Promise<Zone>;
  async delete(ctx: RequestContext, id: ID) => Promise<DeletionResponse>;
  async addMembersToZone(ctx: RequestContext, { memberIds, zoneId }: MutationAddMembersToZoneArgs) => Promise<Zone>;
  async removeMembersFromZone(ctx: RequestContext, { memberIds, zoneId }: MutationRemoveMembersFromZoneArgs) => Promise<Zone>;
}

Members

constructor

method
type:
(connection: TransactionalConnection, configService: ConfigService, eventBus: EventBus, translator: TranslatorService, listQueryBuilder: ListQueryBuilder) => ZoneService

findAll

method
type:
(ctx: RequestContext, options?: ListQueryOptions<Zone>) => Promise<PaginatedList<Zone>>

findOne

method
type:
(ctx: RequestContext, zoneId: ID) => Promise<Zone | undefined>

getAllWithMembers

method
type:
(ctx: RequestContext) => Promise<Zone[]>

create

method
type:
(ctx: RequestContext, input: CreateZoneInput) => Promise<Zone>

update

method
type:
(ctx: RequestContext, input: UpdateZoneInput) => Promise<Zone>

delete

method
type:
(ctx: RequestContext, id: ID) => Promise<DeletionResponse>

addMembersToZone

method
type:
(ctx: RequestContext, { memberIds, zoneId }: MutationAddMembersToZoneArgs) => Promise<Zone>

removeMembersFromZone

method
type:
(ctx: RequestContext, { memberIds, zoneId }: MutationRemoveMembersFromZoneArgs) => Promise<Zone>