Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInviteNotFound = customerror.Make("convite não encontrado", http.StatusNotFound, errors.New("ErrInviteNotFound")) ErrInviteInactive = customerror.Make("convite inativo", http.StatusBadRequest, errors.New("ErrInviteInactive")) ErrInviteExpired = customerror.Make("convite expirado", http.StatusBadRequest, errors.New("ErrInviteExpired")) ErrNotDisciplineOwner = customerror.Make("você não tem permissão para esta disciplina", http.StatusForbidden, errors.New("ErrNotDisciplineOwner")) ErrEnrollmentNotFound = customerror.Make("estudante não está vinculado à disciplina", http.StatusBadRequest, errors.New("ErrEnrollmentNotFound")) ErrEnrollmentRegistrationComplete = customerror.Make("cadastro desta matrícula já foi concluído para esta disciplina", http.StatusConflict, errors.New("ErrEnrollmentRegistrationComplete")) ErrStudentNotFound = customerror.Make("estudante não encontrado", http.StatusNotFound, errors.New("ErrStudentNotFound")) ErrConsentRequired = customerror.Make("é necessário aceitar o recebimento automatizado de notificações", http.StatusBadRequest, errors.New("ErrConsentRequired")) ErrContactRequired = customerror.Make("preencha nome, email e telefone, ou informe que não possui telefone, para concluir o cadastro", http.StatusBadRequest, errors.New("ErrContactRequired")) )
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler interface {
Create() gin.HandlerFunc
GetCurrent() gin.HandlerFunc
ListByDiscipline() gin.HandlerFunc
Delete() gin.HandlerFunc
SelfRegister() gin.HandlerFunc
}
func NewHandler ¶
type Repository ¶
type Repository interface {
database.Transactional
Create(ctx context.Context, disciplineID, code string, expiresAt *time.Time) error
FindByID(ctx context.Context, id string) (*Invite, error)
FindByCode(ctx context.Context, code string) (*Invite, error)
FindLatestByDisciplineID(ctx context.Context, disciplineID string) (*Invite, error)
FindByDisciplineID(ctx context.Context, disciplineID string) ([]*Invite, error)
Delete(ctx context.Context, id string) error
}
func NewRepository ¶
func NewRepository(db *sql.DB) Repository
type Service ¶
type Service interface {
Create(ctx context.Context, disciplineID, userID string, expiresAt *time.Time) (*Invite, error)
GetCurrent(ctx context.Context, disciplineID, userID string) (*Invite, error)
ListByDiscipline(ctx context.Context, disciplineID, userID string) ([]*Invite, error)
Delete(ctx context.Context, inviteID, userID string) error
SelfRegister(ctx context.Context, code, studentID, name, phone string, noPhone bool, email string, consent bool) error
}
func NewService ¶
func NewService( inviteRepository Repository, disciplineRepository discipline.Repository, enrollmentRepository enrollment.Repository, studentRepository student.Repository, ) Service
Click to show internal directories.
Click to hide internal directories.