Skip to content

ports ​

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

Package ports defines repository interfaces for the admin service.

Index ​

type AdminIdentityService ​

AdminIdentityService provisions and retrieves identity accounts for Admin.

go
type AdminIdentityService = identitypublic.AdminIdentityService

type AdminOrganizationService ​

AdminOrganizationService manages organizations and their memberships for Admin.

go
type AdminOrganizationService = organizationpublic.AdminOrganizationService

type AdminRepository ​

AdminRepository defines the driven repository port for admins.

go
type AdminRepository interface {
    Create(ctx context.Context, admin *domain.Admin) error
    GetByID(ctx context.Context, id string) (*domain.Admin, error)
    GetByUserID(ctx context.Context, userID string) (*domain.Admin, error)
    List(ctx context.Context) ([]*domain.Admin, error)
    Update(ctx context.Context, admin *domain.Admin) error
    Delete(ctx context.Context, id string) error
}

type DoctorVerificationRepository ​

DoctorVerificationRepository defines the driven repository port for doctor verifications.

go
type DoctorVerificationRepository interface {
    Create(ctx context.Context, verification *domain.DoctorVerification) error
    GetByID(ctx context.Context, id string) (*domain.DoctorVerification, error)
    ListByStatus(ctx context.Context, status domain.VerificationStatus) ([]*domain.DoctorVerification, error)
    ListByDoctorProfileID(ctx context.Context, doctorProfileID string) ([]*domain.DoctorVerification, error)
    ListPending(ctx context.Context) ([]*domain.DoctorVerification, error)
    Update(ctx context.Context, verification *domain.DoctorVerification) error
    Approve(ctx context.Context, id string, adminUserID string, notes string) error
    Reject(ctx context.Context, id string, adminUserID string, reason string) error
}

type MutationRunner ​

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

go
type MutationRunner interface {
    Run(context.Context, audit.OperationContext, func(AdminRepository) error) error
}

type VerificationReview ​

VerificationReview contains the authoritative state transition and trusted actor.

go
type VerificationReview struct {
    Audit                     audit.OperationContext
    ID, Status, Notes, Reason string
}

type VerificationStore ​

VerificationStore is the Admin-owned professional verification persistence capability.

go
type VerificationStore interface {
    Submit(context.Context, audit.OperationContext, types.DoctorVerification) (*types.DoctorVerification, error)
    Get(context.Context, string) (*types.DoctorVerification, error)
    ListPending(context.Context, int, string) (*types.DoctorVerificationPage, error)
    Latest(context.Context, []string) ([]types.DoctorVerification, error)
    Review(context.Context, VerificationReview) (*types.DoctorVerification, error)
}

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.