func makeId(res *HotelReservationDTO) string {
	return fmt.Sprintf("%v#%v#%v", res.SKU, res.RoomId, res.CheckIn)
}
generates ID for the Chapter10 from SKU, roomid and checkin date
package main
import (
	"fmt"
	_ "github.com/go-sql-driver/mysql"
	"github.com/jinzhu/gorm"
	_ "github.com/jinzhu/gorm/dialects/mysql"
	"time"
)
type Status int
const (
	Initial     Status = 0
	BookingMade Status = 1
	EmailSent   Status = 2
)
type HotelReservation struct {
	CustomerId        uint      `json:"customer_id" `
	PaymentIdentifier uint      `json:"payment_identifier" `
	SKU               uint      `json:"entity_id" `
	RoomId            uint      `json:"room_id" `
	CheckIn           time.Time `json:"check_in" gorm:"type:datetime"`
	CheckOut          time.Time `json:"check_out" gorm:"type:datetime"`
	Id                string
	Status            Status
}
type AvailabilityThreshold struct {
	gorm.Model
	SKU          uint
	RoomId       uint
	Availability int
}
var (
	db *gorm.DB
)
func init() {
	var err error
	db, err = gorm.Open("mysql", "root:@tcp(127.0.0.1:3306)/hotels?charset=utf8&parseTime=True")
	if err != nil {
		panic("failed to connect database")
	}
	db.AutoMigrate(&AvailabilityThreshold{})
	db.Create(&AvailabilityThreshold{SKU: 1, RoomId: 2, Availability: 3})
}