CustomerGroupService
CustomerGroupService
Contains methods relating to CustomerGroup entities.
Signature
class CustomerGroupService {
constructor(connection: TransactionalConnection, listQueryBuilder: ListQueryBuilder, historyService: HistoryService, eventBus: EventBus, customFieldRelationService: CustomFieldRelationService)
findAll(ctx: RequestContext, options?: CustomerGroupListOptions, relations: RelationPaths<CustomerGroup> = []) => Promise<PaginatedList<CustomerGroup>>;
findOne(ctx: RequestContext, customerGroupId: ID, relations: RelationPaths<CustomerGroup> = []) => Promise<CustomerGroup | undefined>;
getGroupCustomers(ctx: RequestContext, customerGroupId: ID, options?: CustomerListOptions) => Promise<PaginatedList<Customer>>;
async create(ctx: RequestContext, input: CreateCustomerGroupInput) => Promise<CustomerGroup>;
async update(ctx: RequestContext, input: UpdateCustomerGroupInput) => Promise<CustomerGroup>;
async delete(ctx: RequestContext, id: ID) => Promise<DeletionResponse>;
async addCustomersToGroup(ctx: RequestContext, input: MutationAddCustomersToGroupArgs) => Promise<CustomerGroup>;
async removeCustomersFromGroup(ctx: RequestContext, input: MutationRemoveCustomersFromGroupArgs) => Promise<CustomerGroup>;
}
Members
constructor
method
type:
(connection: TransactionalConnection, listQueryBuilder: ListQueryBuilder, historyService: HistoryService, eventBus: EventBus, customFieldRelationService: CustomFieldRelationService) => CustomerGroupService
findAll
method
type:
(ctx: RequestContext, options?: CustomerGroupListOptions, relations: RelationPaths<CustomerGroup> = []) => Promise<PaginatedList<CustomerGroup>>
findOne
method
type:
(ctx: RequestContext, customerGroupId: ID, relations: RelationPaths<CustomerGroup> = []) => Promise<CustomerGroup | undefined>
getGroupCustomers
method
type:
(ctx: RequestContext, customerGroupId: ID, options?: CustomerListOptions) => Promise<PaginatedList<Customer>>
Returns a PaginatedList of all the Customers in the group.
create
method
type:
(ctx: RequestContext, input: CreateCustomerGroupInput) => Promise<CustomerGroup>
update
method
type:
(ctx: RequestContext, input: UpdateCustomerGroupInput) => Promise<CustomerGroup>
delete
method
type:
(ctx: RequestContext, id: ID) => Promise<DeletionResponse>
addCustomersToGroup
method
type:
(ctx: RequestContext, input: MutationAddCustomersToGroupArgs) => Promise<CustomerGroup>
removeCustomersFromGroup
method
type:
(ctx: RequestContext, input: MutationRemoveCustomersFromGroupArgs) => Promise<CustomerGroup>