package complaint

import "context"

type Repository interface {
	Create(ctx context.Context, row *Complaint) error
	Update(ctx context.Context, row *Complaint) error
	Delete(ctx context.Context, id []byte, deletedBy []byte) error
	GetByID(ctx context.Context, id []byte) (*Complaint, error)
	ListByHelicopter(ctx context.Context, helicopterID []byte, limit, offset int) ([]Complaint, int64, error)
	List(ctx context.Context, filter ListFilter, sort string, limit, offset int) ([]Complaint, int64, error)
	HelicopterHasOpenComplaint(ctx context.Context, helicopterID []byte) (bool, error)
	ActiveGroundingByHelicopterIDs(ctx context.Context, helicopterIDs [][]byte) ([]Complaint, error)
	OpenByHelicopterIDs(ctx context.Context, helicopterIDs [][]byte) ([]Complaint, error)
	HelicopterHasUnactionedComplaint(ctx context.Context, helicopterID []byte) (bool, error)
	MarkFixedByHelicopter(ctx context.Context, helicopterID []byte, easaID []byte, actor []byte) error
	MarkFixedByComplaint(ctx context.Context, complaintID []byte, easaID []byte, actor []byte) error
	MarkFixedByFlight(ctx context.Context, flightID []byte, easaID []byte, actor []byte) error
}
