🚨 Announcement: A New Chapter for Vendure read more

ProductOptionGroupService

ProductOptionGroupService

Contains methods relating to ProductOptionGroup entities.

Signature

class ProductOptionGroupService {
  constructor(connection: TransactionalConnection, translatableSaver: TranslatableSaver, customFieldRelationService: CustomFieldRelationService, productOptionService: ProductOptionService, eventBus: EventBus, translator: TranslatorService)
  findAll(ctx: RequestContext, filterTerm?: string, relations?: RelationPaths<ProductOptionGroup>) => Promise<Array<Translated<ProductOptionGroup>>>;
  findOne(ctx: RequestContext, id: ID, relations?: RelationPaths<ProductOptionGroup>) => Promise<Translated<ProductOptionGroup> | undefined>;
  getOptionGroupsByProductId(ctx: RequestContext, id: ID) => Promise<Array<Translated<ProductOptionGroup>>>;
  async create(ctx: RequestContext, input: CreateProductOptionGroupInput) => Promise<Translated<ProductOptionGroup>>;
  async update(ctx: RequestContext, input: UpdateProductOptionGroupInput) => Promise<Translated<ProductOptionGroup>>;
  async deleteGroupAndOptionsFromProduct(ctx: RequestContext, id: ID, productId: ID) => ;
}

Members

constructor

method
type:
(connection: TransactionalConnection, translatableSaver: TranslatableSaver, customFieldRelationService: CustomFieldRelationService, productOptionService: ProductOptionService, eventBus: EventBus, translator: TranslatorService) => ProductOptionGroupService

findAll

method
type:
(ctx: RequestContext, filterTerm?: string, relations?: RelationPaths<ProductOptionGroup>) => Promise<Array<Translated<ProductOptionGroup>>>

findOne

method
type:
(ctx: RequestContext, id: ID, relations?: RelationPaths<ProductOptionGroup>) => Promise<Translated<ProductOptionGroup> | undefined>

getOptionGroupsByProductId

method
type:
(ctx: RequestContext, id: ID) => Promise<Array<Translated<ProductOptionGroup>>>

create

async method
type:
(ctx: RequestContext, input: CreateProductOptionGroupInput) => Promise<Translated<ProductOptionGroup>>

update

async method
type:
(ctx: RequestContext, input: UpdateProductOptionGroupInput) => Promise<Translated<ProductOptionGroup>>

deleteGroupAndOptionsFromProduct

async method
type:
(ctx: RequestContext, id: ID, productId: ID) =>
Deletes the ProductOptionGroup and any associated ProductOptions. If the ProductOptionGroup is still referenced by a soft-deleted Product, then a soft-delete will be used to preserve referential integrity. Otherwise a hard-delete will be performed.