Skip to content

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

Class: PointOfSaleController ​

The BaseController class is responsible for:

  • Storing route definitions.
  • Generating router objects based on the policy.

Extends ​

Constructors ​

Constructor ​

ts
new PointOfSaleController(options): PointOfSaleController;

Creates a new point of sale controller instance.

Parameters ​

ParameterTypeDescription
optionsBaseControllerOptionsThe options passed to the base controller.

Returns ​

PointOfSaleController

Overrides ​

BaseController.constructor

Properties ​

PropertyModifierTypeDescriptionInherited from
roleManagerprotectedRoleManagerA reference to the role manager passed in the base controller options.BaseController.roleManager
specificationpublicSwaggerSpecificationA reference to the swagger specification passed in the base controller options.BaseController.specification

Methods ​

createPointOfSale() ​

ts
createPointOfSale(req, res): Promise<void>;

POST /pointsofsale

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - The created point of sale entity

Operation Id ​

createPointOfSale

Tags ​

pointofsale - Operations of the point of sale controller

Security ​

JWT


deletePointOfSale() ​

ts
deletePointOfSale(req, res): Promise<void>;

DELETE /pointsofsale/

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

204 - Success

Operation Id ​

deletePointOfSale

Tags ​

pointofsale - Operations of point of sale controller

Security ​

JWT


getPolicy() ​

ts
getPolicy(): Policy;

Gets the policy defined by child classes. This policy includes all routes that the controller accepts, the authorization middleware, and the final handler function for every route.

Returns ​

Policy

The policy of this controller.

Overrides ​

BaseController.getPolicy


getRouter() ​

ts
getRouter(): Router;

Returns ​

Router

the router used by this controller.

Inherited from ​

BaseController.getRouter


returnAllPointOfSaleContainers() ​

ts
returnAllPointOfSaleContainers(req, res): Promise<void>;

GET /pointsofsale/{id}/containers

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - All containers of the requested Point of Sale

Operation Id ​

getAllPointOfSaleContainers

Tags ​

pointofsale - Operations of the point of sale controller

Security ​

JWT


returnAllPointOfSaleProducts() ​

ts
returnAllPointOfSaleProducts(req, res): Promise<void>;

GET /pointsofsale/{id}/products

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - All products of the requested Point of Sale

Operation Id ​

getAllPointOfSaleProducts

Tags ​

pointofsale - Operations of the point of sale controller

Security ​

JWT


returnAllPointsOfSale() ​

ts
returnAllPointsOfSale(req, res): Promise<void>;

GET /pointsofsale

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - All existing point of sales

Operation Id ​

getAllPointsOfSale

Tags ​

pointofsale - Operations of the point of sale controller

Security ​

JWT


returnPointOfSaleAssociates() ​

ts
returnPointOfSaleAssociates(req, res): Promise<void>;

GET /pointsofsale/{id}/associates

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - The requested Point of Sale transactions

Operation Id ​

getPointOfSaleAssociates

Tags ​

pointofsale - Operations of the point of sale controller

Security ​

JWT


returnPointOfSaleTransactions() ​

ts
returnPointOfSaleTransactions(req, res): Promise<void>;

GET /pointsofsale/{id}/transactions

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - The requested Point of Sale transactions

Operation Id ​

getTransactions

Tags ​

pointofsale - Operations of the point of sale controller

Security ​

JWT


returnSinglePointOfSale() ​

ts
returnSinglePointOfSale(req, res): Promise<void>;

GET /pointsofsale/

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - The requested point of sale entity

Operation Id ​

getSinglePointOfSale

Tags ​

pointofsale - Operations of the point of sale controller

Security ​

JWT


returnSinglePointOfSaleRevision() ​

ts
returnSinglePointOfSaleRevision(req, res): Promise<void>;

GET /pointsofsale/{id}/

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - The requested point of sale revision

Operation Id ​

getSinglePointOfSaleRevision

Tags ​

pointofsale - Operations of the point of sale controller

Security ​

JWT


updatePointOfSale() ​

ts
updatePointOfSale(req, res): Promise<void>;

PATCH /pointsofsale/

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - The updated Point of Sale entity

Operation Id ​

updatePointOfSale

Tags ​

pointofsale - Operations of the point of sale controller

Security ​

JWT


getRelation() ​

ts
static getRelation(req): Promise<string>;

Function to determine which credentials are needed to get POS 'all' if user is not connected to POS 'organ' if user is connected to POS via organ 'own' if user is connected to POS

Parameters ​

ParameterTypeDescription
reqRequestWithToken-

Returns ​

Promise<string>

whether POS is connected to used token


postRelation() ​

ts
static postRelation(req): string;

Function to determine which credentials are needed to post POS 'all' if user is not connected to POS 'organ' if user is connected to POS via organ 'own' if user is connected to POS

Parameters ​

ParameterTypeDescription
reqRequestWithTokenRequest with CreatePointOfSaleRequest as body

Returns ​

string

whether POS is connected to user token