SudoSOS Back-end API / write-offs / WriteOffController
Class: WriteOffController ​
The BaseController class is responsible for:
- Storing route definitions.
- Generating router objects based on the policy.
Extends ​
Constructors ​
Constructor ​
new WriteOffController(options): WriteOffController;Parameters ​
| Parameter | Type |
|---|---|
options | BaseControllerOptions |
Returns ​
WriteOffController
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 ​
createWriteOff() ​
createWriteOff(req, res): Promise<void>;POST /writeoffs
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The created write off.
Operation Id ​
createWriteOff
Tags ​
writeoffs - Operations of the writeoff 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 ​
getSingleWriteOff() ​
getSingleWriteOff(req, res): Promise<void>;GET /writeoffs/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - Single write off with given id
Operation Id ​
getSingleWriteOff
Tags ​
writeoffs - Operations of the writeoff controller
Security ​
JWT
getWriteOffPdf() ​
getWriteOffPdf(req, res): Promise<void>;GET /writeoffs/{id}/pdf
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The pdf location information.
Operation Id ​
getWriteOffPdf
Tags ​
writeoffs - Operations of the writeoff controller
Security ​
JWT
returnAllWriteOffs() ​
returnAllWriteOffs(req, res): Promise<void>;GET /writeoffs
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - All existing write-offs
Operation Id ​
getAllWriteOffs
Tags ​
writeoffs - Operations of the writeoffs controller
Security ​
JWT