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

38 lines
1.2 KiB
Go

package fmreport
import (
"context"
"errors"
)
var ErrDuplicateReportCode = errors.New("duplicate report code")
type ListFilter struct {
Search string
FlightID []byte
TakeoverID []byte
FlightInspectionID []byte
FlightDate string
HasEngine1GpcN1 *bool
HasEngine1PtcN2 *bool
HasEngine2GpcN1 *bool
HasEngine2PtcN2 *bool
Sort string
FromDate string
ToDate string
HelicopterIdentifier string
PilotName string
}
type Repository interface {
Upsert(ctx context.Context, row *Report) error
GetByFlightID(ctx context.Context, flightID []byte) (*Report, error)
GetByID(ctx context.Context, id []byte) (*Report, error)
MaxReportSeqByHelicopter(ctx context.Context, helicopterID []byte) (int, error)
SetReportCode(ctx context.Context, id []byte, code string) error
List(ctx context.Context, filter ListFilter, limit, offset int) ([]Report, int64, error)
Delete(ctx context.Context, id, deletedBy []byte) error
CreateFleetHistory(ctx context.Context, row *FleetHistory) error
GetFleetHistoryByReportID(ctx context.Context, reportID []byte) (*FleetHistory, error)
}