AdministratorService
AdministratorService
Contains methods relating to Administrator entities.
Signature
class AdministratorService {
constructor(connection: TransactionalConnection, configService: ConfigService, listQueryBuilder: ListQueryBuilder, passwordCipher: PasswordCipher, userService: UserService, roleService: RoleService, customFieldRelationService: CustomFieldRelationService, eventBus: EventBus, requestContextService: RequestContextService)
findAll(ctx: RequestContext, options?: ListQueryOptions<Administrator>, relations?: RelationPaths<Administrator>) => Promise<PaginatedList<Administrator>>;
findOne(ctx: RequestContext, administratorId: ID, relations?: RelationPaths<Administrator>) => Promise<Administrator | undefined>;
findOneByUserId(ctx: RequestContext, userId: ID, relations?: RelationPaths<Administrator>) => Promise<Administrator | undefined>;
create(ctx: RequestContext, input: CreateAdministratorInput) => Promise<Administrator>;
update(ctx: RequestContext, input: UpdateAdministratorInput) => Promise<Administrator>;
assignRole(ctx: RequestContext, administratorId: ID, roleId: ID) => Promise<Administrator>;
softDelete(ctx: RequestContext, id: ID) => ;
}
constructor
method
(connection: TransactionalConnection, configService: ConfigService, listQueryBuilder: ListQueryBuilder, passwordCipher: PasswordCipher, userService: UserService, roleService: RoleService, customFieldRelationService: CustomFieldRelationService, eventBus: EventBus, requestContextService: RequestContextService) => AdministratorService
findAll
method
(ctx: RequestContext, options?: ListQueryOptions<Administrator>, relations?: RelationPaths<Administrator>) => Promise<PaginatedList<Administrator>>
Get a paginated list of Administrators.
findOne
method
(ctx: RequestContext, administratorId: ID, relations?: RelationPaths<Administrator>) => Promise<Administrator | undefined>
Get an Administrator by id.
findOneByUserId
method
(ctx: RequestContext, userId: ID, relations?: RelationPaths<Administrator>) => Promise<Administrator | undefined>
Get an Administrator based on the User id.
create
method
(ctx: RequestContext, input: CreateAdministratorInput) => Promise<Administrator>
Create a new Administrator.
update
method
(ctx: RequestContext, input: UpdateAdministratorInput) => Promise<Administrator>
Update an existing Administrator.
assignRole
method
(ctx: RequestContext, administratorId: ID, roleId: ID) => Promise<Administrator>
Assigns a Role to the Administrator's User entity.
softDelete
method
(ctx: RequestContext, id: ID) =>
Soft deletes an Administrator (sets the deletedAt
field).