booking

package
v0.0.0-...-d22e7c3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusCreated                       = 10
	StatusWaitingForPayment             = 100
	StatusWaitingForPaymentConfirmation = 105
	StatusWaitingForOwnerConfirmation   = 110
	StatusConfirmed                     = 120
	StatusActive                        = 150
	StatusFinished                      = 200
	StatusCancelled                     = 500
	StatusCancelledBySystem             = 505
	StatusRejected                      = 510
)

booking status list

Variables

View Source
var (
	ErrInvalidType = errors.New("booking: type is not valid")
)

list of booking errors

Functions

This section is empty.

Types

type Booking

type Booking struct {
	ID          string
	PropertyID  string
	BookingType Type
	Price       int64
	Deposit     int64
	Status      Status
	// mark that booking really happens
	IsPaid bool
	// a hack, so owner can see booking attempt
	IsCreatedByOwner bool
	CreatedAt        time.Time
	UpdatedAt        time.Time
	CreatedBy        int64
	IsTest           bool
}

Booking record attempt of booking data in attempt is dirty because its mixed from attempt to booking

type Detail

type Detail struct {
}

Detail of booking

type PaidBooking

type PaidBooking struct {
	// is an id from attempt
	ID        string
	ItemID    string
	Price     int32
	Status    int
	CreatedAt time.Time
	UpdatedAt time.Time
	UpdatedBy int64
	IsTest    bool
}

PaidBooking data booking is different attempt this is where data after booking confirmation stored

type Status

type Status int

Status of booking

type Type

type Type int

Type of booking

const (
	TypeDaily   Type = 1
	TypeMonthly Type = 2
)

booking type list

func (Type) Validate

func (t Type) Validate() error

Validate booking type

Jump to

Keyboard shortcuts

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