25 lines
981 B
Go
25 lines
981 B
Go
package repository
|
|
|
|
import (
|
|
"context"
|
|
|
|
"gateway/internal/model/permission/domain/entity"
|
|
"gateway/internal/model/permission/domain/enum"
|
|
)
|
|
|
|
// PermissionRepository persists the platform-wide Permission catalog.
|
|
//
|
|
// Catalog mutations are platform admin only; tenants read via
|
|
// GetAll / GetByID. Insert is idempotent on Name (use UpsertByName when
|
|
// seeding).
|
|
type PermissionRepository interface {
|
|
Insert(ctx context.Context, perm *entity.Permission) error
|
|
UpsertByName(ctx context.Context, perm *entity.Permission) error
|
|
UpdateStatus(ctx context.Context, id string, status enum.Status) error
|
|
GetByID(ctx context.Context, id string) (*entity.Permission, error)
|
|
GetByName(ctx context.Context, name string) (*entity.Permission, error)
|
|
GetAll(ctx context.Context, status *enum.Status) ([]*entity.Permission, error)
|
|
GetByIDs(ctx context.Context, ids []string) ([]*entity.Permission, error)
|
|
GetByNames(ctx context.Context, names []string) ([]*entity.Permission, error)
|
|
}
|