// TODO: Make an interface for Validate() and then validation can pass in the // key prefix ("booking.") func (booking Booking) Validate(v *revel.Validation) { v.Required(booking.User) v.Required(booking.Hotel) v.Required(booking.CheckInDate) v.Required(booking.CheckOutDate) v.Match(booking.CardNumber, regexp.MustCompile(`\d{16}`)). Message("Credit card number must be numeric and 16 digits") v.Check(booking.NameOnCard, revel.Required{}, revel.MinSize{3}, revel.MaxSize{70}, ) }