HistoryService

HistoryService

Contains methods relating to HistoryEntry entities. Histories are timelines of actions related to a particular Customer or Order, recording significant events such as creation, state changes, notes, etc.

Signature

class HistoryService {
  constructor(connection: TransactionalConnection, administratorService: AdministratorService, listQueryBuilder: ListQueryBuilder)
  async getHistoryForOrder(ctx: RequestContext, orderId: ID, publicOnly: boolean, options?: HistoryEntryListOptions) => Promise<PaginatedList<OrderHistoryEntry>>;
  async createHistoryEntryForOrder(args: CreateOrderHistoryEntryArgs<T>, isPublic:  = true) => Promise<OrderHistoryEntry>;
  async getHistoryForCustomer(ctx: RequestContext, customerId: ID, publicOnly: boolean, options?: HistoryEntryListOptions) => Promise<PaginatedList<CustomerHistoryEntry>>;
  async createHistoryEntryForCustomer(args: CreateCustomerHistoryEntryArgs<T>, isPublic:  = false) => Promise<CustomerHistoryEntry>;
  async updateOrderHistoryEntry(ctx: RequestContext, args: UpdateOrderHistoryEntryArgs<T>) => ;
  async deleteOrderHistoryEntry(ctx: RequestContext, id: ID) => Promise<void>;
  async updateCustomerHistoryEntry(ctx: RequestContext, args: UpdateCustomerHistoryEntryArgs<T>) => ;
  async deleteCustomerHistoryEntry(ctx: RequestContext, id: ID) => Promise<void>;
}

Members

constructor

method
type:
(connection: TransactionalConnection, administratorService: AdministratorService, listQueryBuilder: ListQueryBuilder) => HistoryService

getHistoryForOrder

async method
type:
(ctx: RequestContext, orderId: ID, publicOnly: boolean, options?: HistoryEntryListOptions) => Promise<PaginatedList<OrderHistoryEntry>>

createHistoryEntryForOrder

async method
type:
(args: CreateOrderHistoryEntryArgs<T>, isPublic: = true) => Promise<OrderHistoryEntry>

getHistoryForCustomer

async method
type:
(ctx: RequestContext, customerId: ID, publicOnly: boolean, options?: HistoryEntryListOptions) => Promise<PaginatedList<CustomerHistoryEntry>>

createHistoryEntryForCustomer

async method
type:
(args: CreateCustomerHistoryEntryArgs<T>, isPublic: = false) => Promise<CustomerHistoryEntry>

updateOrderHistoryEntry

async method
type:
(ctx: RequestContext, args: UpdateOrderHistoryEntryArgs<T>) =>

deleteOrderHistoryEntry

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

updateCustomerHistoryEntry

async method
type:
(ctx: RequestContext, args: UpdateCustomerHistoryEntryArgs<T>) =>

deleteCustomerHistoryEntry

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