Revert "Revert "[FIX/BE-US]add feature restrict by location and areas in roles""

This reverts commit 26bf7f165e.
This commit is contained in:
ragilap
2026-01-14 13:34:44 +07:00
parent 26bf7f165e
commit 32772a63c8
30 changed files with 1258 additions and 37 deletions
@@ -17,10 +17,12 @@ import (
"github.com/go-playground/validator/v10"
"github.com/sirupsen/logrus"
"gorm.io/gorm"
)
type DashboardService interface {
GetAll(ctx context.Context, params *validation.Query) (dto.DashboardPerformanceOverviewDTO, int64, error)
DB() *gorm.DB
}
type dashboardService struct {
@@ -37,6 +39,10 @@ func NewDashboardService(repo repository.DashboardRepository, validate *validato
}
}
func (s dashboardService) DB() *gorm.DB {
return s.Repository.DB()
}
func (s dashboardService) GetAll(ctx context.Context, params *validation.Query) (dto.DashboardPerformanceOverviewDTO, int64, error) {
if err := s.Validate.Struct(params); err != nil {
return dto.DashboardPerformanceOverviewDTO{}, 0, err