Skip to content

usecase ​

go
import "github.com/prescriptoo/prescriptoo-api/services/patient/internal/usecase"

Package usecase implements organization-scoped patient business operations.

Index ​

type CreatePatientUseCase ​

CreatePatientUseCase orchestrates authorized patient registration.

go
type CreatePatientUseCase struct {
    // contains filtered or unexported fields
}

func NewCreatePatientUseCase ​

go
func NewCreatePatientUseCase(d ...Dependencies) *CreatePatientUseCase

NewCreatePatientUseCase wires the patient registration dependencies.

func (*CreatePatientUseCase) Execute ​

go
func (uc *CreatePatientUseCase) Execute(ctx context.Context, in p.CreatePatientInput) (*p.Patient, error)

Execute validates current access and executes the requested patient operation.

type Dependencies ​

Dependencies are narrow provider-owned capabilities; no cross-service tables are queried.

go
type Dependencies struct {
    Identity               types.IIdentityService
    Accounts               identity.AccountReader
    AccountLocker          identity.ActiveAccountLocker
    Access                 org.PatientAccessReader
    AccessTransactions     org.PatientAccessTransactions
    Permissions            authz.OrganizationPermissionChecker
    PermissionTransactions authz.OrganizationPermissionTransactions
    Subscriptions          sub.TransactionServices
    Audit                  audit.TransactionalRecorderFactory
    Repository             ports.Repository
    Work                   ports.UnitOfWork
    EnforceSubscriptions   bool
    DefaultPhoneRegion     string
    Now                    func() time.Time
    NewID                  func() string
}

type GetPatientUseCase ​

GetPatientUseCase orchestrates authorized patient detail retrieval.

go
type GetPatientUseCase struct {
    // contains filtered or unexported fields
}

func NewGetPatientUseCase ​

go
func NewGetPatientUseCase(d ...Dependencies) *GetPatientUseCase

NewGetPatientUseCase wires the authorized patient reader.

func (*GetPatientUseCase) Execute ​

go
func (uc *GetPatientUseCase) Execute(ctx context.Context, in p.GetPatientInput) (*p.Patient, error)

Execute validates current access and executes the requested patient operation.

type ListPatientsUseCase ​

ListPatientsUseCase orchestrates access-filtered patient search.

go
type ListPatientsUseCase struct {
    // contains filtered or unexported fields
}

func NewListPatientsUseCase ​

go
func NewListPatientsUseCase(d ...Dependencies) *ListPatientsUseCase

NewListPatientsUseCase wires the patient search dependencies.

func (*ListPatientsUseCase) Execute ​

go
func (uc *ListPatientsUseCase) Execute(ctx context.Context, in p.ListPatientsInput) (*p.Page[p.Patient], error)

Execute validates current access and executes the requested patient operation.

type PatchPatientUseCase ​

PatchPatientUseCase orchestrates version-protected patient updates.

go
type PatchPatientUseCase struct {
    // contains filtered or unexported fields
}

func NewPatchPatientUseCase ​

go
func NewPatchPatientUseCase(d ...Dependencies) *PatchPatientUseCase

NewPatchPatientUseCase wires the patient update dependencies.

func (*PatchPatientUseCase) Execute ​

go
func (uc *PatchPatientUseCase) Execute(ctx context.Context, in p.PatchPatientInput) (*p.Patient, error)

Execute validates current access and executes the requested patient operation.

type Service ​

Service coordinates patient authentication, authorization, subscription and audit checks.

go
type Service struct{ Dependencies }

func New ​

go
func New(d Dependencies) *Service

New constructs a patient collaborator with explicit dependencies.

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.