Skip to content

SudoSOS Back-end API / catalogue/point-of-sale / PointOfSaleService

Class: PointOfSaleService ​

Constructors ​

Constructor ​

ts
new PointOfSaleService(): PointOfSaleService;

Returns ​

PointOfSaleService

Methods ​

canViewPointOfSale() ​

ts
static canViewPointOfSale(userId, pointOfSale): Promise<boolean>;

Test to see if the user can view a specified Point of Sale

Parameters ​

ParameterTypeDescription
userIdnumberThe User to test
pointOfSalePointOfSaleThe Point of Sale to view

Returns ​

Promise<boolean>


createPointOfSale() ​

ts
static createPointOfSale(posRequest): Promise<PointOfSaleRevision>;

Creates a new PointOfSale

Parameters ​

ParameterTypeDescription
posRequestCreatePointOfSaleParamsThe POS to be created.

Returns ​

Promise<PointOfSaleRevision>


deletePointOfSale() ​

ts
static deletePointOfSale(pointOfSaleId): Promise<void>;

(Soft) delete a point of sale

Parameters ​

ParameterTypeDescription
pointOfSaleIdnumber-

Returns ​

Promise<void>


getOptions() ​

ts
static getOptions(params, user?): Promise<FindManyOptions<PointOfSaleRevision>>;

Parameters ​

ParameterType
paramsPointOfSaleParameters
user?User

Returns ​

Promise<FindManyOptions<PointOfSaleRevision>>


getPointsOfSale() ​

ts
static getPointsOfSale(
   filters?, 
   pagination?, 
user?): Promise<[PointOfSaleRevision[], number]>;

Query to return current point of sales.

Parameters ​

ParameterTypeDescription
filtersPointOfSaleParametersParameters to query the point of sales with.
paginationPaginationParameters-
user?User-

Returns ​

Promise<[PointOfSaleRevision[], number]>


revisionSubQuery() ​

ts
static revisionSubQuery(revision?): string;

Raw sql to deal with current revision.

Parameters ​

ParameterTypeDescription
revision?number-

Returns ​

string


revisionToBaseResponse() ​

ts
static revisionToBaseResponse(revision): BasePointOfSaleResponse;

Parameters ​

ParameterType
revisionPointOfSaleRevision

Returns ​

BasePointOfSaleResponse


toBaseInfoResponse() ​

ts
static toBaseInfoResponse(pos): BasePointOfSaleInfoResponse;

Parameters ​

ParameterType
posPointOfSale

Returns ​

BasePointOfSaleInfoResponse


updatePointOfSale() ​

ts
static updatePointOfSale(update): Promise<PointOfSaleRevision>;

Updates a PointOfSale

Parameters ​

ParameterTypeDescription
updateUpdatePointOfSaleParamsThe update to apply

Returns ​

Promise<PointOfSaleRevision>