bookit

package
v0.0.0-...-a30d32d Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2016 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrBookingNotFound   = Error("Booking not found")
	ErrBookingExists     = Error("Booking already exists, cannot create same booking twice")
	ErrBookingIDRequired = Error("No ID was received in booking_service, something must have gone during ID creation")
	ErrBookingUnmarshal  = Error("An unexpected error occured when booking was read in database, please try again or contact system administrator")
	ErrBookingNoChange   = Error("No change was done")
)

Booking errors

Variables

This section is empty.

Functions

This section is empty.

Types

type Booking

type Booking struct {
	CreateTime       time.Time
	ModTime          time.Time
	ID               BookingID
	BookingDate      string
	RespContCustomer string
	RespContSeller   string
	ProjectCode      string
}

Booking - Defines how a booking looks like, used to seralize data to be passed to arangodb

type BookingID

type BookingID string

BookingID - We create own type for domain usage. This way we can call BookingID type in structs and services etc.

type BookingService

type BookingService interface {
	//Booking is used to fetch a certain booking from db
	GetBooking(id BookingID) (*Booking, error)

	//CreateBooking is used when we need to create a new booking
	CreateBooking(booking *Booking) error

	//DeleteBooking takes an booking id and removes it from db.
	DeleteBooking(id BookingID) (*Booking, error)

	//TODO: complete update booking
	//UpdateBooking updates a booking
	UpdateBooking(booking *Booking) error
}

BookingService - Handles everything with booking

type Client

type Client interface {
	BookingService() BookingService
}

Client will be used to create a connection to services. We only got booking service for now.

type Error

type Error string

Error - error type is used for bookit errors.

func (Error) Error

func (e Error) Error() string

Error returns the error message

type User

type User struct {
	ID           int
	Name         string
	PasswordHash string
	Email        string
}

User - Defines what information is necessary for a user

Jump to

Keyboard shortcuts

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