mapper

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapDrivingLicense added in v1.1.0

func MapDrivingLicense(drivingLicense sqlc.DrivingLicense) entities.DrivingLicense

func MapSensorData

func MapSensorData(src []byte) (*entities.MqttPayload, error)

func MapSensorStatus

func MapSensorStatus(src sqlc.SensorStatus) entities.SensorStatus

func MapSoilCondition

func MapSoilCondition(condition sqlc.TreeSoilCondition) entities.TreeSoilCondition

func MapVehicleStatus added in v1.1.0

func MapVehicleStatus(vehicleStatus sqlc.VehicleStatus) entities.VehicleStatus

func MapVehicleType added in v1.1.0

func MapVehicleType(vehicleType sqlc.VehicleType) entities.VehicleType

func MapWateringPlanStatus added in v1.1.0

func MapWateringPlanStatus(wateringPlanStatus sqlc.WateringPlanStatus) entities.WateringPlanStatus

func MapWateringStatus

func MapWateringStatus(status sqlc.WateringStatus) entities.WateringStatus

Types

type InternalRegionRepoMapper

type InternalRegionRepoMapper interface {
	FromSql(src *sqlc.Region) *entities.Region
	FromSqlList(src []*sqlc.Region) []*entities.Region
}

goverter:converter goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTime

type InternalSensorRepoMapper

type InternalSensorRepoMapper interface {
	// goverter:ignore LatestData
	// goverter:map AdditionalInformations AdditionalInfo  | github.com/green-ecolution/green-ecolution-backend/internal/utils:MapAdditionalInfo
	FromSql(src *sqlc.Sensor) (*entities.Sensor, error)
	FromSqlList(src []*sqlc.Sensor) ([]*entities.Sensor, error)
	// goverter:map Data | MapSensorData
	FromSqlSensorData(src *sqlc.SensorDatum) (*entities.SensorData, error)
	FromSqlSensorDataList(src []*sqlc.SensorDatum) ([]*entities.SensorData, error)
	FromDomainSensorData(src *entities.MqttPayload) *mqtt.MqttPayload
}

goverter:converter goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTime goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTimePtr goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:TimeToTime goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:StringPtrToString goverter:extend MapSensorStatus MapSensorData

type InternalTreeClusterRepoMapper

type InternalTreeClusterRepoMapper interface {
	// goverter:map AdditionalInformations AdditionalInfo | github.com/green-ecolution/green-ecolution-backend/internal/utils:MapAdditionalInfo
	FromSql(*sqlc.TreeCluster) (*entities.TreeCluster, error)
	FromSqlList([]*sqlc.TreeCluster) ([]*entities.TreeCluster, error)

	FromSqlRegionWithCount(src *sqlc.GetAllTreeClusterRegionsWithWateringPlanCountRow) (*entities.RegionEvaluation, error)
	FromSqlRegionListWithCount(src []*sqlc.GetAllTreeClusterRegionsWithWateringPlanCountRow) ([]*entities.RegionEvaluation, error)
}

goverter:converter goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTime goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTimePtr goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:StringPtrToString goverter:extend MapWateringStatus MapSoilCondition goverter:ignoreMissing

type InternalTreeRepoMapper

type InternalTreeRepoMapper interface {
	// goverter:ignore Sensor TreeCluster
	// goverter:map AdditionalInformations AdditionalInfo | github.com/green-ecolution/green-ecolution-backend/internal/utils:MapAdditionalInfo
	FromSql(*sqlc.Tree) (*entities.Tree, error)
	FromSqlList([]*sqlc.Tree) ([]*entities.Tree, error)
}

goverter:converter goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTime goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTimePtr goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:StringPtrToString goverter:extend MapWateringStatus MapSoilCondition

type InternalVehicleRepoMapper

type InternalVehicleRepoMapper interface {
	// goverter:map AdditionalInformations AdditionalInfo | github.com/green-ecolution/green-ecolution-backend/internal/utils:MapAdditionalInfo
	FromSql(src *sqlc.Vehicle) (*entities.Vehicle, error)
	FromSqlList(src []*sqlc.Vehicle) ([]*entities.Vehicle, error)

	FromSqlVehicleWithCount(src *sqlc.GetAllVehiclesWithWateringPlanCountRow) (*entities.VehicleEvaluation, error)
	FromSqlListVehicleWithCount(src []*sqlc.GetAllVehiclesWithWateringPlanCountRow) ([]*entities.VehicleEvaluation, error)
}

goverter:converter goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTime goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTimePtr goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:StringPtrToString goverter:extend MapDrivingLicense MapVehicleStatus MapVehicleType

type InternalWateringPlanRepoMapper added in v1.1.0

type InternalWateringPlanRepoMapper interface {
	// goverter:ignore TreeClusters UserIDs Transporter Trailer Evaluation
	// goverter:map GpxUrl GpxURL
	// goverter:map AdditionalInformations AdditionalInfo | github.com/green-ecolution/green-ecolution-backend/internal/utils:MapAdditionalInfo
	FromSql(src *sqlc.WateringPlan) (*entities.WateringPlan, error)
	FromSqlList(src []*sqlc.WateringPlan) ([]*entities.WateringPlan, error)

	EvaluationFromSqlList(src []*sqlc.TreeClusterWateringPlan) []*entities.EvaluationValue
}

goverter:converter goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTime goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgTimestampToTimePtr goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:PgDateToTime goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:StringPtrToString goverter:extend github.com/green-ecolution/green-ecolution-backend/internal/utils:Float64ToDuration goverter:extend MapWateringPlanStatus

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL