validate

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsBusLineExisting

func IsBusLineExisting(ctx context.Context, name, company string) (bool, error)

IsBusLineExisting checks if the DynamoDB Table is configured on the environment, and returns a boolean and error value to check whether the bus line already exist or not.

func IsBusRouteExisting

func IsBusRouteExisting(ctx context.Context, routefilter schema.BusRouteFilter) (bool, error)

IsBusRouteExisting checks if the DynamoDB Table is configured on the environment, and returns a boolean and error value to check whether the bus route alreadu exist or not.

func IsBusUnitExisting

func IsBusUnitExisting(ctx context.Context, busId, code string) (bool, error)

IsBusUnitExisting checks if the DynamoDB Table is configured on the environment, and returns a boolean and error value to check whether the bus unit already exist or not.

func IsCancelledBookingExists

func IsCancelledBookingExists(ctx context.Context, bookingId string) (bool, error)

IsCancelledBookingExists checks if the DynamoDB Table is configured on the environment, and returns a boolean and error value to check whether the cancelled booking already exist or not.

func IsUsernameExisting

func IsUsernameExisting(ctx context.Context, username string) (bool, error)

IsUsernameExisting checks if the DynamoDB Table is configured on the environment, and returns a boolean and error value to check whether the username already exist or not.

func UpdateBookingFields

func UpdateBookingFields(booking, old schema.Bookings) schema.Bookings

UpdateBookingFields validates if the field that are going to be updated are empty or not to set its previous value.

Fields that are validated:

seat_number, status, reason

Fields that are validated if it is a cancelled booking:

reason, cancelled_by

func UpdateBusLineFields

func UpdateBusLineFields(bus schema.Bus, old schema.Bus) schema.Bus

UpdateBusLineFields validates if the field that are going to be updated are empty or not to set its previous value.

Fields that are validated:

owner, email, address, mobile_number

func UpdateBusRouteFields

func UpdateBusRouteFields(route, old schema.BusRoute) schema.BusRoute

UpdateBusRouteFields validates if the field that are going to be updated are empty or not to set its previous value.

Fields that are validated:

currency_code, rate, active, departure_time, arrival_time, from_route, to_route

func UpdateBusUnitFields

func UpdateBusUnitFields(unit, old schema.BusUnit) schema.BusUnit

UpdateBusUnitFields validates if the field that are going to be updated are empty or not to set its previous value.

Fields that are valdiated:

active, min_capacity, max_capacity

func UpdateUserAccountFields

func UpdateUserAccountFields(user schema.User, old schema.User) schema.User

UpdateUserAccountFields validates if the field that are going to be updated are empty or not to set its previous value.

Fields that are validated:

first_name, last_name, address, email, mobile_number

func UserAccountExists

func UserAccountExists(ctx context.Context, username, password string) (bool, schema.User, error)

UserAccountExists checks if the DynamoDB Table is configured on the environment, and returns a boolean and error value to check whether the user account credentials are correct or not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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