Files
fm_be/internal/domain/mcf/repository.go
2026-07-16 22:16:45 +07:00

18 lines
953 B
Go

package mcf
import "context"
type Repository interface {
Create(ctx context.Context, row *MaintenanceCheckFlight) error
Update(ctx context.Context, row *MaintenanceCheckFlight) error
Delete(ctx context.Context, id []byte, deletedBy []byte) error
GetByID(ctx context.Context, id []byte) (*MaintenanceCheckFlight, error)
ListByHelicopter(ctx context.Context, helicopterID []byte) ([]MaintenanceCheckFlight, error)
GetLatestByHelicopter(ctx context.Context, helicopterID []byte) (*MaintenanceCheckFlight, error)
LatestByHelicopterIDs(ctx context.Context, helicopterIDs [][]byte) (map[string]*MaintenanceCheckFlight, error)
PendingHelicopterIDs(ctx context.Context, helicopterIDs [][]byte) (map[string]bool, error)
// HelicopterHasOpenMCF reports whether the helicopter has a draft (not yet
// completed/signed) MCF — used to enforce one open MCF per helicopter.
HelicopterHasOpenMCF(ctx context.Context, helicopterID []byte) (bool, error)
}