feat: payment receive of customers invoices.

This commit is contained in:
Ahmed Bouhuolia
2020-11-02 21:42:40 +02:00
parent 731b8fd119
commit e6cd921b94
24 changed files with 911 additions and 645 deletions

View File

@@ -34,8 +34,9 @@ export default class PaymentReceivesController extends BaseController {
this.handleServiceErrors,
);
router.post(
'/',
this.newPaymentReceiveValidation,
'/', [
...this.newPaymentReceiveValidation,
],
this.validationResult,
asyncMiddleware(this.newPaymentReceive.bind(this)),
this.handleServiceErrors,
@@ -87,6 +88,7 @@ export default class PaymentReceivesController extends BaseController {
check('entries').isArray({ min: 1 }),
check('entries.*.id').optional({ nullable: true }).isNumeric().toInt(),
check('entries.*.invoice_id').exists().isNumeric().toInt(),
check('entries.*.payment_amount').exists().isNumeric().toInt(),
];