mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
feat(BE): finance (payment, initial_balance, injection). fix(BE): kandang capacity
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package payments
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/go-playground/validator/v10"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
commonRepo "gitlab.com/mbugroup/lti-api.git/internal/common/repository"
|
||||
commonSvc "gitlab.com/mbugroup/lti-api.git/internal/common/service"
|
||||
"gorm.io/gorm"
|
||||
|
||||
rPayment "gitlab.com/mbugroup/lti-api.git/internal/modules/finance/payments/repositories"
|
||||
sPayment "gitlab.com/mbugroup/lti-api.git/internal/modules/finance/payments/services"
|
||||
utils "gitlab.com/mbugroup/lti-api.git/internal/utils"
|
||||
|
||||
rUser "gitlab.com/mbugroup/lti-api.git/internal/modules/users/repositories"
|
||||
sUser "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"
|
||||
)
|
||||
|
||||
type PaymentModule struct{}
|
||||
|
||||
func (PaymentModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
|
||||
paymentRepo := rPayment.NewPaymentRepository(db)
|
||||
userRepo := rUser.NewUserRepository(db)
|
||||
|
||||
approvalRepo := commonRepo.NewApprovalRepository(db)
|
||||
approvalService := commonSvc.NewApprovalService(approvalRepo)
|
||||
if err := approvalService.RegisterWorkflowSteps(utils.ApprovalWorkflowPayment, utils.PaymentApprovalSteps); err != nil {
|
||||
panic(fmt.Sprintf("failed to register payment approval workflow: %v", err))
|
||||
}
|
||||
|
||||
paymentService := sPayment.NewPaymentService(paymentRepo, approvalService, validate)
|
||||
userService := sUser.NewUserService(userRepo, validate)
|
||||
|
||||
PaymentRoutes(router, userService, paymentService)
|
||||
}
|
||||
Reference in New Issue
Block a user