Documentation ¶
Index ¶
- func WithClassroomRepository(cr ClassroomRepository) serviceConfiguration
- func WithLogger(l log.Logger) serviceConfiguration
- func WithSubscriptionRepository(sr SubscriptionRepository) serviceConfiguration
- type Classroom
- type ClassroomLesson
- type ClassroomRepository
- type Service
- func (s *Service) AddLesson(ctx context.Context, classroomID, lessonID uuid.UUID) error
- func (s *Service) Classroom(_ context.Context, id uuid.UUID) (Classroom, error)
- func (s *Service) Classrooms(_ context.Context) ([]Classroom, error)
- func (s *Service) CreateClassroom(_ context.Context, classroom *Classroom) (Classroom, error)
- func (s *Service) CreateSubscription(_ context.Context, subscription *Subscription) (Subscription, error)
- func (s *Service) DeleteClassroom(_ context.Context, id uuid.UUID) error
- func (s *Service) DeleteSubscription(ctx context.Context, id uuid.UUID) error
- func (s *Service) FindSubscription(_ context.Context, id uuid.UUID) (Subscription, error)
- func (s *Service) ListSubscription(_ context.Context) ([]Subscription, error)
- func (s *Service) RemoveLesson(ctx context.Context, classroomID, lessonID uuid.UUID) error
- func (s *Service) Subscription(ctx context.Context, id uuid.UUID) (Subscription, error)
- func (s *Service) Subscriptions(ctx context.Context) ([]Subscription, error)
- func (s *Service) UpdateClassroom(_ context.Context, classroom *Classroom) (Classroom, error)
- func (s *Service) UpdateSubscription(_ context.Context, subscription *Subscription) (Subscription, error)
- type ServiceInterface
- type Subscription
- type SubscriptionRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithClassroomRepository ¶
func WithClassroomRepository(cr ClassroomRepository) serviceConfiguration
WithClassroomRepository injects the course repository to the domain Service
func WithLogger ¶
WithLogger injects the logger to the domain Service
func WithSubscriptionRepository ¶
func WithSubscriptionRepository(sr SubscriptionRepository) serviceConfiguration
WithSubscriptionRepository injects the course repository to the domain Service
Types ¶
type Classroom ¶
type Classroom struct { ID uint `json:"id"` UUID uuid.UUID `json:"uuid"` Code string `json:"code"` Name string `json:"name"` Description string `json:"description"` Format string `json:"format"` CanSubscribe bool `db:"can_subscribe" json:"can_subscribe"` SubjectID *uuid.UUID `db:"subject_id" json:"subject_id"` CourseID uuid.UUID `db:"course_id" json:"course_id"` StartsAt time.Time `db:"starts_at" json:"starts_at"` EndsAt *time.Time `db:"ends_at" json:"ends_at"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` DeletedAt *time.Time `db:"deleted_at" json:"deleted_at"` }
type ClassroomLesson ¶
type ClassroomLesson struct { ID uint `json:"id"` UUID uuid.UUID `json:"uuid"` ClassroomID uuid.UUID `db:"classroom_id" json:"classroom_id"` SyllabusLessonID uuid.UUID `db:"syllabus_lessons_id" json:"syllabus_lessons_id"` StartsAt time.Time `db:"starts_at" json:"starts_at"` EndsAt *time.Time `db:"ends_at" json:"ends_at"` }
type ClassroomRepository ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) CreateClassroom ¶
func (*Service) CreateSubscription ¶
func (s *Service) CreateSubscription(_ context.Context, subscription *Subscription) (Subscription, error)
func (*Service) DeleteClassroom ¶
func (*Service) DeleteSubscription ¶
func (*Service) FindSubscription ¶
func (*Service) ListSubscription ¶
func (s *Service) ListSubscription(_ context.Context) ([]Subscription, error)
func (*Service) RemoveLesson ¶
func (*Service) Subscription ¶
func (*Service) Subscriptions ¶
func (s *Service) Subscriptions(ctx context.Context) ([]Subscription, error)
func (*Service) UpdateClassroom ¶
func (*Service) UpdateSubscription ¶
func (s *Service) UpdateSubscription(_ context.Context, subscription *Subscription) (Subscription, error)
type ServiceInterface ¶
type ServiceInterface interface { Classroom(ctx context.Context, id uuid.UUID) (Classroom, error) Classrooms(ctx context.Context) ([]Classroom, error) CreateClassroom(ctx context.Context, classroom *Classroom) (Classroom, error) UpdateClassroom(ctx context.Context, classroom *Classroom) (Classroom, error) DeleteClassroom(ctx context.Context, id uuid.UUID) error AddLesson(ctx context.Context, classroomID, lessonID uuid.UUID) error RemoveLesson(ctx context.Context, classroomID, lessonID uuid.UUID) error Subscription(ctx context.Context, id uuid.UUID) (Subscription, error) Subscriptions(ctx context.Context) ([]Subscription, error) CreateSubscription(ctx context.Context, subscription *Subscription) (Subscription, error) UpdateSubscription(ctx context.Context, subscription *Subscription) (Subscription, error) DeleteSubscription(ctx context.Context, id uuid.UUID) error }
type Subscription ¶
type Subscription struct { ID uint `json:"id"` UUID uuid.UUID `json:"uuid"` UserID uuid.UUID `json:"user_id"` ClassroomID uuid.UUID `json:"classroom_id"` Role string `json:"role"` ExpiresAt *time.Time `json:"expires_at"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at"` }
type SubscriptionRepository ¶
type SubscriptionRepository interface { Subscription(id uuid.UUID) (Subscription, error) Subscriptions() ([]Subscription, error) CreateSubscription(subscription *Subscription) (Subscription, error) UpdateSubscription(subscription *Subscription) (Subscription, error) DeleteSubscription(id uuid.UUID) error }
Click to show internal directories.
Click to hide internal directories.