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 ​
| Parameter | Type | Description |
|---|---|---|
userId | number | The User to test |
pointOfSale | PointOfSale | The Point of Sale to view |
Returns ​
Promise<boolean>
createPointOfSale() ​
ts
static createPointOfSale(posRequest): Promise<PointOfSaleRevision>;Creates a new PointOfSale
Parameters ​
| Parameter | Type | Description |
|---|---|---|
posRequest | CreatePointOfSaleParams | The POS to be created. |
Returns ​
Promise<PointOfSaleRevision>
deletePointOfSale() ​
ts
static deletePointOfSale(pointOfSaleId): Promise<void>;(Soft) delete a point of sale
Parameters ​
| Parameter | Type | Description |
|---|---|---|
pointOfSaleId | number | - |
Returns ​
Promise<void>
getOptions() ​
ts
static getOptions(params, user?): Promise<FindManyOptions<PointOfSaleRevision>>;Parameters ​
| Parameter | Type |
|---|---|
params | PointOfSaleParameters |
user? | User |
Returns ​
Promise<FindManyOptions<PointOfSaleRevision>>
getPointsOfSale() ​
ts
static getPointsOfSale(
filters?,
pagination?,
user?): Promise<[PointOfSaleRevision[], number]>;Query to return current point of sales.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
filters | PointOfSaleParameters | Parameters to query the point of sales with. |
pagination | PaginationParameters | - |
user? | User | - |
Returns ​
Promise<[PointOfSaleRevision[], number]>
revisionSubQuery() ​
ts
static revisionSubQuery(revision?): string;Raw sql to deal with current revision.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
revision? | number | - |
Returns ​
string
revisionToBaseResponse() ​
ts
static revisionToBaseResponse(revision): BasePointOfSaleResponse;Parameters ​
| Parameter | Type |
|---|---|
revision | PointOfSaleRevision |
Returns ​
toBaseInfoResponse() ​
ts
static toBaseInfoResponse(pos): BasePointOfSaleInfoResponse;Parameters ​
| Parameter | Type |
|---|---|
pos | PointOfSale |
Returns ​
updatePointOfSale() ​
ts
static updatePointOfSale(update): Promise<PointOfSaleRevision>;Updates a PointOfSale
Parameters ​
| Parameter | Type | Description |
|---|---|---|
update | UpdatePointOfSaleParams | The update to apply |
Returns ​
Promise<PointOfSaleRevision>