models

package
v0.0.0-...-b73fbf5 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateCustomer

func ValidateCustomer(customerForm *CustomerForm) error

ValidateCustomer takes a user as parameter and check if its properties are valid

func ValidateForm

func ValidateForm(formType *FormType) error

ValidateForm check if its properties are valid

func ValidateMultiChoiceForm

func ValidateMultiChoiceForm(multipleChoiceForm *MultiChoiceForm) error

ValidateMultiChoiceForm check if its properties are valid

func ValidateQuestionForm

func ValidateQuestionForm(questionFrom *QuestionForm) error

ValidateQuestionForm check if its properties are valid

func ValidateSliderForm

func ValidateSliderForm(sliderForm *SliderForm) error

ValidateSliderForm check if its properties are valid

Types

type Customer

type Customer struct {
	ID             uint64 `gorm:"primary_key"`
	Name           string `gorm:"size:255"`
	Email          string `gorm:"size:255; unique"`
	HashedPassword string
	Role           string `gorm:"size:255"`
}

Customer type is the structure of the users that we will store in the database

type CustomerForm

type CustomerForm struct {
	Name     string `gorm:"size:255"`
	Email    string `gorm:"size:255"`
	Password string `gorm:"size:255"`
	Role     string `gorm:"size:255"`
}

CustomerForm is the struct used to login or register

type Form

type Form struct {
	ID         uint64 `gorm:"primary_key"`
	CustomerID uint64
	Customer   Customer
	Name       string `gorm:"size:255"`
}

Form is the struct send on database

type FormType

type FormType struct {
	Name string `gorm:"size:255"`
}

FormType is the struct send by customer for use form

type MultiChoice

type MultiChoice struct {
	ID         uint64 `gorm:"primary_key"`
	QuestionID uint64
	Question   Question
	Name       string `gorm:"size:255"`
}

MultiChoice is the struct send on database

type MultiChoiceForm

type MultiChoiceForm struct {
	Name string `gorm:"size:255"`
}

MultiChoiceForm is the struct send by customer for use form

type Question

type Question struct {
	ID     uint64 `gorm:"primary_key"`
	FormID uint64
	Form   Form
	Name   string `gorm:"size:255"`
	Type   string `gorm:"size:255"`
}

Question is the struct send on database

type QuestionForm

type QuestionForm struct {
	FormID          uint64
	Name            string `gorm:"size:255"`
	Type            string `gorm:"size:255"`
	MultiChoiceForm []MultiChoiceForm
	SliderForm      SliderForm
}

QuestionForm is the struct send by customer for use form

type Slider

type Slider struct {
	ID         uint64 `gorm:"primary_key"`
	QuestionID uint64
	Question   Question
	Name       string `gorm:"size:255"`
	Min        int
	Max        int
}

Slider is the struct send on database

type SliderForm

type SliderForm struct {
	Name string `gorm:"size:255"`
	Min  int
	Max  int
}

SliderForm is the struct send by customer for use form

Jump to

Keyboard shortcuts

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