init push

This commit is contained in:
2026-07-16 22:16:45 +07:00
commit 8b068bdb10
1021 changed files with 332816 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
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)
}