Skip to content

ports ​

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

Package ports defines repository interfaces for the prescription service.

Index ​

type FinalPrescriptionListQuery ​

FinalPrescriptionListQuery adds a validated keyset boundary to trusted organization filters.

go
type FinalPrescriptionListQuery struct {
    Input      c.FinalPrescriptionListInput
    BeforeTime time.Time
    BeforeID   string
}

type FinalPrescriptionRepository ​

FinalPrescriptionRepository persists immutable documents and successful retry identities.

go
type FinalPrescriptionRepository interface {
    FindRequest(context.Context, string, string, string) (string, *c.FinalPrescriptionMetadata, error)
    NextNumber(context.Context, string) (string, error)
    Create(context.Context, c.SaveFinalPrescriptionInput, c.FinalPrescriptionMetadata, string, []c.FinalCanonicalProduct) error
    SaveRequest(context.Context, c.SaveFinalPrescriptionInput, c.FinalPrescriptionMetadata) error
    Get(context.Context, string, string) (*c.FinalPrescriptionRecord, error)
    List(context.Context, FinalPrescriptionListQuery) ([]c.FinalPrescriptionSummary, error)
}

type FinalPrescriptionTransaction ​

FinalPrescriptionTransaction keeps every write and provider effect on one transaction.

go
type FinalPrescriptionTransaction struct {
    Tx         pgx.Tx
    Repository FinalPrescriptionRepository
}

type FinalPrescriptionUnitOfWork ​

FinalPrescriptionUnitOfWork commits document, audit and retry state atomically.

go
type FinalPrescriptionUnitOfWork interface {
    WithinFinalPrescriptionTransaction(context.Context, func(FinalPrescriptionTransaction) error) error
}

type PrescriptionItemRepository ​

PrescriptionItemRepository defines the driven repository port for prescription items.

go
type PrescriptionItemRepository interface {
    Create(ctx context.Context, item *domain.PrescriptionItem) error
    ListByPrescriptionID(ctx context.Context, prescriptionID string) ([]*domain.PrescriptionItem, error)
    DeleteByPrescriptionID(ctx context.Context, prescriptionID string) error
}

type PrescriptionRepository ​

PrescriptionRepository defines the driven repository port for prescriptions.

go
type PrescriptionRepository interface {
    Create(ctx context.Context, prescription *domain.Prescription) error
    GetByID(ctx context.Context, id string) (*domain.Prescription, error)
    ListByDoctorID(ctx context.Context, doctorID string) ([]*domain.Prescription, error)
    ListByOrganizationID(ctx context.Context, orgID string) ([]*domain.Prescription, error)
    Update(ctx context.Context, prescription *domain.Prescription) error
    UpdateStatus(ctx context.Context, id string, status domain.PrescriptionStatus) error
    Delete(ctx context.Context, id string) error
}

type SuggestionAdviceRepository ​

SuggestionAdviceRepository persists the global advice suggestion catalog.

go
type SuggestionAdviceRepository interface {
    Create(context.Context, domain.SuggestionAdvice) error
    Get(context.Context, string) (*domain.SuggestionAdvice, error)
    // List returns up to Limit+1 entries ordered by label and ID ascending.
    List(context.Context, domain.SuggestionQuery) ([]domain.SuggestionAdvice, error)
    Update(context.Context, domain.SuggestionAdvice) error
    Delete(context.Context, string) error
}

type SuggestionDiagnosisRepository ​

SuggestionDiagnosisRepository persists the global diagnosis suggestion catalog.

go
type SuggestionDiagnosisRepository interface {
    Create(context.Context, domain.SuggestionDiagnosis) error
    Get(context.Context, string) (*domain.SuggestionDiagnosis, error)
    // List returns up to Limit+1 entries ordered by label and ID ascending.
    List(context.Context, domain.SuggestionQuery) ([]domain.SuggestionDiagnosis, error)
    Update(context.Context, domain.SuggestionDiagnosis) error
    Delete(context.Context, string) error
}

type SuggestionInvestigationRepository ​

SuggestionInvestigationRepository persists the global investigation suggestion catalog.

go
type SuggestionInvestigationRepository interface {
    Create(context.Context, domain.SuggestionInvestigation) error
    Get(context.Context, string) (*domain.SuggestionInvestigation, error)
    // List returns up to Limit+1 entries ordered by label and ID ascending.
    List(context.Context, domain.SuggestionQuery) ([]domain.SuggestionInvestigation, error)
    Update(context.Context, domain.SuggestionInvestigation) error
    Delete(context.Context, string) error
}

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.