student

package
v0.0.0-...-37076da Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package student is a domain package wich contains the student features and behavior.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmailAlreadyExists = errors.New("email already exists")
View Source
var ErrEmptyPropertyValue = errors.New("empty property value")
View Source
var ErrInvalidCredentials = errors.New("invalid credentials")
View Source
var ErrInvalidStudentProp = errors.New("invalid student property")
View Source
var ErrMissingStudentID = errors.New("missing student id")

GetMeOptions validations

View Source
var ErrNoDataToSync = errors.New("no data to sync")
View Source
var ErrNoStudentsFound = errors.New("no students found")
View Source
var ErrStudentIDInvalid = errors.New("student id invalid")

Functions

func WithEmail

func WithEmail(email string) baseuser.Option

WithEmail returns a baseuser.Option that sets the Email of a student.

It receives a string and sets the Email of the student. If the string is empty, it will return an error.

func WithID

func WithID(id string) baseuser.Option

WithID returns a baseuser.Option that sets the ID of a student.

It receives a string and sets the ID of the student. If the string is empty, it will return an error.

func WithPassword

func WithPassword(password string) baseuser.Option

WithPassword returns a baseuser.Option that sets the Password of a student.

func WithScope

func WithScope(scope string) baseuser.Option

WithScope will add scope to usr

Types

type GetStudents

type GetStudents func() ([]Student, error)

GetStudents is the usecase to get all students Not implemented yet

type GetStudentsRepository

type GetStudentsRepository interface {
	// Run executes the Get Students query.
	//
	// Example:
	//
	//      students, err := repo.Run(context.Backround(), filters.New(), paginator.NewConditions())
	//
	Run(ctx context.Context, f filters.FilterConditions, p paginator.Paginator) ([]Student, error)
}

GetStudentsRepository is the repository implementation for Get Students.

type RegisterStudent

type RegisterStudent func(Student) (Student, error)

RegisterStudent is the usecase to register a new student

type RegisterStudentRepository

type RegisterStudentRepository interface {
	// Run executes the Register Student query.
	//
	// Example:
	//
	//      newStudent, err := repo.Run(context.Backround(), student)
	//
	Run(ctx context.Context, s Student) (Student, error)
}

RegisterStudentRepository is the repository implementation for Register Student.

type Student

type Student interface {
	baseuser.BaseUser
}

Student is has the baseUser interface implemented

func NewStudent

func NewStudent(usrOptions ...baseuser.Option) Student

NewStudent returns a new student instance.

It receive an array of options and applies them to the student instance. If has no options, the instance will be empty.

type StudentUpdater

type StudentUpdater func(Student) (Student, error)

StudentUpdater is a interface who defines the UpdateStudentRepository method

type UpdateStudentRepository

type UpdateStudentRepository interface {
	// Run executes the update in student
	Run(ctx context.Context, usrID string, u StudentUpdater) (Student, error)
}

UpdateStudentRepository is repository implementation for Update Student.

Jump to

Keyboard shortcuts

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