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 ​
new PointOfSaleController(options): PointOfSaleController;Creates a new point of sale controller instance.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
options | BaseControllerOptions | The options passed to the base controller. |
Returns ​
PointOfSaleController
Overrides ​
Properties ​
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
roleManager | protected | RoleManager | A reference to the role manager passed in the base controller options. | BaseController.roleManager |
specification | public | SwaggerSpecification | A reference to the swagger specification passed in the base controller options. | BaseController.specification |
Methods ​
createPointOfSale() ​
createPointOfSale(req, res): Promise<void>;POST /pointsofsale
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
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() ​
deletePointOfSale(req, res): Promise<void>;DELETE /pointsofsale/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
204 - Success
Operation Id ​
deletePointOfSale
Tags ​
pointofsale - Operations of point of sale controller
Security ​
JWT
getPolicy() ​
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 ​
The policy of this controller.
Overrides ​
getRouter() ​
getRouter(): Router;Returns ​
Router
the router used by this controller.
Inherited from ​
returnAllPointOfSaleContainers() ​
returnAllPointOfSaleContainers(req, res): Promise<void>;GET /pointsofsale/{id}/containers
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
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() ​
returnAllPointOfSaleProducts(req, res): Promise<void>;GET /pointsofsale/{id}/products
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
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() ​
returnAllPointsOfSale(req, res): Promise<void>;GET /pointsofsale
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - All existing point of sales
Operation Id ​
getAllPointsOfSale
Tags ​
pointofsale - Operations of the point of sale controller
Security ​
JWT
returnPointOfSaleAssociates() ​
returnPointOfSaleAssociates(req, res): Promise<void>;GET /pointsofsale/{id}/associates
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
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() ​
returnPointOfSaleTransactions(req, res): Promise<void>;GET /pointsofsale/{id}/transactions
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
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() ​
returnSinglePointOfSale(req, res): Promise<void>;GET /pointsofsale/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
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() ​
returnSinglePointOfSaleRevision(req, res): Promise<void>;GET /pointsofsale/{id}/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
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() ​
updatePointOfSale(req, res): Promise<void>;PATCH /pointsofsale/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
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() ​
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 ​
| Parameter | Type | Description |
|---|---|---|
req | RequestWithToken | - |
Returns ​
Promise<string>
whether POS is connected to used token
postRelation() ​
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 ​
| Parameter | Type | Description |
|---|---|---|
req | RequestWithToken | Request with CreatePointOfSaleRequest as body |
Returns ​
string
whether POS is connected to user token