Skip to content

postgres ​

go
import "github.com/prescriptoo/prescriptoo-api/services/admin/internal/adapters/postgres"

Package postgres provides PostgreSQL driven adapter implementations.

Index ​

func NewAdminRepository ​

go
func NewAdminRepository() ports.AdminRepository

NewAdminRepository returns an in-memory stub implementation.

func NewDoctorVerificationRepository ​

go
func NewDoctorVerificationRepository() ports.DoctorVerificationRepository

NewDoctorVerificationRepository returns an in-memory stub implementation.

func NewPgAdminRepository ​

go
func NewPgAdminRepository(db *pgxpool.Pool) ports.AdminRepository

NewPgAdminRepository returns the PostgreSQL implementation used by the API.

type MutationRunner ​

MutationRunner commits owner-managed business writes and their audit records together.

go
type MutationRunner struct {
    DB    *pgxpool.Pool
    Audit audit.TransactionalRecorderFactory
}

func (MutationRunner) Run ​

go
func (w MutationRunner) Run(ctx context.Context, op audit.OperationContext, fn func(ports.AdminRepository) error) error

Run runs a mutation with transaction-bound repositories and mandatory recording.

type VerificationStore ​

VerificationStore persists review history and its audit entries in the same transaction.

go
type VerificationStore struct {
    DB    *pgxpool.Pool
    Audit audit.TransactionalRecorderFactory
}

func (*VerificationStore) Get ​

go
func (r *VerificationStore) Get(ctx context.Context, id string) (*types.DoctorVerification, error)

Get reads a persisted submission by ID.

func (*VerificationStore) Latest ​

go
func (r *VerificationStore) Latest(ctx context.Context, ids []string) ([]types.DoctorVerification, error)

Latest reads the latest submission for each requested professional profile.

func (*VerificationStore) ListPending ​

go
func (r *VerificationStore) ListPending(ctx context.Context, limit int, cursor string) (*types.DoctorVerificationPage, error)

ListPending returns a newest-first cursor page of pending submissions.

func (*VerificationStore) Review ​

go
func (r *VerificationStore) Review(ctx context.Context, input ports.VerificationReview) (*types.DoctorVerification, error)

Review locks a pending submission and commits its decision and audit record together.

func (*VerificationStore) Submit ​

go
func (r *VerificationStore) Submit(ctx context.Context, op audit.OperationContext, v types.DoctorVerification) (*types.DoctorVerification, error)

Submit atomically stores a submission and its initiating audit record.

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.