Skip to content

module ​

go
import "github.com/prescriptoo/prescriptoo-api/services/organization/module"

Package module provides the organization module's public API.

Index ​

type AuthorizationDependencies ​

AuthorizationDependencies selects the capabilities consumed by authorization HTTP endpoints.

go
type AuthorizationDependencies struct {
    IdentityService types.IIdentityService
    AccountReader   identitypublic.AccountReader

    ListPermissions        p.PermissionLister
    ListRoles              p.RoleLister
    GetRole                p.RoleReader
    CreateRole             p.RoleCreator
    UpdateRole             p.RoleEditor
    DeleteRole             p.RoleDeleter
    SetRolePermissions     p.RolePermissionSetter
    GetMemberAuthorization p.MemberAuthorizationReader
    AssignRole             p.RoleAssigner
    RevokeRole             p.RoleRevoker
    SetMemberPermission    p.MemberPermissionSetter
    RemoveMemberPermission p.MemberPermissionRemover
}

type BillingReadDependencies ​

BillingReadDependencies exposes the selected persistent billing capability.

go
type BillingReadDependencies = usecase.BillingReadDependencies

type DoctorDirectoryDependencies ​

DoctorDirectoryDependencies configures the organization doctor list.

go
type DoctorDirectoryDependencies = usecase.OrganizationDoctorDependencies

type Module ​

Module is the organization module's public interface.

go
type Module struct {
    module.Module
    // contains filtered or unexported fields
}

func NewModule ​

go
func NewModule(bus events.Bus, databases ...*pgxpool.Pool) *Module

NewModule creates and wires the organization module.

func (*Module) Administration ​

go
func (m *Module) Administration() organizationpublic.AdminOrganizationService

Administration returns the organization and membership service used by Admin.

func (*Module) AuthorizationMemberships ​

go
func (m *Module) AuthorizationMemberships() p.AuthorizationMembershipReader

AuthorizationMemberships exposes the owning service's current membership reader.

func (*Module) BillingOrganizations ​

go
func (m *Module) BillingOrganizations() p.BillingOrganizations

BillingOrganizations exposes Organization-owned locking and relationship usage for billing.

func (*Module) ConfigureAssignmentAccounts ​

go
func (m *Module) ConfigureAssignmentAccounts(accounts identitypublic.ActiveAccountLocker)

ConfigureAssignmentAccounts injects Identity's transactional account checker into the Organization-owned affiliation writer before routes are served. Offline/test construction may have no persistent writer; no substitute account policy is installed, and persistent assignments require the real checker at execution.

func (*Module) ConfigureAudit ​

go
func (m *Module) ConfigureAudit(db *pgxpool.Pool, writer audit.TransactionalRecorderFactory)

ConfigureAudit installs mandatory transactional recording for persistent writes.

func (*Module) ConfigureAuditReads ​

go
func (m *Module) ConfigureAuditReads(identity types.IIdentityService, lister audit.EventLister, reader audit.EventReader)

ConfigureAuditReads wires the history endpoints before the service registers HTTP routes.

func (*Module) ConfigureAuthentication ​

go
func (m *Module) ConfigureAuthentication(identity types.IIdentityService, accounts identitypublic.AccountReader, authentication identitypublic.AuthenticationService)

ConfigureAuthentication supplies the identity capabilities used to authenticate organization members.

func (*Module) ConfigureAuthorization ​

go
func (m *Module) ConfigureAuthorization(deps AuthorizationDependencies)

ConfigureAuthorization is called once by the composition root before serving.

func (*Module) ConfigureBillingReads ​

go
func (m *Module) ConfigureBillingReads(deps usecase.BillingReadDependencies)

ConfigureBillingReads injects tenant-scoped billing read dependencies before route registration.

func (*Module) ConfigureDoctorDirectory ​

go
func (m *Module) ConfigureDoctorDirectory(deps usecase.OrganizationDoctorDependencies)

ConfigureDoctorDirectory stores the provider set for the organization doctor-list use case. Call it during composition, before RegisterHuma constructs the handler; providers are not swapped while requests are running. An omitted set leaves the registered operation unavailable rather than exposing unscoped directory data.

func (*Module) ConfigureSubscriptionPolicy ​

go
func (m *Module) ConfigureSubscriptionPolicy(db *pgxpool.Pool, writer audit.TransactionalRecorderFactory, services sub.TransactionServices, enforce bool)

ConfigureSubscriptionPolicy injects protected use-case policy before mutation capabilities are served.

func (*Module) DoctorAffiliationStatuses ​

go
func (m *Module) DoctorAffiliationStatuses() org.DoctorAffiliationStatusWriter

DoctorAffiliationStatuses returns the Organization-owned status mutation capability.

func (*Module) DoctorAffiliations ​

go
func (m *Module) DoctorAffiliations() organizationpublic.AdminDoctorAffiliations

DoctorAffiliations returns organization-owned professional affiliation capabilities.

func (*Module) DoctorInvitations ​

go
func (m *Module) DoctorInvitations() p.DoctorInvitationRedeemer

DoctorInvitations supplies organization-owned redemption for doctor onboarding.

func (*Module) DoctorOrganizationService ​

go
func (m *Module) DoctorOrganizationService() ports.DoctorOrganizationService

DoctorOrganizationService returns organization-owned discovery for authenticated doctors.

func (*Module) DoctorReader ​

go
func (m *Module) DoctorReader() org.OrganizationDoctorReader

DoctorReader returns the shared reader configured before routes are served.

func (*Module) Insights ​

go
func (m *Module) Insights() p.Insights

Insights exposes the Organization-owned usage/affiliation reader using the same database as affiliation writes. An unwired module returns an unavailable adapter rather than inventing empty counts for documentation-only construction.

func (*Module) PatientAccess ​

go
func (m *Module) PatientAccess(db *pgxpool.Pool) interface {
    p.DoctorAffiliationReader
    p.PatientAccessReader
    p.PatientAccessTransactions
}

PatientAccess supplies pure and transaction-bound Organization-owned access reads.

func (*Module) RegisterHuma ​

go
func (m *Module) RegisterHuma(api huma.API)

RegisterHuma exposes portal contracts without changing admin-facing capabilities.

func (*Module) Routes ​

go
func (m *Module) Routes() http.Handler

Routes returns preserved legacy operations; portal contracts use RegisterHuma.

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.