SudoSOS Back-end API / invoicing / InvoiceController
Class: InvoiceController ​
The Invoice controller.
Extends ​
Constructors ​
Constructor ​
new InvoiceController(options): InvoiceController;Creates a new Invoice controller instance.
Parameters ​
| Parameter | Type | Description |
|---|---|---|
options | BaseControllerOptions | The options passed to the base controller. |
Returns ​
InvoiceController
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 ​
createInvoice() ​
createInvoice(req, res): Promise<void>;POST /invoices
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The created invoice entity
Operation Id ​
createInvoice
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
deleteInvoice() ​
deleteInvoice(req, res): Promise<void>;DELETE /invoices/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
404 - Invoice not found
Operation Id ​
deleteInvoice
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
deleteInvoiceUser() ​
deleteInvoiceUser(req, res): Promise<void>;DELETE /invoices/users/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
404 - Invoice User not found
Operation Id ​
deleteInvoiceUser
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
getAllInvoices() ​
getAllInvoices(req, res): Promise<void>;GET /invoices
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - All existing invoices
Operation Id ​
getAllInvoices
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
getEligibleTransactions() ​
getEligibleTransactions(req, res): Promise<void>;GET /invoices/eligible-transactions
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The eligible transactions
Operation Id ​
getEligibleTransactions
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
getInvoicePDF() ​
getInvoicePDF(req, res): Promise<void>;GET /invoices/{id}/pdf
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
404 - Invoice not found
Operation Id ​
getInvoicePdf
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
getPolicy() ​
getPolicy(): Policy;Returns ​
Inhertidoc ​
Overrides ​
getRouter() ​
getRouter(): Router;Returns ​
Router
the router used by this controller.
Inherited from ​
getSingleInvoice() ​
getSingleInvoice(req, res): Promise<void>;GET /invoices/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - All existing invoices
Operation Id ​
getSingleInvoice
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
getSingleInvoiceUser() ​
getSingleInvoiceUser(req, res): Promise<void>;GET /invoices/users/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
404 - Invoice User not found
Operation Id ​
getSingleInvoiceUser
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
updateInvoice() ​
updateInvoice(req, res): Promise<void>;PATCH /invoices/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
200 - The updated invoice entity
Operation Id ​
updateInvoice
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
updateInvoiceUser() ​
updateInvoiceUser(req, res): Promise<void>;PUT /invoices/users/
Parameters ​
| Parameter | Type |
|---|---|
req | RequestWithToken |
res | Response |
Returns ​
Promise<void>
404 - User not found
Operation Id ​
putInvoiceUser
Tags ​
invoices - Operations of the invoices controller
Security ​
JWT
getRelation() ​
static getRelation(req): Promise<string>;Function to determine which credentials are needed to get invoice all if user is not connected to invoice own if user is connected to invoice
Parameters ​
| Parameter | Type | Description |
|---|---|---|
req | RequestWithToken | - |
Returns ​
Promise<string>
whether invoice is connected to used token