usecase
import "github.com/prescriptoo/prescriptoo-api/services/patient/internal/usecase"Package usecase implements organization-scoped patient business operations.
Index
- type CreatePatientUseCase
- type Dependencies
- type GetPatientUseCase
- type ListPatientsUseCase
- type PatchPatientUseCase
- type Service
type CreatePatientUseCase
CreatePatientUseCase orchestrates authorized patient registration.
type CreatePatientUseCase struct {
// contains filtered or unexported fields
}func NewCreatePatientUseCase
func NewCreatePatientUseCase(d ...Dependencies) *CreatePatientUseCaseNewCreatePatientUseCase wires the patient registration dependencies.
func (*CreatePatientUseCase) Execute
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.
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.
type GetPatientUseCase struct {
// contains filtered or unexported fields
}func NewGetPatientUseCase
func NewGetPatientUseCase(d ...Dependencies) *GetPatientUseCaseNewGetPatientUseCase wires the authorized patient reader.
func (*GetPatientUseCase) Execute
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.
type ListPatientsUseCase struct {
// contains filtered or unexported fields
}func NewListPatientsUseCase
func NewListPatientsUseCase(d ...Dependencies) *ListPatientsUseCaseNewListPatientsUseCase wires the patient search dependencies.
func (*ListPatientsUseCase) Execute
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.
type PatchPatientUseCase struct {
// contains filtered or unexported fields
}func NewPatchPatientUseCase
func NewPatchPatientUseCase(d ...Dependencies) *PatchPatientUseCaseNewPatchPatientUseCase wires the patient update dependencies.
func (*PatchPatientUseCase) Execute
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.
type Service struct{ Dependencies }func New
func New(d Dependencies) *ServiceNew constructs a patient collaborator with explicit dependencies.
Generated by gomarkdoc