InvoicesController.ts 769 B

1234567891011121314151617
  1. import { Request, Response } from 'express'
  2. import { BaseHttpController, controller, httpPost } from 'inversify-express-utils'
  3. import { inject } from 'inversify'
  4. import { TYPES } from '../../Bootstrap/Types'
  5. import { ServiceProxyInterface } from '../../Service/Http/ServiceProxyInterface'
  6. @controller('/v1')
  7. export class InvoicesController extends BaseHttpController {
  8. constructor(@inject(TYPES.ApiGateway_ServiceProxy) private httpService: ServiceProxyInterface) {
  9. super()
  10. }
  11. @httpPost('/invoices/send-latest', TYPES.ApiGateway_SubscriptionTokenAuthMiddleware)
  12. async sendLatestInvoice(request: Request, response: Response): Promise<void> {
  13. await this.httpService.callPaymentsServer(request, response, 'api/pro_users/send-invoice', request.body)
  14. }
  15. }