// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.30.0

package database

import (
	"database/sql/driver"
	"fmt"
	"time"

	"github.com/jackc/pgx/v5/pgtype"
)

type ApprovalState string

const (
	ApprovalStateUNKNOWN   ApprovalState = "UNKNOWN"
	ApprovalStateFREE      ApprovalState = "FREE"
	ApprovalStateREQUIRED  ApprovalState = "REQUIRED"
	ApprovalStateREQUESTED ApprovalState = "REQUESTED"
	ApprovalStateAPPROVED  ApprovalState = "APPROVED"
)

func (e *ApprovalState) Scan(src interface{}) error {
	switch s := src.(type) {
	case []byte:
		*e = ApprovalState(s)
	case string:
		*e = ApprovalState(s)
	default:
		return fmt.Errorf("unsupported scan type for ApprovalState: %T", src)
	}
	return nil
}

type NullApprovalState struct {
	ApprovalState ApprovalState `json:"ApprovalState"`
	Valid         bool          `json:"valid"` // Valid is true if ApprovalState is not NULL
}

// Scan implements the Scanner interface.
func (ns *NullApprovalState) Scan(value interface{}) error {
	if value == nil {
		ns.ApprovalState, ns.Valid = "", false
		return nil
	}
	ns.Valid = true
	return ns.ApprovalState.Scan(value)
}

// Value implements the driver Valuer interface.
func (ns NullApprovalState) Value() (driver.Value, error) {
	if !ns.Valid {
		return nil, nil
	}
	return string(ns.ApprovalState), nil
}

type CostTypeVariant string

const (
	CostTypeVariantNACHTZUSCHLAG         CostTypeVariant = "NACHTZUSCHLAG"
	CostTypeVariantWOCHENENDZUSCHLAG     CostTypeVariant = "WOCHENENDZUSCHLAG"
	CostTypeVariantFEIERTAGSZUSCHLAG     CostTypeVariant = "FEIERTAGSZUSCHLAG"
	CostTypeVariantDESINFEKTIONSZUSCHLAG CostTypeVariant = "DESINFEKTIONSZUSCHLAG"
	CostTypeVariantKILOMETERZUSCHLAG     CostTypeVariant = "KILOMETERZUSCHLAG"
	CostTypeVariantFAHRZEUGZUSCHLAG      CostTypeVariant = "FAHRZEUGZUSCHLAG"
	CostTypeVariantTSWDIFFERENZIERUNG    CostTypeVariant = "TSWDIFFERENZIERUNG"
	CostTypeVariantGRUNDPREIS            CostTypeVariant = "GRUNDPREIS"
	CostTypeVariantGRUNDPREISZEIT        CostTypeVariant = "GRUNDPREIS_ZEIT"
	CostTypeVariantPRIVATVERSICHERUNG    CostTypeVariant = "PRIVATVERSICHERUNG"
	CostTypeVariantTRAGEHILFE            CostTypeVariant = "TRAGEHILFE"
)

func (e *CostTypeVariant) Scan(src interface{}) error {
	switch s := src.(type) {
	case []byte:
		*e = CostTypeVariant(s)
	case string:
		*e = CostTypeVariant(s)
	default:
		return fmt.Errorf("unsupported scan type for CostTypeVariant: %T", src)
	}
	return nil
}

type NullCostTypeVariant struct {
	CostTypeVariant CostTypeVariant `json:"CostTypeVariant"`
	Valid           bool            `json:"valid"` // Valid is true if CostTypeVariant is not NULL
}

// Scan implements the Scanner interface.
func (ns *NullCostTypeVariant) Scan(value interface{}) error {
	if value == nil {
		ns.CostTypeVariant, ns.Valid = "", false
		return nil
	}
	ns.Valid = true
	return ns.CostTypeVariant.Scan(value)
}

// Value implements the driver Valuer interface.
func (ns NullCostTypeVariant) Value() (driver.Value, error) {
	if !ns.Valid {
		return nil, nil
	}
	return string(ns.CostTypeVariant), nil
}

type TicketState string

const (
	TicketStateCREATED          TicketState = "CREATED"
	TicketStateAPPROVALREQUIRED TicketState = "APPROVAL_REQUIRED"
	TicketStateREADY            TicketState = "READY"
	TicketStateDONE             TicketState = "DONE"
	TicketStateBILLABLE         TicketState = "BILLABLE"
	TicketStateARCHIVED         TicketState = "ARCHIVED"
)

func (e *TicketState) Scan(src interface{}) error {
	switch s := src.(type) {
	case []byte:
		*e = TicketState(s)
	case string:
		*e = TicketState(s)
	default:
		return fmt.Errorf("unsupported scan type for TicketState: %T", src)
	}
	return nil
}

type NullTicketState struct {
	TicketState TicketState `json:"TicketState"`
	Valid       bool        `json:"valid"` // Valid is true if TicketState is not NULL
}

// Scan implements the Scanner interface.
func (ns *NullTicketState) Scan(value interface{}) error {
	if value == nil {
		ns.TicketState, ns.Valid = "", false
		return nil
	}
	ns.Valid = true
	return ns.TicketState.Scan(value)
}

// Value implements the driver Valuer interface.
func (ns NullTicketState) Value() (driver.Value, error) {
	if !ns.Valid {
		return nil, nil
	}
	return string(ns.TicketState), nil
}

type TicketValidationState string

const (
	TicketValidationStateCREATED                 TicketValidationState = "CREATED"
	TicketValidationStateUSERINTERACTIONREQUIRED TicketValidationState = "USER_INTERACTION_REQUIRED"
	TicketValidationStateTDUNCERTAIN             TicketValidationState = "TD_UNCERTAIN"
	TicketValidationStateDOCUMENTSMISSING        TicketValidationState = "DOCUMENTS_MISSING"
	TicketValidationStateARCHIVED                TicketValidationState = "ARCHIVED"
)

func (e *TicketValidationState) Scan(src interface{}) error {
	switch s := src.(type) {
	case []byte:
		*e = TicketValidationState(s)
	case string:
		*e = TicketValidationState(s)
	default:
		return fmt.Errorf("unsupported scan type for TicketValidationState: %T", src)
	}
	return nil
}

type NullTicketValidationState struct {
	TicketValidationState TicketValidationState `json:"TicketValidationState"`
	Valid                 bool                  `json:"valid"` // Valid is true if TicketValidationState is not NULL
}

// Scan implements the Scanner interface.
func (ns *NullTicketValidationState) Scan(value interface{}) error {
	if value == nil {
		ns.TicketValidationState, ns.Valid = "", false
		return nil
	}
	ns.Valid = true
	return ns.TicketValidationState.Scan(value)
}

// Value implements the driver Valuer interface.
func (ns NullTicketValidationState) Value() (driver.Value, error) {
	if !ns.Valid {
		return nil, nil
	}
	return string(ns.TicketValidationState), nil
}

type Anomaly struct {
	ID                 string     `json:"id"`
	Type               string     `json:"type"`
	Description        string     `json:"description"`
	GroupKey           string     `json:"groupKey"`
	GroupDescription   string     `json:"groupDescription"`
	WorkedOnBy         string     `json:"workedOnBy"`
	SleepTimer         int32      `json:"sleepTimer"`
	SleepSince         *time.Time `json:"sleepSince"`
	ResolvedAt         *time.Time `json:"resolvedAt"`
	ManuallyResolved   bool       `json:"manuallyResolved"`
	CreatedAt          time.Time  `json:"createdAt"`
	AssociatedEntities []byte     `json:"associatedEntities"`
}

type AttendanceRegistration struct {
	AttendanceRegistrationId int32     `json:"attendanceRegistrationId"`
	EmployeeId               int32     `json:"employeeId"`
	PersonnelNumber          string    `json:"personnelNumber"`
	DateTime                 time.Time `json:"dateTime"`
	Event                    string    `json:"event"`
}

type AttendanceRegistrationSource struct {
	InternalId               pgtype.UUID `json:"internalId"`
	InsertedAt               time.Time   `json:"insertedAt"`
	JobId                    string      `json:"jobId"`
	AttendanceRegistrationId pgtype.Text `json:"attendanceRegistrationId"`
	EmployeeId               pgtype.Text `json:"employeeId"`
	PersonnelNumber          pgtype.Text `json:"personnelNumber"`
	DateTime                 pgtype.Text `json:"dateTime"`
	Event                    pgtype.Text `json:"event"`
}

type AttendanceRegistrationStaging struct {
	InternalId               pgtype.UUID `json:"internalId"`
	AttendanceRegistrationId int32       `json:"attendanceRegistrationId"`
	EmployeeId               int32       `json:"employeeId"`
	DateTime                 time.Time   `json:"dateTime"`
	Event                    string      `json:"event"`
}

type AvicennaTenant struct {
	ID                    pgtype.UUID `json:"id"`
	HealthInsuranceNumber string      `json:"healthInsuranceNumber"`
	Name                  string      `json:"name"`
}

type AvicennaTenantToTariffGroup struct {
	A pgtype.UUID `json:"A"`
	B pgtype.UUID `json:"B"`
}

type CostType struct {
	ID              pgtype.UUID     `json:"id"`
	Description     string          `json:"description"`
	Variant         CostTypeVariant `json:"variant"`
	CostAmount      int32           `json:"costAmount"`
	TimeRange       pgtype.Text     `json:"timeRange"`
	KmInclusive     pgtype.Int4     `json:"kmInclusive"`
	ExcludeCarNames []string        `json:"excludeCarNames"`
	InfectionType   pgtype.Text     `json:"infectionType"`
	TariffId        pgtype.UUID     `json:"tariffId"`
}

type DyflexisEmployee struct {
	ID                 int32       `json:"id"`
	Firstname          string      `json:"firstname"`
	Surname            string      `json:"surname"`
	ContractStart      time.Time   `json:"contractStart"`
	ContractEnd        *time.Time  `json:"contractEnd"`
	ContractHoursWeek  float64     `json:"contractHoursWeek"`
	ContractSalaryHour float64     `json:"contractSalaryHour"`
	ContractTypeName   pgtype.Text `json:"contractTypeName"`
	InternalId         pgtype.UUID `json:"internalId"`
}

type Employee struct {
	ID                             string      `json:"id"`
	Name                           string      `json:"name"`
	Surname                        string      `json:"surname"`
	PersonnelNumber                pgtype.Text `json:"personnelNumber"`
	Mobile                         pgtype.Text `json:"mobile"`
	Qualification                  pgtype.Text `json:"qualification"`
	OccuptationalHealthExamination *time.Time  `json:"occuptationalHealthExamination"`
	PersonTransportCertificate     *time.Time  `json:"personTransportCertificate"`
}

type EmployeeDispoLiveSource struct {
	InternalId         pgtype.UUID `json:"internalId"`
	InsertedAt         time.Time   `json:"insertedAt"`
	JobId              string      `json:"jobId"`
	ID                 pgtype.Text `json:"id"`
	PScheinAblaufDatum pgtype.Text `json:"pScheinAblaufDatum"`
	Name               pgtype.Text `json:"name"`
	Surname            pgtype.Text `json:"surname"`
	PersId             pgtype.Text `json:"persId"`
	ImportPersId       pgtype.Text `json:"importPersId"`
	Qualifikation      pgtype.Text `json:"qualifikation"`
}

type EmployeeDispoLiveStaging struct {
	InternalId                 pgtype.UUID `json:"internalId"`
	ID                         string      `json:"id"`
	Name                       pgtype.Text `json:"name"`
	Surname                    pgtype.Text `json:"surname"`
	PersonnelNumber            pgtype.Text `json:"personnelNumber"`
	Qualification              pgtype.Text `json:"qualification"`
	PersonTransportCertificate *time.Time  `json:"personTransportCertificate"`
}

type EmployeeDyflexisSource struct {
	InternalId         pgtype.UUID `json:"internalId"`
	InsertedAt         time.Time   `json:"insertedAt"`
	JobId              string      `json:"jobId"`
	ID                 pgtype.Text `json:"id"`
	Firstname          pgtype.Text `json:"firstname"`
	Surname            pgtype.Text `json:"surname"`
	ContractID         pgtype.Text `json:"contract_id"`
	ContractStart      pgtype.Text `json:"contract_start"`
	ContractEnd        pgtype.Text `json:"contract_end"`
	ContractHoursWeek  pgtype.Text `json:"contract_hours_week"`
	ContractSalaryHour pgtype.Text `json:"contract_salary_hour"`
	ContractTypeName   pgtype.Text `json:"contract_type_name"`
}

type EmployeeDyflexisStaging struct {
	InternalId         pgtype.UUID `json:"internalId"`
	ID                 int32       `json:"id"`
	Firstname          string      `json:"firstname"`
	Surname            string      `json:"surname"`
	ContractStart      time.Time   `json:"contractStart"`
	ContractEnd        time.Time   `json:"contractEnd"`
	ContractHoursWeek  float64     `json:"contractHoursWeek"`
	ContractSalaryHour float64     `json:"contractSalaryHour"`
	ContractTypeName   pgtype.Text `json:"contractTypeName"`
}

type Patient struct {
	ID                string      `json:"id"`
	Surname           pgtype.Text `json:"surname"`
	Name              pgtype.Text `json:"name"`
	Street            pgtype.Text `json:"street"`
	Zip               pgtype.Text `json:"zip"`
	City              pgtype.Text `json:"city"`
	Birthday          *time.Time  `json:"birthday"`
	HealthinsuranceId pgtype.Text `json:"healthinsuranceId"`
	Healthinsurance   pgtype.Text `json:"healthinsurance"`
	CareDegree        pgtype.Text `json:"careDegree"`
	DisabilityMark1   pgtype.Text `json:"disabilityMark1"`
	DisabilityMark2   pgtype.Text `json:"disabilityMark2"`
}

type PatientSource struct {
	InternalId   pgtype.UUID `json:"internalId"`
	InsertedAt   time.Time   `json:"insertedAt"`
	JobId        string      `json:"jobId"`
	ID           pgtype.Text `json:"id"`
	Surname      pgtype.Text `json:"surname"`
	Name         pgtype.Text `json:"name"`
	Street       pgtype.Text `json:"street"`
	Zip          pgtype.Text `json:"zip"`
	City         pgtype.Text `json:"city"`
	Birthday     pgtype.Text `json:"birthday"`
	KkId         pgtype.Text `json:"kkId"`
	Krankenkasse pgtype.Text `json:"krankenkasse"`
	Pflegestufe  pgtype.Text `json:"pflegestufe"`
	Behinderung1 pgtype.Text `json:"behinderung1"`
	Behinderung2 pgtype.Text `json:"behinderung2"`
}

type PatientStaging struct {
	InternalId        pgtype.UUID `json:"internalId"`
	ID                pgtype.Text `json:"id"`
	Surname           pgtype.Text `json:"surname"`
	Name              pgtype.Text `json:"name"`
	Street            pgtype.Text `json:"street"`
	Zip               pgtype.Text `json:"zip"`
	City              pgtype.Text `json:"city"`
	Birthday          *time.Time  `json:"birthday"`
	HealthinsuranceId pgtype.Text `json:"healthinsuranceId"`
	Healthinsurance   pgtype.Text `json:"healthinsurance"`
	CareDegree        pgtype.Text `json:"careDegree"`
	DisabilityMark1   pgtype.Text `json:"disabilityMark1"`
	DisabilityMark2   pgtype.Text `json:"disabilityMark2"`
}

type PlannedTime struct {
	ID         string      `json:"id"`
	UserId     string      `json:"userId"`
	Firstname  pgtype.Text `json:"firstname"`
	Surname    pgtype.Text `json:"surname"`
	StartDate  *time.Time  `json:"startDate"`
	EndDate    *time.Time  `json:"endDate"`
	Department pgtype.Text `json:"department"`
	Pause      int32       `json:"pause"`
	Duration   int32       `json:"duration"`
	Note       pgtype.Text `json:"note"`
}

type PlannedTimeSource struct {
	InternalId     pgtype.UUID `json:"internalId"`
	InsertedAt     time.Time   `json:"insertedAt"`
	JobId          string      `json:"jobId"`
	ID             pgtype.Text `json:"id"`
	UserID         pgtype.Text `json:"user_id"`
	Firstname      pgtype.Text `json:"firstname"`
	Surname        pgtype.Text `json:"surname"`
	DepartmentID   pgtype.Text `json:"department_id"`
	DepartmentName pgtype.Text `json:"department_name"`
	StartDate      pgtype.Text `json:"start_date"`
	EndDate        pgtype.Text `json:"end_date"`
	Pauze          pgtype.Text `json:"pauze"`
	Duration       pgtype.Text `json:"duration"`
	Deleted        pgtype.Text `json:"deleted"`
	Mark           pgtype.Text `json:"mark"`
}

type PlannedTimeStaging struct {
	InternalId     pgtype.UUID `json:"internalId"`
	ID             int32       `json:"id"`
	EmployeeId     int32       `json:"employeeId"`
	Firstname      pgtype.Text `json:"firstname"`
	Surname        pgtype.Text `json:"surname"`
	DepartmentName pgtype.Text `json:"departmentName"`
	StartDate      time.Time   `json:"startDate"`
	EndDate        time.Time   `json:"endDate"`
	Deleted        bool        `json:"deleted"`
	Mark           pgtype.Text `json:"mark"`
	Duration       int32       `json:"duration"`
	Pause          int32       `json:"pause"`
}

type PrismaMigration struct {
	ID                string      `json:"id"`
	Checksum          string      `json:"checksum"`
	FinishedAt        *time.Time  `json:"finished_at"`
	MigrationName     string      `json:"migration_name"`
	Logs              pgtype.Text `json:"logs"`
	RolledBackAt      *time.Time  `json:"rolled_back_at"`
	StartedAt         time.Time   `json:"started_at"`
	AppliedStepsCount int32       `json:"applied_steps_count"`
}

type SolutionTarget struct {
	ID        pgtype.UUID `json:"id"`
	Name      string      `json:"name"`
	AnomalyId pgtype.Text `json:"anomalyId"`
}

type SolutionTargetStep struct {
	ID               pgtype.UUID `json:"id"`
	Description      string      `json:"description"`
	SolutionTargetId pgtype.UUID `json:"solutionTargetId"`
}

type Tariff struct {
	ID            pgtype.UUID `json:"id"`
	ValidFrom     *time.Time  `json:"validFrom"`
	ValidTo       *time.Time  `json:"validTo"`
	TariffGroupId pgtype.UUID `json:"tariffGroupId"`
}

type TariffGroup struct {
	ID            pgtype.UUID `json:"id"`
	Description   string      `json:"description"`
	OrdinanceType string      `json:"ordinanceType"`
}

type Ticket struct {
	ID            pgtype.UUID           `json:"id"`
	CurrentState  TicketValidationState `json:"currentState"`
	Notes         []string              `json:"notes"`
	Errors        []string              `json:"errors"`
	IsUrgent      bool                  `json:"isUrgent"`
	Urgency       time.Time             `json:"urgency"`
	ApprovalState NullApprovalState     `json:"approvalState"`
	DocumentInfo  []byte                `json:"documentInfo"`
	CreatedAt     time.Time             `json:"createdAt"`
}

type TicketStateHistory struct {
	ID        pgtype.UUID           `json:"id"`
	State     TicketValidationState `json:"state"`
	CreatedAt time.Time             `json:"createdAt"`
	TicketId  pgtype.UUID           `json:"ticketId"`
}

type Tour struct {
	ID                    pgtype.UUID   `json:"id"`
	Done                  bool          `json:"done"`
	Direction             string        `json:"direction"`
	CarName               pgtype.Text   `json:"carName"`
	OperationId           string        `json:"operationId"`
	DriverId              pgtype.Text   `json:"driverId"`
	DriverName            pgtype.Text   `json:"driverName"`
	CodriverId            pgtype.Text   `json:"codriverId"`
	CodriverName          pgtype.Text   `json:"codriverName"`
	PatientId             pgtype.Text   `json:"patientId"`
	PatientName           pgtype.Text   `json:"patientName"`
	PatientSurname        pgtype.Text   `json:"patientSurname"`
	PatientStreet         pgtype.Text   `json:"patientStreet"`
	PatientZip            pgtype.Text   `json:"patientZip"`
	PatientCity           pgtype.Text   `json:"patientCity"`
	HealthInsurance       pgtype.Text   `json:"healthInsurance"`
	HealthInsuranceNumber pgtype.Text   `json:"healthInsuranceNumber"`
	Type                  pgtype.Text   `json:"type"`
	Category              pgtype.Text   `json:"category"`
	TransportType         pgtype.Text   `json:"transportType"`
	OrdinanceType         pgtype.Text   `json:"ordinanceType"`
	RangeEndDate          *time.Time    `json:"rangeEndDate"`
	StartInstitution      pgtype.Text   `json:"startInstitution"`
	StartStreet           pgtype.Text   `json:"startStreet"`
	StartZip              pgtype.Text   `json:"startZip"`
	StartCity             pgtype.Text   `json:"startCity"`
	TargetInstitution     pgtype.Text   `json:"targetInstitution"`
	TargetStreet          pgtype.Text   `json:"targetStreet"`
	TargetZip             pgtype.Text   `json:"targetZip"`
	TargetCity            pgtype.Text   `json:"targetCity"`
	StartDate             time.Time     `json:"startDate"`
	Check                 int32         `json:"check"`
	OccupiedKm            pgtype.Float8 `json:"occupiedKm"`
	TotalKm               pgtype.Float8 `json:"totalKm"`
	StartBegin            pgtype.Text   `json:"startBegin"`
	StartEnd              pgtype.Text   `json:"startEnd"`
	Target                pgtype.Text   `json:"target"`
	TargetBegin           pgtype.Text   `json:"targetBegin"`
	Empty                 pgtype.Text   `json:"empty"`
	HasInfection          bool          `json:"hasInfection"`
	InfectionName         pgtype.Text   `json:"infectionName"`
	RevenueDispoLive      pgtype.Float8 `json:"revenueDispoLive"`
	BillDate              *time.Time    `json:"billDate"`
	BillNumber            pgtype.Text   `json:"billNumber"`
	Revenue               float64       `json:"revenue"`
	ConsumptionCosts      float64       `json:"consumptionCosts"`
	RevenueDeviation      float64       `json:"revenueDeviation"`
	CreatedAt             *time.Time    `json:"createdAt"`
	DeletedAt             *time.Time    `json:"deletedAt"`
	TicketId              pgtype.UUID   `json:"ticketId"`
	UpdatedAt             *time.Time    `json:"updatedAt"`
}

type TourSource struct {
	InternalId        pgtype.UUID `json:"internalId"`
	InsertedAt        time.Time   `json:"insertedAt"`
	JobId             string      `json:"jobId"`
	ID                pgtype.Text `json:"id"`
	Check             pgtype.Text `json:"check"`
	CreateTime        pgtype.Text `json:"createTime"`
	EmpfangenVonId    pgtype.Text `json:"empfangenVonId"`
	Endgen            pgtype.Text `json:"endgen"`
	SerienId          pgtype.Text `json:"serienId"`
	SerienKategorName pgtype.Text `json:"serienKategorName"`
	SerienKategorie   pgtype.Text `json:"serienKategorie"`
	ZadStatus         pgtype.Text `json:"zadStatus"`
	AbrDate           pgtype.Text `json:"abrDate"`
	AbrNum            pgtype.Text `json:"abrNum"`
	AbrTime           pgtype.Text `json:"abrTime"`
	AusrueckZeit      pgtype.Text `json:"ausrueckZeit"`
	StartTime         pgtype.Text `json:"startTime"`
	StartDate         pgtype.Text `json:"startDate"`
	Date              pgtype.Text `json:"date"`
	DateIso           pgtype.Text `json:"date_iso"`
	Dauergenehmigung  pgtype.Text `json:"dauergenehmigung"`
	Direction         pgtype.Text `json:"direction"`
	DistanceValue     pgtype.Text `json:"distanceValue"`
	BesetztKm         pgtype.Text `json:"besetztKm"`
	Gefahren          pgtype.Text `json:"gefahren"`
	GesamtPreis       pgtype.Text `json:"gesamtPreis"`
	Infektion         pgtype.Text `json:"infektion"`
	ItDesc            pgtype.Text `json:"itDesc"`
	ItKrz             pgtype.Text `json:"itKrz"`
	ItName            pgtype.Text `json:"itName"`
	KkId              pgtype.Text `json:"kkId"`
	Krankenkasse      pgtype.Text `json:"krankenkasse"`
	PatId             pgtype.Text `json:"patId"`
	PatName           pgtype.Text `json:"patName"`
	PatSurname        pgtype.Text `json:"patSurname"`
	PatStreet         pgtype.Text `json:"patStreet"`
	PatZip            pgtype.Text `json:"patZip"`
	PatCity           pgtype.Text `json:"patCity"`
	StartInstitution  pgtype.Text `json:"startInstitution"`
	StartStreet       pgtype.Text `json:"startStreet"`
	StartZip          pgtype.Text `json:"startZip"`
	StartCity         pgtype.Text `json:"startCity"`
	TargetInstitution pgtype.Text `json:"targetInstitution"`
	TargetStreet      pgtype.Text `json:"targetStreet"`
	TargetZip         pgtype.Text `json:"targetZip"`
	TargetCity        pgtype.Text `json:"targetCity"`
	TransportKrz      pgtype.Text `json:"transportKrz"`
	TransportName     pgtype.Text `json:"transportName"`
	Transportart      pgtype.Text `json:"transportart"`
	VerordnungsId     pgtype.Text `json:"verordnungsId"`
	VerordnungsName   pgtype.Text `json:"verordnungsName"`
	Type              pgtype.Text `json:"type"`
	StartBegin        pgtype.Text `json:"startBegin"`
	StartEnd          pgtype.Text `json:"startEnd"`
	Frei              pgtype.Text `json:"frei"`
	Ziel              pgtype.Text `json:"ziel"`
	ZielBegin         pgtype.Text `json:"zielBegin"`
	EndTime           pgtype.Text `json:"endTime"`
	EndDate           pgtype.Text `json:"endDate"`
	EinsatzNummer     pgtype.Text `json:"einsatzNummer"`
	CarName           pgtype.Text `json:"carName"`
	CarNo             pgtype.Text `json:"carNo"`
	BeifahrerName     pgtype.Text `json:"beifahrerName"`
	Beifahrer         pgtype.Text `json:"beifahrer"`
	FahrerName        pgtype.Text `json:"fahrerName"`
	Fahrer            pgtype.Text `json:"fahrer"`
	Color             pgtype.Text `json:"color"`
	LastUpdate        pgtype.Text `json:"lastUpdate"`
}

type TourStaging struct {
	InternalId            pgtype.UUID   `json:"internalId"`
	ID                    pgtype.Text   `json:"id"`
	Done                  pgtype.Bool   `json:"done"`
	Direction             pgtype.Text   `json:"direction"`
	CarName               pgtype.Text   `json:"carName"`
	OperationId           pgtype.Text   `json:"operationId"`
	DriverId              pgtype.Text   `json:"driverId"`
	DriverName            pgtype.Text   `json:"driverName"`
	CodriverId            pgtype.Text   `json:"codriverId"`
	CodriverName          pgtype.Text   `json:"codriverName"`
	PatientId             pgtype.Text   `json:"patientId"`
	PatientName           pgtype.Text   `json:"patientName"`
	PatientSurname        pgtype.Text   `json:"patientSurname"`
	PatientStreet         pgtype.Text   `json:"patientStreet"`
	PatientZip            pgtype.Text   `json:"patientZip"`
	PatientCity           pgtype.Text   `json:"patientCity"`
	HealthInsurance       pgtype.Text   `json:"healthInsurance"`
	HealthInsuranceNumber pgtype.Text   `json:"healthInsuranceNumber"`
	Type                  pgtype.Text   `json:"type"`
	Category              pgtype.Text   `json:"category"`
	TransportType         pgtype.Text   `json:"transportType"`
	OrdinanceType         pgtype.Text   `json:"ordinanceType"`
	RangeEndDate          *time.Time    `json:"rangeEndDate"`
	StartInstitution      pgtype.Text   `json:"startInstitution"`
	StartStreet           pgtype.Text   `json:"startStreet"`
	StartZip              pgtype.Text   `json:"startZip"`
	StartCity             pgtype.Text   `json:"startCity"`
	TargetInstitution     pgtype.Text   `json:"targetInstitution"`
	TargetStreet          pgtype.Text   `json:"targetStreet"`
	TargetZip             pgtype.Text   `json:"targetZip"`
	TargetCity            pgtype.Text   `json:"targetCity"`
	StartDate             *time.Time    `json:"startDate"`
	Check                 int32         `json:"check"`
	OccupiedKm            pgtype.Float8 `json:"occupiedKm"`
	TotalKm               pgtype.Float8 `json:"totalKm"`
	StartBegin            pgtype.Text   `json:"startBegin"`
	StartEnd              pgtype.Text   `json:"startEnd"`
	Target                pgtype.Text   `json:"target"`
	TargetBegin           pgtype.Text   `json:"targetBegin"`
	Empty                 pgtype.Text   `json:"empty"`
	HasInfection          bool          `json:"hasInfection"`
	InfectionName         pgtype.Text   `json:"infectionName"`
	RevenueDispoLive      pgtype.Float8 `json:"revenueDispoLive"`
	BillDate              *time.Time    `json:"billDate"`
	BillNumber            pgtype.Text   `json:"billNumber"`
	Revenue               float64       `json:"revenue"`
	RevenueDeviation      float64       `json:"revenueDeviation"`
	ConsumptionCosts      float64       `json:"consumptionCosts"`
	CreatedAt             *time.Time    `json:"createdAt"`
	UpdatedAt             *time.Time    `json:"updatedAt"`
}

type Trace struct {
	ID        pgtype.UUID `json:"id"`
	Type      string      `json:"type"`
	EntityKey string      `json:"entityKey"`
	CreatedAt time.Time   `json:"createdAt"`
}

type WorkTime struct {
	ID         string      `json:"id"`
	UserId     string      `json:"userId"`
	Firstname  string      `json:"firstname"`
	Surname    string      `json:"surname"`
	StartDate  *time.Time  `json:"startDate"`
	EndDate    *time.Time  `json:"endDate"`
	Department pgtype.Text `json:"department"`
	Pause      int32       `json:"pause"`
	Duration   int32       `json:"duration"`
}

type WorkTimeSource struct {
	InternalId     pgtype.UUID `json:"internalId"`
	InsertedAt     time.Time   `json:"insertedAt"`
	JobId          string      `json:"jobId"`
	ID             pgtype.Text `json:"id"`
	UserID         pgtype.Text `json:"user_id"`
	Firstname      pgtype.Text `json:"firstname"`
	Surname        pgtype.Text `json:"surname"`
	DepartmentID   pgtype.Text `json:"department_id"`
	DepartmentName pgtype.Text `json:"department_name"`
	StartDate      pgtype.Text `json:"start_date"`
	EndDate        pgtype.Text `json:"end_date"`
	Pauze          pgtype.Text `json:"pauze"`
	Duration       pgtype.Text `json:"duration"`
}

type WorkTimeStaging struct {
	InternalId     pgtype.UUID `json:"internalId"`
	ID             int32       `json:"id"`
	EmployeeId     int32       `json:"employeeId"`
	Firstname      string      `json:"firstname"`
	Surname        string      `json:"surname"`
	DepartmentName pgtype.Text `json:"departmentName"`
	StartDate      time.Time   `json:"startDate"`
	EndDate        time.Time   `json:"endDate"`
	Duration       int32       `json:"duration"`
	Pause          int32       `json:"pause"`
}
