service

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: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeCursor

func DecodeCursor(after *string) (*string, error)

func EncodeCursor

func EncodeCursor(i *string) graphql.ID

func NewLogger

func NewLogger(config *context.Config) *logging.Logger

func Transact

func Transact(db *sqlx.DB, txFunc func(*sqlx.Tx) error) (err error)

Types

type AuthService

type AuthService struct {
	// contains filtered or unexported fields
}

func NewAuthService

func NewAuthService(config *context.Config, log *logging.Logger) *AuthService

func (*AuthService) SignJWT

func (a *AuthService) SignJWT(user *model.User) (*string, error)

func (*AuthService) ValidateJWT

func (a *AuthService) ValidateJWT(tokenString *string) (*jwt.Token, error)

type CaseService

type CaseService struct {
	// contains filtered or unexported fields
}

func NewCaseService

func NewCaseService(db *sqlx.DB, log *logging.Logger) *CaseService

func (*CaseService) FindByID

func (c *CaseService) FindByID(id string) (*model.Case, error)

func (*CaseService) FindBySurveyID

func (c *CaseService) FindBySurveyID(surveyID *string) ([]*model.Case, error)

type DiagnosisAndActionService

type DiagnosisAndActionService struct {
	// contains filtered or unexported fields
}

func NewDiagnosisAndActionService

func NewDiagnosisAndActionService(db *sqlx.DB, log *logging.Logger) *DiagnosisAndActionService

func (*DiagnosisAndActionService) Count

func (d *DiagnosisAndActionService) Count() (int, error)

func (*DiagnosisAndActionService) FindByID

func (*DiagnosisAndActionService) List

func (d *DiagnosisAndActionService) List(first *int32, after *string) ([]*model.DiagnosisAndAction, error)

type ReportService

type ReportService struct {
	// contains filtered or unexported fields
}

func NewReportService

func NewReportService(db *sqlx.DB, log *logging.Logger) *ReportService

func (*ReportService) CostBreakdownBySchoolAndDateRange

func (s *ReportService) CostBreakdownBySchoolAndDateRange(schoolID string, startDate string, endDate string) ([]*model.CostReport, error)

func (*ReportService) GenerateSurveyPDF

func (s *ReportService) GenerateSurveyPDF(surveyID uuid.UUID) (reportData bytes.Buffer, err error)

type RoleService

type RoleService struct {
	// contains filtered or unexported fields
}

func NewRoleService

func NewRoleService(db *sqlx.DB, log *logging.Logger) *RoleService

func (*RoleService) FindByUserId

func (r *RoleService) FindByUserId(userId *string) ([]*model.Role, error)

type SchoolService

type SchoolService struct {
	// contains filtered or unexported fields
}

func NewSchoolService

func NewSchoolService(db *sqlx.DB, log *logging.Logger) *SchoolService

func (*SchoolService) Count

func (s *SchoolService) Count() (int, error)

func (*SchoolService) CreateSchool

func (s *SchoolService) CreateSchool(school *model.School) (*model.School, error)

func (*SchoolService) FindByID

func (s *SchoolService) FindByID(id string) (*model.School, error)

func (*SchoolService) FindByName

func (s *SchoolService) FindByName(name string) (*model.School, error)

func (*SchoolService) List

func (s *SchoolService) List(first *int32, after *string) ([]*model.School, error)

type StudentService

type StudentService struct {
	// contains filtered or unexported fields
}

func NewStudentService

func NewStudentService(db *sqlx.DB, log *logging.Logger) *StudentService

func (*StudentService) Count

func (s *StudentService) Count(schoolID *string, keyword *string) (int, error)

func (*StudentService) CreateStudent

func (s *StudentService) CreateStudent(student *model.Student) (*model.Student, error)

func (*StudentService) FindByID

func (s *StudentService) FindByID(id string) (*model.Student, error)

func (*StudentService) FindBySchoolID

func (s *StudentService) FindBySchoolID(schoolID *string, keyword *string) (students []*model.Student, err error)

func (*StudentService) List

func (s *StudentService) List(first *int32, after *string, schoolID *string, keyword *string) ([]*model.Student, error)

type SurveyService

type SurveyService struct {
	// contains filtered or unexported fields
}

func NewSurveyService

func NewSurveyService(db *sqlx.DB, caseService *CaseService, log *logging.Logger) *SurveyService

func (*SurveyService) Count

func (s *SurveyService) Count(studentID *string) (int, error)

func (*SurveyService) FindByID

func (s *SurveyService) FindByID(id string) (*model.Survey, error)

func (*SurveyService) List

func (s *SurveyService) List(first *int32, after *string, studentID *string) ([]*model.Survey, error)

func (*SurveyService) TransactionalCreateSurvey

func (s *SurveyService) TransactionalCreateSurvey(survey *model.Survey) (*model.Survey, error)

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(db *sqlx.DB, roleService *RoleService, log *logging.Logger) *UserService

func (*UserService) ComparePassword

func (u *UserService) ComparePassword(userCredentials *model.UserCredentials) (*model.User, error)

func (*UserService) Count

func (u *UserService) Count() (int, error)

func (*UserService) CreateUser

func (u *UserService) CreateUser(user *model.User) (*model.User, error)

func (*UserService) FindByEmail

func (u *UserService) FindByEmail(email string) (*model.User, error)

func (*UserService) List

func (u *UserService) List(first *int32, after *string) ([]*model.User, error)

Jump to

Keyboard shortcuts

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