student

package
v0.0.0-...-587043a Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 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 Repository

type Repository interface {
	AddStudent(student *entities.Student) (*entities.Student, error)
	AuthenticateStudent(email, password string) (*entities.Student, error)
	GetStudentByEmail(email string) (*entities.Student, error)
	UpdateStudentPassword(studentID, hashedPassword string) error
	BorrowBook(bookID, studentID string) (string, error)
	DeliverBook(borrowID, bookID, studentID string) (string, error)
	ExtendDate(borrowID string) (string, error)
	GetBorrowedBooks(studentID string) ([]entities.BorrowedBook, error)
}

TODO add mail notifications && cron jobs

func NewRepo

func NewRepo(db *pgx.Conn) Repository

type Service

type Service interface {
	InsertStudent(student *entities.Student) (*entities.Student, error)
	SignIn(email, password string) (string, *entities.Student, error)
	RequestPasswordReset(email string) error
	ResetPassword(token, newPassword string) error
	BookBorrow(bookID, studentID string) (string, error)
	DeliverBook(borrowID, bookID, studentID string) (string, error)
	ExtendDate(borrowID string) (string, error)
	GetBorrowedBooks(studentID string) ([]*entities.BorrowedBook, error)
}

func NewService

func NewService(r Repository) Service

Jump to

Keyboard shortcuts

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