usecase
import "github.com/prescriptoo/prescriptoo-api/services/organization/internal/usecase"Package usecase contains single-task use case implementations.
Index
- Variables
- type AcceptDoctorJoinRequestInput
- type AcceptDoctorJoinRequestUseCase
- type AcceptInvitationUseCase
- type ActiveOrganizationContext
- type AddMemberParams
- type AddOrganizationMemberInput
- type AddOrganizationMemberUseCase
- type AffiliatedDoctor
- type AssignMemberRoleParams
- type AssignMemberTeamInput
- type AssignMemberTeamParams
- type AssignMemberTeamUseCase
- type AssignOrganizationMemberRoleInput
- type AssignOrganizationMemberRoleUseCase
- type BillingReadDependencies
- type ChangeOrganizationStatusUseCase
- type CreateActiveMemberUseCase
- type CreateAdminOrganizationUseCase
- type CreateOrgDTO
- type CreateOrganizationUseCase
- type CreateTeamDTO
- type CreateTeamUseCase
- type DeleteOrganizationTeamInput
- type DeleteOrganizationTeamUseCase
- type EditMemberParams
- type EditOrganizationMemberInput
- type EditOrganizationMemberUseCase
- type GetActiveOrganizationContextInput
- type GetActiveOrganizationContextUseCase
- type GetOrganizationProfileInput
- type GetOrganizationProfileUseCase
- func NewGetOrganizationProfileUseCase(identity types.IIdentityService, accounts identitypublic.AccountReader, organizations ports.OrganizationRepository, members ports.MemberRepository, authorization authorizationpublic.MemberAuthorizationReader) *GetOrganizationProfileUseCase
- func (uc *GetOrganizationProfileUseCase) Execute(ctx context.Context, input GetOrganizationProfileInput) (*domain.OrganizationProfile, error)
- type GetOrganizationTeamInput
- type GetOrganizationTeamUseCase
- type GetOrganizationUseCase
- type InviteDoctorParams
- type InviteMemberDTO
- type InviteMemberUseCase
- type InviteOrganizationDoctorInput
- type InviteOrganizationDoctorUseCase
- type InvoiceView
- type ListDoctorInvitationsInput
- type ListDoctorInvitationsUseCase
- type ListIncomingDoctorJoinRequestsInput
- type ListIncomingDoctorJoinRequestsUseCase
- type ListMembersUseCase
- type ListMyOrganizationsInput
- type ListMyOrganizationsUseCase
- type ListOrganizationDoctorsInput
- type ListOrganizationDoctorsUseCase
- type ListOrganizationInvoicesInput
- type ListOrganizationInvoicesUseCase
- type ListOrganizationMembersInput
- type ListOrganizationMembersUseCase
- type ListOrganizationsUseCase
- type ListTeamsUseCase
- type LoginInput
- type LoginUseCase
- type ManagementEmpty
- type MemberView
- type NewMemberIdentity
- type OrganizationDoctor
- type OrganizationDoctorDependencies
- type OrganizationDoctorItem
- type OrganizationDoctorReader
- type OrganizationDoctorsPage
- type PatchDoctorAffiliationInput
- type PatchDoctorAffiliationParams
- type PatchDoctorAffiliationUseCase
- type PatchOrganizationTeamInput
- type PatchOrganizationTeamParams
- type PatchOrganizationTeamUseCase
- type PatchPortalOrganizationInput
- type PatchPortalOrganizationParams
- type PatchPortalOrganizationUseCase
- type PortalPage
- type RejectDoctorJoinRequestInput
- type RejectDoctorJoinRequestUseCase
- type RemoveMemberUseCase
- type RevokeDoctorInvitationInput
- type RevokeDoctorInvitationUseCase
- type SetActiveContextUseCase
- type SubscriptionPlanView
- type SubscriptionPolicy
- type SubscriptionView
- type TeamView
- type UpdateMemberRoleUseCase
- type UpdateOrganizationDTO
- type UpdateOrganizationUseCase
- type VerifiedOrganizationMember
- type VerifyAuthInput
- type VerifyAuthUseCase
- func NewVerifyAuthUseCase(identity types.IIdentityService, accounts identitypublic.AccountReader, organizations ports.OrganizationRepository, members ports.MemberRepository) *VerifyAuthUseCase
- func (uc *VerifyAuthUseCase) Execute(ctx context.Context, input VerifyAuthInput) (*VerifiedOrganizationMember, error)
- type ViewOrganizationDoctorInput
- type ViewOrganizationDoctorUseCase
- type ViewOrganizationInput
- type ViewOrganizationMemberInput
- type ViewOrganizationMemberUseCase
- type ViewOrganizationSubscriptionInput
- type ViewOrganizationSubscriptionUseCase
- type ViewOrganizationUseCase
Variables
ErrNotImplemented marks documentation-first portal operations; legacy and admin capabilities are unaffected.
var ErrNotImplemented = errors.New("organization operation is not implemented")type AcceptDoctorJoinRequestInput
AcceptDoctorJoinRequestInput contains the accept doctor join request request parameters.
type AcceptDoctorJoinRequestInput struct {
Authorization string
OrganizationID string
RequestID string
}type AcceptDoctorJoinRequestUseCase
AcceptDoctorJoinRequestUseCase defines the unimplemented accept doctor join request operation.
type AcceptDoctorJoinRequestUseCase struct{}func NewAcceptDoctorJoinRequestUseCase
func NewAcceptDoctorJoinRequestUseCase() *AcceptDoctorJoinRequestUseCaseNewAcceptDoctorJoinRequestUseCase creates the documentation-first accept doctor join request use case.
func (*AcceptDoctorJoinRequestUseCase) Execute
func (uc *AcceptDoctorJoinRequestUseCase) Execute(_ context.Context, _ AcceptDoctorJoinRequestInput) (*organizationpublic.DoctorAffiliation, error)Execute returns ErrNotImplemented until the operation is implemented.
type AcceptInvitationUseCase
AcceptInvitationUseCase handles accepting a membership invitation.
type AcceptInvitationUseCase struct {
// contains filtered or unexported fields
}func NewAcceptInvitationUseCase
func NewAcceptInvitationUseCase(repo ports.MemberRepository) *AcceptInvitationUseCaseNewAcceptInvitationUseCase instantiates a new AcceptInvitationUseCase.
func (*AcceptInvitationUseCase) Execute
func (uc *AcceptInvitationUseCase) Execute(ctx context.Context, membershipID string) errorExecute accepts a membership invitation.
type ActiveOrganizationContext
ActiveOrganizationContext returns the selected organization and the caller's relationship to it.
type ActiveOrganizationContext struct {
Organization organizationpublic.Organization `json:"organization"`
Member *MemberView `json:"member,omitempty"`
Affiliation *organizationpublic.DoctorAffiliation `json:"affiliation,omitempty"`
}type AddMemberParams
AddMemberParams selects exactly one identity source and assigns an ordinary membership role.
type AddMemberParams struct {
ExistingUserID string `json:"existing_user_id,omitempty" minLength:"1" doc:"Existing identity account ID. Exactly one of existing_user_id or new_user is required."`
NewUser *NewMemberIdentity `json:"new_user,omitempty" doc:"New identity account. Exactly one of existing_user_id or new_user is required."`
Role string `json:"role" enum:"admin,doctor,staff" doc:"An ordinary membership role; doctor does not create a doctor affiliation."`
}type AddOrganizationMemberInput
AddOrganizationMemberInput contains the add organization member request parameters.
type AddOrganizationMemberInput struct {
Authorization string
OrganizationID string
Params AddMemberParams
}type AddOrganizationMemberUseCase
AddOrganizationMemberUseCase defines the unimplemented add organization member operation.
type AddOrganizationMemberUseCase struct{}func NewAddOrganizationMemberUseCase
func NewAddOrganizationMemberUseCase() *AddOrganizationMemberUseCaseNewAddOrganizationMemberUseCase creates the documentation-first add organization member use case.
func (*AddOrganizationMemberUseCase) Execute
func (uc *AddOrganizationMemberUseCase) Execute(_ context.Context, _ AddOrganizationMemberInput) (*MemberView, error)Execute returns ErrNotImplemented until the operation is implemented.
type AffiliatedDoctor
AffiliatedDoctor combines an organization-owned affiliation with a doctor-owned professional profile.
type AffiliatedDoctor struct {
Doctor doctorpublic.Profile `json:"doctor"`
Affiliation organizationpublic.DoctorAffiliation `json:"affiliation"`
}type AssignMemberRoleParams
AssignMemberRoleParams assigns an ordinary membership role without creating a doctor affiliation.
type AssignMemberRoleParams struct {
Role string `json:"role" enum:"admin,doctor,staff"`
}type AssignMemberTeamInput
AssignMemberTeamInput contains the documentation-first request parameters.
type AssignMemberTeamInput struct {
Authorization string
OrganizationID string
MemberID string
Params AssignMemberTeamParams
}type AssignMemberTeamParams
AssignMemberTeamParams requires a team ID or explicit null to clear the assignment.
type AssignMemberTeamParams struct {
TeamID *string `json:"team_id" nullable:"true" minLength:"1" pattern:"\\S"`
}type AssignMemberTeamUseCase
AssignMemberTeamUseCase defines the unimplemented assign organization member team operation.
type AssignMemberTeamUseCase struct{}func NewAssignMemberTeamUseCase
func NewAssignMemberTeamUseCase() *AssignMemberTeamUseCaseNewAssignMemberTeamUseCase creates the documentation-first operation.
func (*AssignMemberTeamUseCase) Execute
func (uc *AssignMemberTeamUseCase) Execute(_ context.Context, _ AssignMemberTeamInput) (*MemberView, error)Execute returns a stub error without authentication, persistence or state changes.
type AssignOrganizationMemberRoleInput
AssignOrganizationMemberRoleInput contains the assign organization member role request parameters.
type AssignOrganizationMemberRoleInput struct {
Authorization string
OrganizationID string
MemberID string
Params AssignMemberRoleParams
}type AssignOrganizationMemberRoleUseCase
AssignOrganizationMemberRoleUseCase defines the unimplemented assign organization member role operation.
type AssignOrganizationMemberRoleUseCase struct{}func NewAssignOrganizationMemberRoleUseCase
func NewAssignOrganizationMemberRoleUseCase() *AssignOrganizationMemberRoleUseCaseNewAssignOrganizationMemberRoleUseCase creates the documentation-first assign organization member role use case.
func (*AssignOrganizationMemberRoleUseCase) Execute
func (uc *AssignOrganizationMemberRoleUseCase) Execute(_ context.Context, _ AssignOrganizationMemberRoleInput) (*MemberView, error)Execute returns ErrNotImplemented until the operation is implemented.
type BillingReadDependencies
BillingReadDependencies are narrow, current-state providers for tenant billing reads.
type BillingReadDependencies struct {
Identity types.IIdentityService
Accounts identity.AccountReader
Permissions auth.OrganizationPermissionChecker
Memberships org.AuthorizationMembershipReader
Reader sub.OrganizationBillingReader
}type ChangeOrganizationStatusUseCase
ChangeOrganizationStatusUseCase validates and applies organization lifecycle changes.
type ChangeOrganizationStatusUseCase struct {
// contains filtered or unexported fields
}func NewChangeOrganizationStatusUseCase
func NewChangeOrganizationStatusUseCase(repo ports.OrganizationRepository) *ChangeOrganizationStatusUseCaseNewChangeOrganizationStatusUseCase wires persistence for organization lifecycle changes.
func (*ChangeOrganizationStatusUseCase) Execute
func (uc *ChangeOrganizationStatusUseCase) Execute(ctx context.Context, id string, target domain.OrganizationStatus) (*domain.Organization, error)Execute validates the requested status transition and returns the updated organization.
type CreateActiveMemberUseCase
CreateActiveMemberUseCase provisions active organization administrator memberships.
type CreateActiveMemberUseCase struct {
CheckMutation func(context.Context, string, int, int, bool) error
// contains filtered or unexported fields
}func NewCreateActiveMemberUseCase
func NewCreateActiveMemberUseCase(orgs ports.OrganizationRepository, members ports.MemberRepository) *CreateActiveMemberUseCaseNewCreateActiveMemberUseCase wires organization and membership repositories.
func (*CreateActiveMemberUseCase) Execute
func (uc *CreateActiveMemberUseCase) Execute(ctx context.Context, orgID, userID string, role domain.MemberRole) (*domain.Member, error)Execute adds an administrator membership to an active organization after checking for duplicates.
type CreateAdminOrganizationUseCase
CreateAdminOrganizationUseCase creates an organization without implicitly creating a member. Admin provisioning is deliberately a second operation.
type CreateAdminOrganizationUseCase struct {
// contains filtered or unexported fields
}func NewCreateAdminOrganizationUseCase
func NewCreateAdminOrganizationUseCase(repo ports.OrganizationRepository) *CreateAdminOrganizationUseCaseNewCreateAdminOrganizationUseCase wires organization persistence for admin provisioning.
func (*CreateAdminOrganizationUseCase) Execute
func (uc *CreateAdminOrganizationUseCase) Execute(ctx context.Context, dto CreateOrgDTO) (*domain.Organization, error)Execute validates organization details and creates an active organization with a unique slug.
type CreateOrgDTO
CreateOrgDTO contains parameters to create an organization.
type CreateOrgDTO struct {
Type *string
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Phone string `json:"phone"`
Email string `json:"email"`
Address string `json:"address"`
AdminUserID string `json:"-"` // Set internally from context
}type CreateOrganizationUseCase
CreateOrganizationUseCase handles organization creation.
type CreateOrganizationUseCase struct {
// contains filtered or unexported fields
}func NewCreateOrganizationUseCase
func NewCreateOrganizationUseCase(orgRepo ports.OrganizationRepository, memRepo ports.MemberRepository, supplied ...ports.MutationRunner) *CreateOrganizationUseCaseNewCreateOrganizationUseCase instantiates a new CreateOrganizationUseCase.
func (*CreateOrganizationUseCase) Execute
func (uc *CreateOrganizationUseCase) Execute(ctx context.Context, dto CreateOrgDTO) (*domain.Organization, *domain.Member, error)Execute creates a new organization and adds the creator as admin.
type CreateTeamDTO
CreateTeamDTO contains parameters to create a team.
type CreateTeamDTO struct {
OrganizationID string `json:"-"`
Name string `json:"name"`
Description string `json:"description"`
}type CreateTeamUseCase
CreateTeamUseCase handles team creation.
type CreateTeamUseCase struct {
// contains filtered or unexported fields
}func NewCreateTeamUseCase
func NewCreateTeamUseCase(repo ports.TeamRepository, supplied ...ports.MutationRunner) *CreateTeamUseCaseNewCreateTeamUseCase instantiates a new CreateTeamUseCase.
func (*CreateTeamUseCase) Execute
func (uc *CreateTeamUseCase) Execute(ctx context.Context, dto CreateTeamDTO) (*domain.Team, error)Execute creates a new team.
type DeleteOrganizationTeamInput
DeleteOrganizationTeamInput contains the documentation-first request parameters.
type DeleteOrganizationTeamInput struct {
Authorization string
OrganizationID string
TeamID string
}type DeleteOrganizationTeamUseCase
DeleteOrganizationTeamUseCase defines the unimplemented delete organization team operation.
type DeleteOrganizationTeamUseCase struct{}func NewDeleteOrganizationTeamUseCase
func NewDeleteOrganizationTeamUseCase() *DeleteOrganizationTeamUseCaseNewDeleteOrganizationTeamUseCase creates the documentation-first operation.
func (*DeleteOrganizationTeamUseCase) Execute
func (uc *DeleteOrganizationTeamUseCase) Execute(_ context.Context, _ DeleteOrganizationTeamInput) (*ManagementEmpty, error)Execute returns a stub error without authentication, persistence or state changes.
type EditMemberParams
EditMemberParams changes membership status without editing the identity account.
type EditMemberParams struct {
Status string `json:"status" enum:"active,inactive"`
}type EditOrganizationMemberInput
EditOrganizationMemberInput contains the edit organization member request parameters.
type EditOrganizationMemberInput struct {
Authorization string
OrganizationID string
MemberID string
Params EditMemberParams
}type EditOrganizationMemberUseCase
EditOrganizationMemberUseCase defines the unimplemented edit organization member operation.
type EditOrganizationMemberUseCase struct{}func NewEditOrganizationMemberUseCase
func NewEditOrganizationMemberUseCase() *EditOrganizationMemberUseCaseNewEditOrganizationMemberUseCase creates the documentation-first edit organization member use case.
func (*EditOrganizationMemberUseCase) Execute
func (uc *EditOrganizationMemberUseCase) Execute(_ context.Context, _ EditOrganizationMemberInput) (*MemberView, error)Execute returns ErrNotImplemented until the operation is implemented.
type GetActiveOrganizationContextInput
GetActiveOrganizationContextInput contains the documentation-first request parameters.
type GetActiveOrganizationContextInput struct {
Authorization string
}type GetActiveOrganizationContextUseCase
GetActiveOrganizationContextUseCase defines the unimplemented get active organization context operation.
type GetActiveOrganizationContextUseCase struct{}func NewGetActiveOrganizationContextUseCase
func NewGetActiveOrganizationContextUseCase() *GetActiveOrganizationContextUseCaseNewGetActiveOrganizationContextUseCase creates the documentation-first operation.
func (*GetActiveOrganizationContextUseCase) Execute
func (uc *GetActiveOrganizationContextUseCase) Execute(_ context.Context, _ GetActiveOrganizationContextInput) (*ActiveOrganizationContext, error)Execute returns a stub error without authentication, persistence or state changes.
type GetOrganizationProfileInput
GetOrganizationProfileInput optionally scopes the caller's profile to a request subdomain.
type GetOrganizationProfileInput struct {
Authorization string
OrganizationSlug string
}type GetOrganizationProfileUseCase
GetOrganizationProfileUseCase retrieves the authenticated member's own profile.
type GetOrganizationProfileUseCase struct {
// contains filtered or unexported fields
}func NewGetOrganizationProfileUseCase
func NewGetOrganizationProfileUseCase(identity types.IIdentityService, accounts identitypublic.AccountReader, organizations ports.OrganizationRepository, members ports.MemberRepository, authorization authorizationpublic.MemberAuthorizationReader) *GetOrganizationProfileUseCaseNewGetOrganizationProfileUseCase wires identity, membership and scoped authorization readers.
func (*GetOrganizationProfileUseCase) Execute
func (uc *GetOrganizationProfileUseCase) Execute(ctx context.Context, input GetOrganizationProfileInput) (*domain.OrganizationProfile, error)Execute derives lookups from verified credentials and an eligible organization membership.
type GetOrganizationTeamInput
GetOrganizationTeamInput contains the documentation-first request parameters.
type GetOrganizationTeamInput struct {
Authorization string
OrganizationID string
TeamID string
}type GetOrganizationTeamUseCase
GetOrganizationTeamUseCase defines the unimplemented get organization team operation.
type GetOrganizationTeamUseCase struct{}func NewGetOrganizationTeamUseCase
func NewGetOrganizationTeamUseCase() *GetOrganizationTeamUseCaseNewGetOrganizationTeamUseCase creates the documentation-first operation.
func (*GetOrganizationTeamUseCase) Execute
func (uc *GetOrganizationTeamUseCase) Execute(_ context.Context, _ GetOrganizationTeamInput) (*TeamView, error)Execute returns a stub error without authentication, persistence or state changes.
type GetOrganizationUseCase
GetOrganizationUseCase handles retrieving an organization.
type GetOrganizationUseCase struct {
// contains filtered or unexported fields
}func NewGetOrganizationUseCase
func NewGetOrganizationUseCase(repo ports.OrganizationRepository) *GetOrganizationUseCaseNewGetOrganizationUseCase instantiates a new GetOrganizationUseCase.
func (*GetOrganizationUseCase) Execute
func (uc *GetOrganizationUseCase) Execute(ctx context.Context, id string) (*domain.Organization, error)Execute retrieves an organization by ID.
type InviteDoctorParams
InviteDoctorParams identifies the new doctor account email to invite.
type InviteDoctorParams struct {
Email string `json:"email" format:"email" minLength:"1" maxLength:"255"`
}type InviteMemberDTO
InviteMemberDTO contains parameters to invite a member.
type InviteMemberDTO struct {
OrganizationID string `json:"-"`
UserID string `json:"user_id"`
Role domain.MemberRole `json:"role"`
TeamID *string `json:"team_id,omitempty"`
}type InviteMemberUseCase
InviteMemberUseCase handles inviting a member to an organization.
type InviteMemberUseCase struct {
// contains filtered or unexported fields
}func NewInviteMemberUseCase
func NewInviteMemberUseCase(repo ports.MemberRepository) *InviteMemberUseCaseNewInviteMemberUseCase instantiates a new InviteMemberUseCase.
func (*InviteMemberUseCase) Execute
func (uc *InviteMemberUseCase) Execute(ctx context.Context, dto InviteMemberDTO) (*domain.Member, error)Execute invites a user to an organization.
type InviteOrganizationDoctorInput
InviteOrganizationDoctorInput contains the invite organization doctor request parameters.
type InviteOrganizationDoctorInput struct {
Authorization string
OrganizationID string
Params InviteDoctorParams
}type InviteOrganizationDoctorUseCase
InviteOrganizationDoctorUseCase defines the unimplemented invite organization doctor operation.
type InviteOrganizationDoctorUseCase struct{}func NewInviteOrganizationDoctorUseCase
func NewInviteOrganizationDoctorUseCase() *InviteOrganizationDoctorUseCaseNewInviteOrganizationDoctorUseCase creates the documentation-first invite organization doctor use case.
func (*InviteOrganizationDoctorUseCase) Execute
func (uc *InviteOrganizationDoctorUseCase) Execute(_ context.Context, _ InviteOrganizationDoctorInput) (*organizationpublic.DoctorInvitation, error)Execute returns ErrNotImplemented until the operation is implemented.
type InvoiceView
InvoiceView aliases the authoritative invoice and manual-payment balance schema.
type InvoiceView = subscriptionpublic.OrganizationInvoicetype ListDoctorInvitationsInput
ListDoctorInvitationsInput contains the list doctor invitations request parameters.
type ListDoctorInvitationsInput struct {
Authorization string
OrganizationID string
Limit int
Cursor string
}type ListDoctorInvitationsUseCase
ListDoctorInvitationsUseCase defines the unimplemented list doctor invitations operation.
type ListDoctorInvitationsUseCase struct{}func NewListDoctorInvitationsUseCase
func NewListDoctorInvitationsUseCase() *ListDoctorInvitationsUseCaseNewListDoctorInvitationsUseCase creates the documentation-first list doctor invitations use case.
func (*ListDoctorInvitationsUseCase) Execute
func (uc *ListDoctorInvitationsUseCase) Execute(_ context.Context, _ ListDoctorInvitationsInput) (*PortalPage[organizationpublic.DoctorInvitation], error)Execute returns ErrNotImplemented until the operation is implemented.
type ListIncomingDoctorJoinRequestsInput
ListIncomingDoctorJoinRequestsInput contains the list incoming doctor join requests request parameters.
type ListIncomingDoctorJoinRequestsInput struct {
Authorization string
OrganizationID string
Limit int
Cursor string
}type ListIncomingDoctorJoinRequestsUseCase
ListIncomingDoctorJoinRequestsUseCase defines the unimplemented list incoming doctor join requests operation.
type ListIncomingDoctorJoinRequestsUseCase struct{}func NewListIncomingDoctorJoinRequestsUseCase
func NewListIncomingDoctorJoinRequestsUseCase() *ListIncomingDoctorJoinRequestsUseCaseNewListIncomingDoctorJoinRequestsUseCase creates the documentation-first list incoming doctor join requests use case.
func (*ListIncomingDoctorJoinRequestsUseCase) Execute
func (uc *ListIncomingDoctorJoinRequestsUseCase) Execute(_ context.Context, _ ListIncomingDoctorJoinRequestsInput) (*PortalPage[organizationpublic.DoctorJoinRequest], error)Execute returns ErrNotImplemented until the operation is implemented.
type ListMembersUseCase
ListMembersUseCase handles listing members of an organization.
type ListMembersUseCase struct {
// contains filtered or unexported fields
}func NewListMembersUseCase
func NewListMembersUseCase(repo ports.MemberRepository) *ListMembersUseCaseNewListMembersUseCase instantiates a new ListMembersUseCase.
func (*ListMembersUseCase) Execute
func (uc *ListMembersUseCase) Execute(ctx context.Context, orgID string) ([]*domain.Member, error)Execute lists members for an organization.
type ListMyOrganizationsInput
ListMyOrganizationsInput contains the list my organizations request parameters.
type ListMyOrganizationsInput struct {
Authorization string
Limit int
Cursor string
}type ListMyOrganizationsUseCase
ListMyOrganizationsUseCase defines the unimplemented list my organizations operation.
type ListMyOrganizationsUseCase struct{}func NewListMyOrganizationsUseCase
func NewListMyOrganizationsUseCase() *ListMyOrganizationsUseCaseNewListMyOrganizationsUseCase creates the documentation-first list my organizations use case.
func (*ListMyOrganizationsUseCase) Execute
func (uc *ListMyOrganizationsUseCase) Execute(_ context.Context, _ ListMyOrganizationsInput) (*PortalPage[organizationpublic.Organization], error)Execute returns ErrNotImplemented until the operation is implemented.
type ListOrganizationDoctorsInput
ListOrganizationDoctorsInput scopes the affiliation list and its search/pagination.
type ListOrganizationDoctorsInput struct {
Authorization, OrganizationID, Search, Status, Cursor string
Limit int
}type ListOrganizationDoctorsUseCase
ListOrganizationDoctorsUseCase authorizes scoped reads and enriches affiliations.
type ListOrganizationDoctorsUseCase struct {
Dependencies OrganizationDoctorDependencies
}func NewListOrganizationDoctorsUseCase
func NewListOrganizationDoctorsUseCase() *ListOrganizationDoctorsUseCaseNewListOrganizationDoctorsUseCase creates an operation whose providers are injected during module wiring. Missing dependencies fail closed at execution, which permits offline route/schema registration without a database connection.
func (*ListOrganizationDoctorsUseCase) Execute
func (uc *ListOrganizationDoctorsUseCase) Execute(ctx context.Context, in ListOrganizationDoctorsInput) (*OrganizationDoctorsPage, error)Execute returns authorized organization affiliations enriched with professional profiles, live Identity names/account states, and credential display status. Platform administrators need both organization-read and doctor-list grants; other callers need the doctor-list grant for the exact active organization in the path.
Search spans provider-owned data, so enrichment and filtering precede pagination. A missing required profile/account/status is an availability failure, not a row to silently omit. Verification is returned for display and never gates assignment.
type ListOrganizationInvoicesInput
ListOrganizationInvoicesInput contains the list organization invoices request parameters.
type ListOrganizationInvoicesInput struct {
Authorization string
OrganizationID string
Limit int
Cursor string
}type ListOrganizationInvoicesUseCase
ListOrganizationInvoicesUseCase defines the unimplemented list organization invoices operation.
type ListOrganizationInvoicesUseCase struct{ Dependencies BillingReadDependencies }func NewListOrganizationInvoicesUseCase
func NewListOrganizationInvoicesUseCase() *ListOrganizationInvoicesUseCaseNewListOrganizationInvoicesUseCase creates the documentation-first list organization invoices use case.
func (*ListOrganizationInvoicesUseCase) Execute
func (uc *ListOrganizationInvoicesUseCase) Execute(ctx context.Context, in ListOrganizationInvoicesInput) (*PortalPage[InvoiceView], error)Execute returns issued charges in the authenticated organization's scope.
type ListOrganizationMembersInput
ListOrganizationMembersInput contains the list organization members request parameters.
type ListOrganizationMembersInput struct {
Authorization string
OrganizationID string
Limit int
Cursor string
}type ListOrganizationMembersUseCase
ListOrganizationMembersUseCase defines the unimplemented list organization members operation.
type ListOrganizationMembersUseCase struct{}func NewListOrganizationMembersUseCase
func NewListOrganizationMembersUseCase() *ListOrganizationMembersUseCaseNewListOrganizationMembersUseCase creates the documentation-first list organization members use case.
func (*ListOrganizationMembersUseCase) Execute
func (uc *ListOrganizationMembersUseCase) Execute(_ context.Context, _ ListOrganizationMembersInput) (*PortalPage[MemberView], error)Execute returns ErrNotImplemented until the operation is implemented.
type ListOrganizationsUseCase
ListOrganizationsUseCase handles listing user's organizations.
type ListOrganizationsUseCase struct {
// contains filtered or unexported fields
}func NewListOrganizationsUseCase
func NewListOrganizationsUseCase(repo ports.OrganizationRepository) *ListOrganizationsUseCaseNewListOrganizationsUseCase instantiates a new ListOrganizationsUseCase.
func (*ListOrganizationsUseCase) Execute
func (uc *ListOrganizationsUseCase) Execute(ctx context.Context, userID string) ([]*domain.Organization, error)Execute lists organizations for a user.
type ListTeamsUseCase
ListTeamsUseCase handles listing teams of an organization.
type ListTeamsUseCase struct {
// contains filtered or unexported fields
}func NewListTeamsUseCase
func NewListTeamsUseCase(repo ports.TeamRepository) *ListTeamsUseCaseNewListTeamsUseCase instantiates a new ListTeamsUseCase.
func (*ListTeamsUseCase) Execute
func (uc *ListTeamsUseCase) Execute(ctx context.Context, orgID string) ([]*domain.Team, error)Execute lists teams for an organization.
type LoginInput
LoginInput carries credentials and session metadata for organization login.
type LoginInput struct{ Email, Password, IPAddress, UserAgent string }type LoginUseCase
LoginUseCase authenticates an active member of at least one active organization.
type LoginUseCase struct {
// contains filtered or unexported fields
}func NewLoginUseCase
func NewLoginUseCase(authentication identitypublic.AuthenticationService, organizations ports.OrganizationRepository, members ports.MemberRepository) *LoginUseCaseNewLoginUseCase wires Identity authentication and organization repositories.
func (*LoginUseCase) Execute
func (uc *LoginUseCase) Execute(ctx context.Context, input LoginInput) (*types.TokenPair, error)Execute requires active membership before Identity issues credentials or creates a session.
type ManagementEmpty
ManagementEmpty denotes an intended 204 response without a body.
type ManagementEmpty struct{}type MemberView
MemberView describes an ordinary organization member, separate from doctor affiliations.
type MemberView struct {
ID string `json:"id"`
UserID string `json:"user_id"`
OrganizationID string `json:"organization_id"`
TeamID *string `json:"team_id,omitempty"`
Name string `json:"name"`
Email string `json:"email" format:"email"`
Role string `json:"role" enum:"admin,doctor,staff"`
Status string `json:"status" enum:"active,inactive"`
JoinedAt time.Time `json:"joined_at"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}type NewMemberIdentity
NewMemberIdentity contains account details for provisioning a new ordinary member.
type NewMemberIdentity struct {
Name string `json:"name" minLength:"1" maxLength:"255"`
Email string `json:"email" format:"email" minLength:"1" maxLength:"255"`
TemporaryPassword string `json:"temporary_password" minLength:"8" maxLength:"128" writeOnly:"true"`
}type OrganizationDoctor
OrganizationDoctor is the shared professional display contract.
type OrganizationDoctor = org.OrganizationDoctortype OrganizationDoctorDependencies
OrganizationDoctorDependencies are configured by the composition root before serving.
type OrganizationDoctorDependencies struct {
Identity types.IIdentityService
Accounts identity.AccountReader
AdminPermissions auth.AdminPermissionChecker
OrganizationPermissions auth.OrganizationPermissionChecker
Organizations org.AdminOrganizationService
Insights org.Insights
Directory doctor.Directory
Verifications admin.VerificationStatuses
}type OrganizationDoctorItem
OrganizationDoctorItem is the shared affiliation/display contract.
type OrganizationDoctorItem = org.OrganizationDoctorItemtype OrganizationDoctorReader
OrganizationDoctorReader shares affiliation reads across independently authorized portals.
type OrganizationDoctorReader struct {
Dependencies OrganizationDoctorDependencies
}func (*OrganizationDoctorReader) GetOrganizationDoctor
func (r *OrganizationDoctorReader) GetOrganizationDoctor(ctx context.Context, organizationID, doctorID string) (*org.OrganizationDoctorItem, error)GetOrganizationDoctor requires the exact organization/profile intersection.
func (*OrganizationDoctorReader) ListOrganizationDoctors
func (r *OrganizationDoctorReader) ListOrganizationDoctors(ctx context.Context, in org.OrganizationDoctorsQuery) (*org.OrganizationDoctorsPage, error)ListOrganizationDoctors filters enriched affiliations before stable cursor pagination.
type OrganizationDoctorsPage
OrganizationDoctorsPage is the shared paginated result contract.
type OrganizationDoctorsPage = org.OrganizationDoctorsPagetype PatchDoctorAffiliationInput
PatchDoctorAffiliationInput contains the documentation-first request parameters.
type PatchDoctorAffiliationInput struct {
Authorization string
OrganizationID string
DoctorID string
Params PatchDoctorAffiliationParams
}type PatchDoctorAffiliationParams
PatchDoctorAffiliationParams changes affiliation status independently of ordinary membership.
type PatchDoctorAffiliationParams struct {
Status string `json:"status" enum:"active,inactive"`
}type PatchDoctorAffiliationUseCase
PatchDoctorAffiliationUseCase defines the unimplemented update doctor affiliation status operation.
type PatchDoctorAffiliationUseCase struct{}func NewPatchDoctorAffiliationUseCase
func NewPatchDoctorAffiliationUseCase() *PatchDoctorAffiliationUseCaseNewPatchDoctorAffiliationUseCase creates the documentation-first operation.
func (*PatchDoctorAffiliationUseCase) Execute
func (uc *PatchDoctorAffiliationUseCase) Execute(_ context.Context, _ PatchDoctorAffiliationInput) (*organizationpublic.DoctorAffiliation, error)Execute returns a stub error without authentication, persistence or state changes.
type PatchOrganizationTeamInput
PatchOrganizationTeamInput contains the documentation-first request parameters.
type PatchOrganizationTeamInput struct {
Authorization string
OrganizationID string
TeamID string
Params PatchOrganizationTeamParams
}type PatchOrganizationTeamParams
PatchOrganizationTeamParams preserves omissions; an empty description clears it.
type PatchOrganizationTeamParams struct {
Name *string `json:"name,omitempty" nullable:"false" minLength:"1" maxLength:"255" pattern:"\\S"`
Description *string `json:"description,omitempty" nullable:"false" maxLength:"2000"`
}type PatchOrganizationTeamUseCase
PatchOrganizationTeamUseCase defines the unimplemented update organization team operation.
type PatchOrganizationTeamUseCase struct{}func NewPatchOrganizationTeamUseCase
func NewPatchOrganizationTeamUseCase() *PatchOrganizationTeamUseCaseNewPatchOrganizationTeamUseCase creates the documentation-first operation.
func (*PatchOrganizationTeamUseCase) Execute
func (uc *PatchOrganizationTeamUseCase) Execute(_ context.Context, _ PatchOrganizationTeamInput) (*TeamView, error)Execute returns a stub error without authentication, persistence or state changes.
type PatchPortalOrganizationInput
PatchPortalOrganizationInput contains the documentation-first request parameters.
type PatchPortalOrganizationInput struct {
Authorization string
OrganizationID string
Params PatchPortalOrganizationParams
}type PatchPortalOrganizationParams
PatchPortalOrganizationParams preserves omissions; empty strings clear optional contact fields.
type PatchPortalOrganizationParams struct {
Name *string `json:"name,omitempty" nullable:"false" minLength:"1" maxLength:"255" pattern:"\\S"`
Description *string `json:"description,omitempty" nullable:"false" maxLength:"2000"`
Phone *string `json:"phone,omitempty" nullable:"false" maxLength:"30"`
Email *string `json:"email,omitempty" nullable:"false" maxLength:"255" doc:"Contact email; an empty string clears it."`
Address *string `json:"address,omitempty" nullable:"false" maxLength:"1000"`
}type PatchPortalOrganizationUseCase
PatchPortalOrganizationUseCase defines the unimplemented update my organization operation.
type PatchPortalOrganizationUseCase struct{}func NewPatchPortalOrganizationUseCase
func NewPatchPortalOrganizationUseCase() *PatchPortalOrganizationUseCaseNewPatchPortalOrganizationUseCase creates the documentation-first operation.
func (*PatchPortalOrganizationUseCase) Execute
func (uc *PatchPortalOrganizationUseCase) Execute(_ context.Context, _ PatchPortalOrganizationInput) (*organizationpublic.Organization, error)Execute returns a stub error without authentication, persistence or state changes.
type PortalPage
PortalPage is a cursor-paginated organization API result.
type PortalPage[T any] struct {
Items []T `json:"items"`
NextCursor string `json:"next_cursor,omitempty"`
}type RejectDoctorJoinRequestInput
RejectDoctorJoinRequestInput contains the reject doctor join request request parameters.
type RejectDoctorJoinRequestInput struct {
Authorization string
OrganizationID string
RequestID string
}type RejectDoctorJoinRequestUseCase
RejectDoctorJoinRequestUseCase defines the unimplemented reject doctor join request operation.
type RejectDoctorJoinRequestUseCase struct{}func NewRejectDoctorJoinRequestUseCase
func NewRejectDoctorJoinRequestUseCase() *RejectDoctorJoinRequestUseCaseNewRejectDoctorJoinRequestUseCase creates the documentation-first reject doctor join request use case.
func (*RejectDoctorJoinRequestUseCase) Execute
func (uc *RejectDoctorJoinRequestUseCase) Execute(_ context.Context, _ RejectDoctorJoinRequestInput) (*organizationpublic.DoctorJoinRequest, error)Execute returns ErrNotImplemented until the operation is implemented.
type RemoveMemberUseCase
RemoveMemberUseCase handles removing a member.
type RemoveMemberUseCase struct {
// contains filtered or unexported fields
}func NewRemoveMemberUseCase
func NewRemoveMemberUseCase(repo ports.MemberRepository, supplied ...ports.MutationRunner) *RemoveMemberUseCaseNewRemoveMemberUseCase instantiates a new RemoveMemberUseCase.
func (*RemoveMemberUseCase) Execute
func (uc *RemoveMemberUseCase) Execute(ctx context.Context, organizationID, membershipID string) errorExecute removes a member from an organization.
type RevokeDoctorInvitationInput
RevokeDoctorInvitationInput contains the revoke doctor invitation request parameters.
type RevokeDoctorInvitationInput struct {
Authorization string
OrganizationID string
InvitationID string
}type RevokeDoctorInvitationUseCase
RevokeDoctorInvitationUseCase defines the unimplemented revoke doctor invitation operation.
type RevokeDoctorInvitationUseCase struct{}func NewRevokeDoctorInvitationUseCase
func NewRevokeDoctorInvitationUseCase() *RevokeDoctorInvitationUseCaseNewRevokeDoctorInvitationUseCase creates the documentation-first revoke doctor invitation use case.
func (*RevokeDoctorInvitationUseCase) Execute
func (uc *RevokeDoctorInvitationUseCase) Execute(_ context.Context, _ RevokeDoctorInvitationInput) (*organizationpublic.DoctorInvitation, error)Execute returns ErrNotImplemented until the operation is implemented.
type SetActiveContextUseCase
SetActiveContextUseCase handles setting the user's active organization.
type SetActiveContextUseCase struct {
// contains filtered or unexported fields
}func NewSetActiveContextUseCase
func NewSetActiveContextUseCase(repo ports.MemberRepository, supplied ...ports.MutationRunner) *SetActiveContextUseCaseNewSetActiveContextUseCase instantiates a new SetActiveContextUseCase.
func (*SetActiveContextUseCase) Execute
func (uc *SetActiveContextUseCase) Execute(ctx context.Context, userID, orgID string) errorExecute sets the active organization context for a user.
type SubscriptionPlanView
SubscriptionPlanView aliases the authoritative shared offering schema.
type SubscriptionPlanView = subscriptionpublic.Plantype SubscriptionPolicy
SubscriptionPolicy executes application eligibility/capacity decisions inside the transaction holding Organization's row lock. Disabled enforcement is a staged rollout: evaluate/log decisions without changing existing write behavior.
type SubscriptionPolicy struct {
Services sub.TransactionServices
Organizations org.BillingOrganizations
Enforce bool
}func (SubscriptionPolicy) Check
func (p SubscriptionPolicy) Check(ctx context.Context, tx pgx.Tx, organizationID string, members, doctors int, initialAdmin bool) errorCheck evaluates application policy before the protected business mutation.
type SubscriptionView
SubscriptionView aliases the authoritative snapshot and effective-feature schema.
type SubscriptionView = subscriptionpublic.Subscriptiontype TeamView
TeamView describes an organization-owned team.
type TeamView struct {
ID string `json:"id"`
OrganizationID string `json:"organization_id"`
Name string `json:"name"`
Description string `json:"description"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}type UpdateMemberRoleUseCase
UpdateMemberRoleUseCase handles updating a member's role.
type UpdateMemberRoleUseCase struct {
// contains filtered or unexported fields
}func NewUpdateMemberRoleUseCase
func NewUpdateMemberRoleUseCase(repo ports.MemberRepository) *UpdateMemberRoleUseCaseNewUpdateMemberRoleUseCase instantiates a new UpdateMemberRoleUseCase.
func (*UpdateMemberRoleUseCase) Execute
func (uc *UpdateMemberRoleUseCase) Execute(ctx context.Context, membershipID string, role domain.MemberRole) errorExecute updates a member's role.
type UpdateOrganizationDTO
UpdateOrganizationDTO identifies an organization and its replacement details.
type UpdateOrganizationDTO struct {
Type *string
ID, Name, Description, Phone, Email, Address string
}type UpdateOrganizationUseCase
UpdateOrganizationUseCase updates the details of an organization that is not deleted.
type UpdateOrganizationUseCase struct {
// contains filtered or unexported fields
}func NewUpdateOrganizationUseCase
func NewUpdateOrganizationUseCase(repo ports.OrganizationRepository) *UpdateOrganizationUseCaseNewUpdateOrganizationUseCase wires persistence for organization updates.
func (*UpdateOrganizationUseCase) Execute
func (uc *UpdateOrganizationUseCase) Execute(ctx context.Context, dto UpdateOrganizationDTO) (*domain.Organization, error)Execute validates the organization's state and persists its replacement details.
type VerifiedOrganizationMember
VerifiedOrganizationMember contains the verified identity and organization relationship.
type VerifiedOrganizationMember struct {
Identity *identitypublic.Account
Member *domain.Member
Organization *domain.Organization
}type VerifyAuthInput
VerifyAuthInput optionally scopes membership verification to a request subdomain.
type VerifyAuthInput struct {
Authorization string
OrganizationSlug string
}type VerifyAuthUseCase
VerifyAuthUseCase verifies an active member, optionally in a specific organization.
type VerifyAuthUseCase struct {
// contains filtered or unexported fields
}func NewVerifyAuthUseCase
func NewVerifyAuthUseCase(identity types.IIdentityService, accounts identitypublic.AccountReader, organizations ports.OrganizationRepository, members ports.MemberRepository) *VerifyAuthUseCaseNewVerifyAuthUseCase wires identity validation and organization repositories.
func (*VerifyAuthUseCase) Execute
func (uc *VerifyAuthUseCase) Execute(ctx context.Context, input VerifyAuthInput) (*VerifiedOrganizationMember, error)Execute validates credentials and loads the caller's active membership and profile.
type ViewOrganizationDoctorInput
ViewOrganizationDoctorInput contains the view organization doctor request parameters.
type ViewOrganizationDoctorInput struct {
Authorization string
OrganizationID string
DoctorID string
}type ViewOrganizationDoctorUseCase
ViewOrganizationDoctorUseCase defines the unimplemented view organization doctor operation.
type ViewOrganizationDoctorUseCase struct{}func NewViewOrganizationDoctorUseCase
func NewViewOrganizationDoctorUseCase() *ViewOrganizationDoctorUseCaseNewViewOrganizationDoctorUseCase creates the documentation-first view organization doctor use case.
func (*ViewOrganizationDoctorUseCase) Execute
func (uc *ViewOrganizationDoctorUseCase) Execute(_ context.Context, _ ViewOrganizationDoctorInput) (*AffiliatedDoctor, error)Execute returns ErrNotImplemented until the operation is implemented.
type ViewOrganizationInput
ViewOrganizationInput contains the view organization request parameters.
type ViewOrganizationInput struct {
Authorization string
OrganizationID string
}type ViewOrganizationMemberInput
ViewOrganizationMemberInput contains the view organization member request parameters.
type ViewOrganizationMemberInput struct {
Authorization string
OrganizationID string
MemberID string
}type ViewOrganizationMemberUseCase
ViewOrganizationMemberUseCase defines the unimplemented view organization member operation.
type ViewOrganizationMemberUseCase struct{}func NewViewOrganizationMemberUseCase
func NewViewOrganizationMemberUseCase() *ViewOrganizationMemberUseCaseNewViewOrganizationMemberUseCase creates the documentation-first view organization member use case.
func (*ViewOrganizationMemberUseCase) Execute
func (uc *ViewOrganizationMemberUseCase) Execute(_ context.Context, _ ViewOrganizationMemberInput) (*MemberView, error)Execute returns ErrNotImplemented until the operation is implemented.
type ViewOrganizationSubscriptionInput
ViewOrganizationSubscriptionInput contains the view organization subscription request parameters.
type ViewOrganizationSubscriptionInput struct {
Authorization string
OrganizationID string
}type ViewOrganizationSubscriptionUseCase
ViewOrganizationSubscriptionUseCase defines the unimplemented view organization subscription operation.
type ViewOrganizationSubscriptionUseCase struct{ Dependencies BillingReadDependencies }func NewViewOrganizationSubscriptionUseCase
func NewViewOrganizationSubscriptionUseCase() *ViewOrganizationSubscriptionUseCaseNewViewOrganizationSubscriptionUseCase creates the documentation-first view organization subscription use case.
func (*ViewOrganizationSubscriptionUseCase) Execute
func (uc *ViewOrganizationSubscriptionUseCase) Execute(ctx context.Context, in ViewOrganizationSubscriptionInput) (*SubscriptionView, error)Execute preserves permitted reads even when the subscription is expired or absent.
type ViewOrganizationUseCase
ViewOrganizationUseCase defines the unimplemented view organization operation.
type ViewOrganizationUseCase struct{}func NewViewOrganizationUseCase
func NewViewOrganizationUseCase() *ViewOrganizationUseCaseNewViewOrganizationUseCase creates the documentation-first view organization use case.
func (*ViewOrganizationUseCase) Execute
func (uc *ViewOrganizationUseCase) Execute(_ context.Context, _ ViewOrganizationInput) (*organizationpublic.Organization, error)Execute returns ErrNotImplemented until the operation is implemented.
Generated by gomarkdoc