Skip to content

ports ​

go
import "github.com/prescriptoo/prescriptoo-api/services/notification/internal/ports"

Package ports defines repository and provider interfaces for the notification service.

Index ​

type EmailProvider ​

EmailProvider defines the port for sending emails.

go
type EmailProvider = email.Sender

type NotificationRepository ​

NotificationRepository defines the driven repository port for notifications.

go
type NotificationRepository interface {
    Create(ctx context.Context, notification *domain.Notification) error
    GetByID(ctx context.Context, id string) (*domain.Notification, error)
    ListByStatus(ctx context.Context, status domain.Status) ([]*domain.Notification, error)
    ListByRecipient(ctx context.Context, recipient string) ([]*domain.Notification, error)
    UpdateStatus(ctx context.Context, id string, status domain.Status, errorMsg string) error
}

type SMSProvider ​

SMSProvider defines the port for sending SMS.

go
type SMSProvider interface {
    Send(ctx context.Context, to, message string) error
}

type TemplateRepository ​

TemplateRepository defines the driven repository port for templates.

go
type TemplateRepository interface {
    Create(ctx context.Context, template *domain.Template) error
    GetByID(ctx context.Context, id string) (*domain.Template, error)
    GetByName(ctx context.Context, name string) (*domain.Template, error)
    List(ctx context.Context) ([]*domain.Template, error)
    Update(ctx context.Context, template *domain.Template) error
    Delete(ctx context.Context, id string) error
}

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.