module
import "github.com/prescriptoo/prescriptoo-api/services/organization/module"Package module provides the organization module's public API.
Index
- type AuthorizationDependencies
- type BillingReadDependencies
- type DoctorDirectoryDependencies
- type Module
- func NewModule(bus events.Bus, databases ...*pgxpool.Pool) *Module
- func (m *Module) Administration() organizationpublic.AdminOrganizationService
- func (m *Module) AuthorizationMemberships() p.AuthorizationMembershipReader
- func (m *Module) BillingOrganizations() p.BillingOrganizations
- func (m *Module) ConfigureAssignmentAccounts(accounts identitypublic.ActiveAccountLocker)
- func (m *Module) ConfigureAudit(db *pgxpool.Pool, writer audit.TransactionalRecorderFactory)
- func (m *Module) ConfigureAuditReads(identity types.IIdentityService, lister audit.EventLister, reader audit.EventReader)
- func (m *Module) ConfigureAuthentication(identity types.IIdentityService, accounts identitypublic.AccountReader, authentication identitypublic.AuthenticationService)
- func (m *Module) ConfigureAuthorization(deps AuthorizationDependencies)
- func (m *Module) ConfigureBillingReads(deps usecase.BillingReadDependencies)
- func (m *Module) ConfigureDoctorDirectory(deps usecase.OrganizationDoctorDependencies)
- func (m *Module) ConfigureSubscriptionPolicy(db *pgxpool.Pool, writer audit.TransactionalRecorderFactory, services sub.TransactionServices, enforce bool)
- func (m *Module) DoctorAffiliationStatuses() org.DoctorAffiliationStatusWriter
- func (m *Module) DoctorAffiliations() organizationpublic.AdminDoctorAffiliations
- func (m *Module) DoctorInvitations() p.DoctorInvitationRedeemer
- func (m *Module) DoctorOrganizationService() ports.DoctorOrganizationService
- func (m *Module) DoctorReader() org.OrganizationDoctorReader
- func (m *Module) Insights() p.Insights
- func (m *Module) PatientAccess(db *pgxpool.Pool) interface { p.DoctorAffiliationReader p.PatientAccessReader p.PatientAccessTransactions }
- func (m *Module) RegisterHuma(api huma.API)
- func (m *Module) Routes() http.Handler
type AuthorizationDependencies
AuthorizationDependencies selects the capabilities consumed by authorization HTTP endpoints.
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.
type BillingReadDependencies = usecase.BillingReadDependenciestype DoctorDirectoryDependencies
DoctorDirectoryDependencies configures the organization doctor list.
type DoctorDirectoryDependencies = usecase.OrganizationDoctorDependenciestype Module
Module is the organization module's public interface.
type Module struct {
module.Module
// contains filtered or unexported fields
}func NewModule
func NewModule(bus events.Bus, databases ...*pgxpool.Pool) *ModuleNewModule creates and wires the organization module.
func (*Module) Administration
func (m *Module) Administration() organizationpublic.AdminOrganizationServiceAdministration returns the organization and membership service used by Admin.
func (*Module) AuthorizationMemberships
func (m *Module) AuthorizationMemberships() p.AuthorizationMembershipReaderAuthorizationMemberships exposes the owning service's current membership reader.
func (*Module) BillingOrganizations
func (m *Module) BillingOrganizations() p.BillingOrganizationsBillingOrganizations exposes Organization-owned locking and relationship usage for billing.
func (*Module) ConfigureAssignmentAccounts
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
func (m *Module) ConfigureAudit(db *pgxpool.Pool, writer audit.TransactionalRecorderFactory)ConfigureAudit installs mandatory transactional recording for persistent writes.
func (*Module) ConfigureAuditReads
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
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
func (m *Module) ConfigureAuthorization(deps AuthorizationDependencies)ConfigureAuthorization is called once by the composition root before serving.
func (*Module) ConfigureBillingReads
func (m *Module) ConfigureBillingReads(deps usecase.BillingReadDependencies)ConfigureBillingReads injects tenant-scoped billing read dependencies before route registration.
func (*Module) ConfigureDoctorDirectory
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
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
func (m *Module) DoctorAffiliationStatuses() org.DoctorAffiliationStatusWriterDoctorAffiliationStatuses returns the Organization-owned status mutation capability.
func (*Module) DoctorAffiliations
func (m *Module) DoctorAffiliations() organizationpublic.AdminDoctorAffiliationsDoctorAffiliations returns organization-owned professional affiliation capabilities.
func (*Module) DoctorInvitations
func (m *Module) DoctorInvitations() p.DoctorInvitationRedeemerDoctorInvitations supplies organization-owned redemption for doctor onboarding.
func (*Module) DoctorOrganizationService
func (m *Module) DoctorOrganizationService() ports.DoctorOrganizationServiceDoctorOrganizationService returns organization-owned discovery for authenticated doctors.
func (*Module) DoctorReader
func (m *Module) DoctorReader() org.OrganizationDoctorReaderDoctorReader returns the shared reader configured before routes are served.
func (*Module) Insights
func (m *Module) Insights() p.InsightsInsights 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
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
func (m *Module) RegisterHuma(api huma.API)RegisterHuma exposes portal contracts without changing admin-facing capabilities.
func (*Module) Routes
func (m *Module) Routes() http.HandlerRoutes returns preserved legacy operations; portal contracts use RegisterHuma.
Generated by gomarkdoc