Skip to content

ports ​

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

Package ports defines Doctor persistence boundaries.

Package ports defines the doctor service's persistence capabilities.

Index ​

type ListPage ​

ListPage includes the authorized total before the cursor boundary is applied.

go
type ListPage struct {
    Items      []types.PatientProfile
    TotalItems int
}

type ListQuery ​

ListQuery contains trusted access predicates and a keyset boundary.

go
type ListQuery struct {
    OrganizationID, ActorID, Query string
    Limit                          int
    BeforeTime                     time.Time
    BeforeID                       string
}

type PatientRepository ​

PatientRepository persists Patient-owned records and retry state.

go
type PatientRepository interface {
    Scope(context.Context, string) (Scope, error)
    Get(context.Context, string, string, bool) (*types.PatientProfile, error)
    List(context.Context, ListQuery) (*ListPage, error)
    Create(context.Context, *types.PatientProfile) error
    Update(context.Context, *types.PatientProfile, int64) error
    NextMRN(context.Context, string) (string, error)
    FindRequest(context.Context, string, string, string) (string, string, error)
    SaveRequest(context.Context, string, string, string, string, string, time.Time) error
}

type PatientTransaction ​

PatientTransaction binds patient persistence to a caller-owned provider transaction.

go
type PatientTransaction struct {
    Repository PatientRepository
    Tx         pgx.Tx
}

type PatientUnitOfWork ​

PatientUnitOfWork commits patient business changes and provider effects atomically.

go
type PatientUnitOfWork interface {
    WithinTransaction(context.Context, func(PatientTransaction) error) error
}

type ProfileDirectoryRepository ​

ProfileDirectoryRepository supports administrative professional record lookup.

go
type ProfileDirectoryRepository interface {
    ProfileRepository
    GetByID(context.Context, string) (*domain.Profile, error)
    List(context.Context) ([]domain.Profile, error)
}

type ProfileRepository ​

ProfileRepository looks up the professional profile belonging to an identity.

go
type ProfileRepository interface {
    GetByUserID(context.Context, string) (*domain.Profile, error)
}

type Scope ​

Scope contains only the stored facts needed to establish patient access.

go
type Scope struct{ OrganizationID, CreatedByUserID string }

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.