model

package
v0.0.0-...-5c87641 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Case

type Case struct {
	ID                   string
	SurveyID             string `db:"survey_id"`
	DiagnosisAndActionID string `db:"diagnosis_and_action_id"`
	ToothNumber          int32  `db:"tooth_number"`
	CreatedAt            string `db:"created_at"`
}

Case is the case entity

func NewCaseFromInput

func NewCaseFromInput(input CaseInput, surveyID string) (c Case, err error)

type CaseInput

type CaseInput struct {
	DiagnosisAndActionID *string
	ToothNumber          *int32
}

CaseInput is the input for case entity

func (*CaseInput) Validate

func (ci *CaseInput) Validate() error

type CostReport

type CostReport struct {
	Description string  `db:"description"`
	Cost        float64 `db:"cost"`
}

CostReport is the cost report entity

type DiagnosisAndAction

type DiagnosisAndAction struct {
	ID        string
	Diagnosis string
	Action    string
	UnitCost  float64 `db:"unit_cost"`
	CreatedAt string  `db:"created_at"`
}

DiagnosisAndAction is the diagnosis and action entity

type LoginResponse

type LoginResponse struct {
	*Response
	AccessToken string `json:"access_token,omitempty"`
}

type Permission

type Permission struct {
	ID   int64
	Name string
}

type Response

type Response struct {
	Code  int    `json:"code"`
	Error string `json:"error,omitempty"`
}

type Role

type Role struct {
	ID        string
	Name      string
	CreatedAt string `db:"created_at"`
}

type School

type School struct {
	ID        string
	Name      string
	CreatedAt string `db:"created_at"`
	Students  []*Student
}

School is the school entity

type Student

type Student struct {
	ID          string
	Name        string
	DateOfBirth string `db:"date_of_birth"`
	SchoolID    string `db:"school_id"`
	// School      *School
	CreatedAt string `db:"created_at"`
}

Student is the student entity

type Survey

type Survey struct {
	ID              string
	StudentID       string `db:"student_id"`
	SurveyorID      string `db:"surveyor_id"`
	Date            string `db:"date"`
	S1Q1            string `db:"s1q1"`
	S1Q2            string `db:"s1q2"`
	S1Q3            string `db:"s1q3"`
	S1Q4            string `db:"s1q4"`
	S1Q5            string `db:"s1q5"`
	S1Q6            string `db:"s1q6"`
	S1Q7            string `db:"s1q7"`
	S2Q1            string `db:"s2q1"`
	S2Q2            string `db:"s2q2"`
	S2Q3            string `db:"s2q3"`
	S2Q4            string `db:"s2q4"`
	S2Q5            string `db:"s2q5"`
	S2Q6            string `db:"s2q6"`
	S2Q7            string `db:"s2q7"`
	S2Q8            string `db:"s2q8"`
	S2Q9            string `db:"s2q9"`
	LowerD          int32  `db:"lower_d"`
	LowerE          int32  `db:"lower_e"`
	LowerF          int32  `db:"lower_f"`
	UpperD          int32  `db:"upper_d"`
	UpperM          int32  `db:"upper_m"`
	UpperF          int32  `db:"upper_f"`
	SubjectiveScore int32  `db:"subjective_score"`
	CreatedAt       string `db:"created_at"`
	Cases           []*Case
}

Survey is the survey entity

func NewSurveyFromInput

func NewSurveyFromInput(input SurveyInput) (s Survey, err error)

func (*Survey) CalculateScore

func (s *Survey) CalculateScore()

func (*Survey) GetScore

func (s *Survey) GetScore(answer string) int

type SurveyInput

type SurveyInput struct {
	StudentID  *string
	SurveyorID *string
	Date       *string
	S1Q1       *string
	S1Q2       *string
	S1Q3       *string
	S1Q4       *string
	S1Q5       *string
	S1Q6       *string
	S1Q7       *string
	S2Q1       *string
	S2Q2       *string
	S2Q3       *string
	S2Q4       *string
	S2Q5       *string
	S2Q6       *string
	S2Q7       *string
	S2Q8       *string
	S2Q9       *string
	LowerD     *int32
	LowerE     *int32
	LowerF     *int32
	UpperD     *int32
	UpperM     *int32
	UpperF     *int32
	Cases      *[]*CaseInput
}

SurveyInput is the input for section entity

func (*SurveyInput) Validate

func (si *SurveyInput) Validate() error

type SurveyReport

type SurveyReport struct {

	// Preset values
	StudentName   string    `db:"studentname"`
	SchoolName    string    `db:"schoolname"`
	DateOfSurvey  time.Time `db:"dateofsurvey"`
	SCAPercentage float64   `db:"scapercentage"`
	DValue        float64   `db:"dvalue"`
	MValue        float64   `db:"mvalue"`
	FValue        float64   `db:"fvalue"`

	// Calculated values
	RiskProfile                 string
	OperatorSuggestionRecurring string
	OperatorSuggestionFluoride  string
	OperatorSuggestionDiet      string
	OperatorSuggestionSealant   string
	OperatorSuggestionART       string
	ParentReminder              []string
	ParentGuidance              []string
	ParentSupervision           []string
	TeacherReminder             []string
	TeacherGuidance             []string
}

func (*SurveyReport) Setup

func (sr *SurveyReport) Setup()

type User

type User struct {
	ID        string
	Email     string
	Password  string
	IPAddress string `db:"ip_address"`
	CreatedAt string `db:"created_at"`
	Roles     []*Role
}

func (*User) ComparePassword

func (user *User) ComparePassword(password string) bool

func (*User) HashedPassword

func (user *User) HashedPassword() error

type UserCredentials

type UserCredentials struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

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