Skip to content

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 ​

ts
new WriteOffController(options): WriteOffController;

Parameters ​

ParameterType
optionsBaseControllerOptions

Returns ​

WriteOffController

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 ​

createWriteOff() ​

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

POST /writeoffs

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - The created write off.

Operation Id ​

createWriteOff

Tags ​

writeoffs - Operations of the writeoff 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


getSingleWriteOff() ​

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

GET /writeoffs/

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - Single write off with given id

Operation Id ​

getSingleWriteOff

Tags ​

writeoffs - Operations of the writeoff controller

Security ​

JWT


getWriteOffPdf() ​

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

GET /writeoffs/{id}/pdf

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - The pdf location information.

Operation Id ​

getWriteOffPdf

Tags ​

writeoffs - Operations of the writeoff controller

Security ​

JWT


returnAllWriteOffs() ​

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

GET /writeoffs

Parameters ​

ParameterType
reqRequestWithToken
resResponse

Returns ​

Promise<void>

200 - All existing write-offs

Operation Id ​

getAllWriteOffs

Tags ​

writeoffs - Operations of the writeoffs controller

Security ​

JWT