// Code generated by candi v1.8.18.

package repository

import (
	"context"
	"monorepo/services/master-service/internal/modules/apps/domain"
	shareddomain "monorepo/services/master-service/pkg/shared/domain"

	"pkg.agungdp.dev/candi/candishared"
)

// AppsRepository abstract interface
type AppsRepository interface {
	FetchAll(ctx context.Context, filter domain.FilterApps) ([]shareddomain.Apps, error)
	Find(ctx context.Context, data *shareddomain.Apps) (err error)
	Count(ctx context.Context, filter domain.FilterApps) (count int64)
	Save(ctx context.Context, data *shareddomain.Apps) (err error)
}

// PermissionRepository abstract interface
type PermissionRepository interface {
	FetchAll(ctx context.Context, filter domain.FilterPermission) ([]shareddomain.Permission, error)
	GroupByAppsID(ctx context.Context, appsID ...string) (groups map[string][]shareddomain.Permission)
	GroupByParentID(ctx context.Context, parentIDs ...string) (groups map[string][]shareddomain.Permission)
	Find(ctx context.Context, data *shareddomain.Permission) (err error)
	Count(ctx context.Context, filter candishared.Filter) (count int64)
	Save(ctx context.Context, data *shareddomain.Permission) (err error)
}
