Files
GuwandykA 323e131216
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled
changed role permission
2026-09-26 16:34:28 +05:00

21 lines
578 B
Go

package role
import (
"context"
"errors"
)
var (
ErrDuplicateCode = errors.New("role code already exists")
ErrInUse = errors.New("role is assigned to users")
)
type Repository interface {
List(ctx context.Context, filter ListFilter) (ListRoleDTO, error)
GetByID(ctx context.Context, id int64) (RoleDTO, error)
Create(ctx context.Context, dto CreateRoleDTO) (RoleDTO, error)
Update(ctx context.Context, id int64, dto UpdateRoleDTO) (RoleDTO, error)
// Delete returns ErrInUse while any live user holds the role.
Delete(ctx context.Context, id int64) error
}