subject

package
v0.0.0-...-57241a5 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IStudentSubjectRepo

type IStudentSubjectRepo interface {
	GetSubjects(filter interface{}) ([]*Subject, error)
	GetSubject(filter interface{}) (*Subject, error)
}

type IStudentSubjectTutorRepo

type IStudentSubjectTutorRepo interface {
	CreateStudentSubjectTutor(studentSubjectTutor *StudentSubjectTutor) error
	StudentSubjectTutorExists(filter interface{}) (bool, error)
	GetStudentSubjectTutors(filter interface{}) ([]*StudentSubjectTutor, error)
}

type ISubjectRepo

type ISubjectRepo interface {
	CreateSubject(subject *Subject) error
	CreateSubjects(subjects []*Subject) error
	SubjectExists(filter interface{}) (bool, error)
	UpdateSubject(filter interface{}, update interface{}) error
	GetSubject(filter interface{}) (*Subject, error)
	GetSubjects(filter interface{}) ([]*Subject, error)
}

type ISubjectService

type ISubjectService interface {
	CreateSubject(subject *Subject) error
}

type StudentSubjectTutor

type StudentSubjectTutor struct {
	Id        primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	StudentId primitive.ObjectID `json:"student_id" bson:"student_id"`
	SubjectId primitive.ObjectID `json:"subject_id" bson:"subject_id"`
	TutorId   primitive.ObjectID `json:"tutor_id" bson:"tutor_id"`
	CreatedAt time.Time          `json:"created_at" bson:"created_at"`
	UpdatedAt time.Time          `json:"updated_at" bson:"updated_at"`
}

type StudentSubjectTutorRepo

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

func NewStudentSubjectTutorRepo

func NewStudentSubjectTutorRepo(db db.IDatabase) *StudentSubjectTutorRepo

func (*StudentSubjectTutorRepo) CreateStudentSubjectTutor

func (sstr *StudentSubjectTutorRepo) CreateStudentSubjectTutor(studentSubjectTutor *StudentSubjectTutor) error

func (*StudentSubjectTutorRepo) GetStudentSubjectTutor

func (sstr *StudentSubjectTutorRepo) GetStudentSubjectTutor(filter interface{}) (*StudentSubjectTutor, error)

func (*StudentSubjectTutorRepo) GetStudentSubjectTutors

func (sstr *StudentSubjectTutorRepo) GetStudentSubjectTutors(filter interface{}) ([]*StudentSubjectTutor, error)

func (*StudentSubjectTutorRepo) StudentSubjectTutorExists

func (sstr *StudentSubjectTutorRepo) StudentSubjectTutorExists(filter interface{}) (bool, error)

type Subject

type Subject struct {
	Id         primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Name       string             `json:"name" bson:"name"`
	Compulsory bool               `json:"compulsory" bson:"compulsory"`
	CreatedAt  time.Time          `json:"created_at" bson:"created_at"`
	UpdatedAt  time.Time          `json:"updated_at" bson:"updated_at"`
}

type SubjectController

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

func NewSubjectController

func NewSubjectController(subjectService ISubjectService) *SubjectController

func (*SubjectController) CreateSubject

func (sc *SubjectController) CreateSubject(c *gin.Context)

type SubjectRepo

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

func NewSubjectRepo

func NewSubjectRepo(db db.IDatabase) *SubjectRepo

func (*SubjectRepo) CreateSubject

func (sr *SubjectRepo) CreateSubject(subject *Subject) error

func (*SubjectRepo) CreateSubjects

func (sr *SubjectRepo) CreateSubjects(subjects []*Subject) error

func (*SubjectRepo) GetSubject

func (sr *SubjectRepo) GetSubject(filter interface{}) (*Subject, error)

func (*SubjectRepo) GetSubjects

func (sr *SubjectRepo) GetSubjects(filter interface{}) ([]*Subject, error)

func (*SubjectRepo) SubjectExists

func (sr *SubjectRepo) SubjectExists(filter interface{}) (bool, error)

func (*SubjectRepo) UpdateSubject

func (sr *SubjectRepo) UpdateSubject(filter interface{}, update interface{}) error

type SubjectService

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

func NewSubjectService

func NewSubjectService(subjectRepo ISubjectRepo, compulsorySubjects ...string) (*SubjectService, error)

func (*SubjectService) CreateSubject

func (ss *SubjectService) CreateSubject(subject *Subject) error

Jump to

Keyboard shortcuts

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