mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-23 14:55:42 +00:00
8ad11af9c9
- Updated ClosingRoutes to include ClosingKeuanganService. - Removed GetClosingKeuangan method from ClosingService interface and its implementation. - Introduced new ClosingKeuanganService with GetClosingKeuangan method to handle financial logic. - Implemented detailed logging and error handling in the new service. - Added GetTotalWeightProducedFromUniformityByProjectFlockID method in RecordingRepository to support weight calculations. - Enhanced the logic for fetching and classifying product usage data by flags. - Built comprehensive DTO responses for HPP and Profit Loss sections.
39 lines
2.3 KiB
Go
39 lines
2.3 KiB
Go
package closings
|
|
|
|
import (
|
|
m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
|
|
controller "gitlab.com/mbugroup/lti-api.git/internal/modules/closings/controllers"
|
|
closing "gitlab.com/mbugroup/lti-api.git/internal/modules/closings/services"
|
|
user "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func ClosingRoutes(v1 fiber.Router, u user.UserService, s closing.ClosingService, sapronakSvc closing.SapronakService, closingKeuanganSvc closing.ClosingKeuanganService) {
|
|
ctrl := controller.NewClosingController(s, sapronakSvc, closingKeuanganSvc)
|
|
|
|
route := v1.Group("/closings")
|
|
route.Use(m.Auth(u))
|
|
|
|
// route.Get("/", m.Auth(u), ctrl.GetAll)
|
|
// route.Post("/", m.Auth(u), ctrl.CreateOne)
|
|
// route.Get("/:id", m.Auth(u), ctrl.GetOne)
|
|
// route.Patch("/:id", m.Auth(u), ctrl.UpdateOne)
|
|
// route.Delete("/:id", m.Auth(u), ctrl.DeleteOne)
|
|
|
|
route.Get("/", m.RequirePermissions(m.P_ClosingGetAll), ctrl.GetAll)
|
|
route.Get("/:project_flock_id/penjualan", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetPenjualan)
|
|
route.Get("/:project_flock_id/:project_flock_kandang_id/penjualan", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetPenjualanByProjectFlockKandang)
|
|
route.Get("/:projectFlockId", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetClosingSummary)
|
|
route.Get("/:project_flock_id/overhead", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetOverhead)
|
|
route.Get("/:project_flock_id/:project_flock_kandang_id/overhead", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetOverhead)
|
|
route.Get("/:project_flock_id/:project_flock_kandang_id/perhitungan_sapronak", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetSapronakByKandang)
|
|
route.Get("/:project_flock_id/perhitungan_sapronak", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetSapronakByProject)
|
|
route.Get("/:projectFlockId/sapronak", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetClosingSapronak)
|
|
route.Get("/:project_flock_id/expedition-hpp", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetExpeditionHPP)
|
|
route.Get("/:project_flock_id/:project_flock_kandang_id/expedition-hpp", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetExpeditionHPPByKandang)
|
|
route.Get("/:projectFlockId/production-data", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetClosingDataProduksi)
|
|
route.Get("/:projectFlockId/keuangan", m.RequirePermissions(m.P_ClosingDetail), ctrl.GetClosingKeuangan)
|
|
|
|
}
|