Skip to content

Commit 03afc5d

Browse files
committed
feat(api): add generation invoice PDF documents api
1 parent 6e52381 commit 03afc5d

12 files changed

+885
-56
lines changed

error.log

Lines changed: 237 additions & 0 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 586 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
1.32 KB
Binary file not shown.
1.39 KB
Binary file not shown.
1.36 KB
Binary file not shown.
21.9 KB
Loading
46.2 KB
Loading
1.43 KB
Loading

src/controllers/order.controller.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NextFunction, Response } from 'express';
22

33
import { AuthenticatedRequestBody, IUser } from '@src/interfaces';
4-
import { clearOrdersService, getOrdersService, postOrderService } from '@src/services';
4+
import { clearOrdersService, getInvoicesService, getOrdersService, postOrderService } from '@src/services';
55

66
export const getOrdersController = (req: AuthenticatedRequestBody<IUser>, res: Response, next: NextFunction) =>
77
getOrdersService(req, res, next);
@@ -11,3 +11,6 @@ export const postOrderController = (req: AuthenticatedRequestBody<IUser>, res: R
1111

1212
export const clearOrdersController = (req: AuthenticatedRequestBody<IUser>, res: Response, next: NextFunction) =>
1313
clearOrdersService(req, res, next);
14+
15+
export const getInvoicesController = (req: AuthenticatedRequestBody<IUser>, res: Response, next: NextFunction) =>
16+
getInvoicesService(req, res, next);

src/routes/order.route.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import express from 'express';
22

33
import { isAuth } from '@src/middlewares';
4-
import { clearOrdersController, getOrdersController, postOrderController } from '@src/controllers/order.controller';
4+
import {
5+
clearOrdersController,
6+
getInvoicesController,
7+
getOrdersController,
8+
postOrderController,
9+
} from '@src/controllers/order.controller';
510

611
const router = express.Router();
712

813
router.get('/', isAuth, getOrdersController);
914
router.post('/', isAuth, postOrderController);
1015
router.delete('/clear-orders', isAuth, clearOrdersController);
16+
router.get('/invoices/:orderId', isAuth, getInvoicesController);
17+
1118
export = router;

0 commit comments

Comments
 (0)