mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 06:45:43 +00:00
add api for update is paid to expense
This commit is contained in:
@@ -481,6 +481,27 @@ func (u *ExpenseController) CompleteExpense(c *fiber.Ctx) error {
|
||||
})
|
||||
}
|
||||
|
||||
func (u *ExpenseController) Pay(c *fiber.Ctx) error {
|
||||
expenseID := c.Params("id")
|
||||
id, err := strconv.Atoi(expenseID)
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, "Invalid expense ID")
|
||||
}
|
||||
|
||||
expense, err := u.ExpenseService.Pay(c, uint(id))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return c.Status(fiber.StatusOK).
|
||||
JSON(response.Success{
|
||||
Code: fiber.StatusOK,
|
||||
Status: "success",
|
||||
Message: "Pay expense successfully",
|
||||
Data: expense,
|
||||
})
|
||||
}
|
||||
|
||||
func ensureExpenseBulkApprovalPermission(c *fiber.Ctx, targetStep approvalutils.ApprovalStep) error {
|
||||
requiredPerms := []string{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user