Skip to content

usecase ​

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

Package usecase contains single-task use case implementations.

Index ​

Variables ​

ErrNotImplemented marks documentation-first portal operations; legacy and admin capabilities are unaffected.

go
var ErrNotImplemented = errors.New("organization operation is not implemented")

type AcceptDoctorJoinRequestInput ​

AcceptDoctorJoinRequestInput contains the accept doctor join request request parameters.

go
type AcceptDoctorJoinRequestInput struct {
    Authorization  string
    OrganizationID string
    RequestID      string
}

type AcceptDoctorJoinRequestUseCase ​

AcceptDoctorJoinRequestUseCase defines the unimplemented accept doctor join request operation.

go
type AcceptDoctorJoinRequestUseCase struct{}

func NewAcceptDoctorJoinRequestUseCase ​

go
func NewAcceptDoctorJoinRequestUseCase() *AcceptDoctorJoinRequestUseCase

NewAcceptDoctorJoinRequestUseCase creates the documentation-first accept doctor join request use case.

func (*AcceptDoctorJoinRequestUseCase) Execute ​

go
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.

go
type AcceptInvitationUseCase struct {
    // contains filtered or unexported fields
}

func NewAcceptInvitationUseCase ​

go
func NewAcceptInvitationUseCase(repo ports.MemberRepository) *AcceptInvitationUseCase

NewAcceptInvitationUseCase instantiates a new AcceptInvitationUseCase.

func (*AcceptInvitationUseCase) Execute ​

go
func (uc *AcceptInvitationUseCase) Execute(ctx context.Context, membershipID string) error

Execute accepts a membership invitation.

type ActiveOrganizationContext ​

ActiveOrganizationContext returns the selected organization and the caller's relationship to it.

go
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.

go
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.

go
type AddOrganizationMemberInput struct {
    Authorization  string
    OrganizationID string
    Params         AddMemberParams
}

type AddOrganizationMemberUseCase ​

AddOrganizationMemberUseCase defines the unimplemented add organization member operation.

go
type AddOrganizationMemberUseCase struct{}

func NewAddOrganizationMemberUseCase ​

go
func NewAddOrganizationMemberUseCase() *AddOrganizationMemberUseCase

NewAddOrganizationMemberUseCase creates the documentation-first add organization member use case.

func (*AddOrganizationMemberUseCase) Execute ​

go
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.

go
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.

go
type AssignMemberRoleParams struct {
    Role string `json:"role" enum:"admin,doctor,staff"`
}

type AssignMemberTeamInput ​

AssignMemberTeamInput contains the documentation-first request parameters.

go
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.

go
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.

go
type AssignMemberTeamUseCase struct{}

func NewAssignMemberTeamUseCase ​

go
func NewAssignMemberTeamUseCase() *AssignMemberTeamUseCase

NewAssignMemberTeamUseCase creates the documentation-first operation.

func (*AssignMemberTeamUseCase) Execute ​

go
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.

go
type AssignOrganizationMemberRoleInput struct {
    Authorization  string
    OrganizationID string
    MemberID       string
    Params         AssignMemberRoleParams
}

type AssignOrganizationMemberRoleUseCase ​

AssignOrganizationMemberRoleUseCase defines the unimplemented assign organization member role operation.

go
type AssignOrganizationMemberRoleUseCase struct{}

func NewAssignOrganizationMemberRoleUseCase ​

go
func NewAssignOrganizationMemberRoleUseCase() *AssignOrganizationMemberRoleUseCase

NewAssignOrganizationMemberRoleUseCase creates the documentation-first assign organization member role use case.

func (*AssignOrganizationMemberRoleUseCase) Execute ​

go
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.

go
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.

go
type ChangeOrganizationStatusUseCase struct {
    // contains filtered or unexported fields
}

func NewChangeOrganizationStatusUseCase ​

go
func NewChangeOrganizationStatusUseCase(repo ports.OrganizationRepository) *ChangeOrganizationStatusUseCase

NewChangeOrganizationStatusUseCase wires persistence for organization lifecycle changes.

func (*ChangeOrganizationStatusUseCase) Execute ​

go
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.

go
type CreateActiveMemberUseCase struct {
    CheckMutation func(context.Context, string, int, int, bool) error
    // contains filtered or unexported fields
}

func NewCreateActiveMemberUseCase ​

go
func NewCreateActiveMemberUseCase(orgs ports.OrganizationRepository, members ports.MemberRepository) *CreateActiveMemberUseCase

NewCreateActiveMemberUseCase wires organization and membership repositories.

func (*CreateActiveMemberUseCase) Execute ​

go
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.

go
type CreateAdminOrganizationUseCase struct {
    // contains filtered or unexported fields
}

func NewCreateAdminOrganizationUseCase ​

go
func NewCreateAdminOrganizationUseCase(repo ports.OrganizationRepository) *CreateAdminOrganizationUseCase

NewCreateAdminOrganizationUseCase wires organization persistence for admin provisioning.

func (*CreateAdminOrganizationUseCase) Execute ​

go
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.

go
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.

go
type CreateOrganizationUseCase struct {
    // contains filtered or unexported fields
}

func NewCreateOrganizationUseCase ​

go
func NewCreateOrganizationUseCase(orgRepo ports.OrganizationRepository, memRepo ports.MemberRepository, supplied ...ports.MutationRunner) *CreateOrganizationUseCase

NewCreateOrganizationUseCase instantiates a new CreateOrganizationUseCase.

func (*CreateOrganizationUseCase) Execute ​

go
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.

go
type CreateTeamDTO struct {
    OrganizationID string `json:"-"`
    Name           string `json:"name"`
    Description    string `json:"description"`
}

type CreateTeamUseCase ​

CreateTeamUseCase handles team creation.

go
type CreateTeamUseCase struct {
    // contains filtered or unexported fields
}

func NewCreateTeamUseCase ​

go
func NewCreateTeamUseCase(repo ports.TeamRepository, supplied ...ports.MutationRunner) *CreateTeamUseCase

NewCreateTeamUseCase instantiates a new CreateTeamUseCase.

func (*CreateTeamUseCase) Execute ​

go
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.

go
type DeleteOrganizationTeamInput struct {
    Authorization  string
    OrganizationID string
    TeamID         string
}

type DeleteOrganizationTeamUseCase ​

DeleteOrganizationTeamUseCase defines the unimplemented delete organization team operation.

go
type DeleteOrganizationTeamUseCase struct{}

func NewDeleteOrganizationTeamUseCase ​

go
func NewDeleteOrganizationTeamUseCase() *DeleteOrganizationTeamUseCase

NewDeleteOrganizationTeamUseCase creates the documentation-first operation.

func (*DeleteOrganizationTeamUseCase) Execute ​

go
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.

go
type EditMemberParams struct {
    Status string `json:"status" enum:"active,inactive"`
}

type EditOrganizationMemberInput ​

EditOrganizationMemberInput contains the edit organization member request parameters.

go
type EditOrganizationMemberInput struct {
    Authorization  string
    OrganizationID string
    MemberID       string
    Params         EditMemberParams
}

type EditOrganizationMemberUseCase ​

EditOrganizationMemberUseCase defines the unimplemented edit organization member operation.

go
type EditOrganizationMemberUseCase struct{}

func NewEditOrganizationMemberUseCase ​

go
func NewEditOrganizationMemberUseCase() *EditOrganizationMemberUseCase

NewEditOrganizationMemberUseCase creates the documentation-first edit organization member use case.

func (*EditOrganizationMemberUseCase) Execute ​

go
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.

go
type GetActiveOrganizationContextInput struct {
    Authorization string
}

type GetActiveOrganizationContextUseCase ​

GetActiveOrganizationContextUseCase defines the unimplemented get active organization context operation.

go
type GetActiveOrganizationContextUseCase struct{}

func NewGetActiveOrganizationContextUseCase ​

go
func NewGetActiveOrganizationContextUseCase() *GetActiveOrganizationContextUseCase

NewGetActiveOrganizationContextUseCase creates the documentation-first operation.

func (*GetActiveOrganizationContextUseCase) Execute ​

go
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.

go
type GetOrganizationProfileInput struct {
    Authorization    string
    OrganizationSlug string
}

type GetOrganizationProfileUseCase ​

GetOrganizationProfileUseCase retrieves the authenticated member's own profile.

go
type GetOrganizationProfileUseCase struct {
    // contains filtered or unexported fields
}

func NewGetOrganizationProfileUseCase ​

go
func NewGetOrganizationProfileUseCase(identity types.IIdentityService, accounts identitypublic.AccountReader, organizations ports.OrganizationRepository, members ports.MemberRepository, authorization authorizationpublic.MemberAuthorizationReader) *GetOrganizationProfileUseCase

NewGetOrganizationProfileUseCase wires identity, membership and scoped authorization readers.

func (*GetOrganizationProfileUseCase) Execute ​

go
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.

go
type GetOrganizationTeamInput struct {
    Authorization  string
    OrganizationID string
    TeamID         string
}

type GetOrganizationTeamUseCase ​

GetOrganizationTeamUseCase defines the unimplemented get organization team operation.

go
type GetOrganizationTeamUseCase struct{}

func NewGetOrganizationTeamUseCase ​

go
func NewGetOrganizationTeamUseCase() *GetOrganizationTeamUseCase

NewGetOrganizationTeamUseCase creates the documentation-first operation.

func (*GetOrganizationTeamUseCase) Execute ​

go
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.

go
type GetOrganizationUseCase struct {
    // contains filtered or unexported fields
}

func NewGetOrganizationUseCase ​

go
func NewGetOrganizationUseCase(repo ports.OrganizationRepository) *GetOrganizationUseCase

NewGetOrganizationUseCase instantiates a new GetOrganizationUseCase.

func (*GetOrganizationUseCase) Execute ​

go
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.

go
type InviteDoctorParams struct {
    Email string `json:"email" format:"email" minLength:"1" maxLength:"255"`
}

type InviteMemberDTO ​

InviteMemberDTO contains parameters to invite a member.

go
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.

go
type InviteMemberUseCase struct {
    // contains filtered or unexported fields
}

func NewInviteMemberUseCase ​

go
func NewInviteMemberUseCase(repo ports.MemberRepository) *InviteMemberUseCase

NewInviteMemberUseCase instantiates a new InviteMemberUseCase.

func (*InviteMemberUseCase) Execute ​

go
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.

go
type InviteOrganizationDoctorInput struct {
    Authorization  string
    OrganizationID string
    Params         InviteDoctorParams
}

type InviteOrganizationDoctorUseCase ​

InviteOrganizationDoctorUseCase defines the unimplemented invite organization doctor operation.

go
type InviteOrganizationDoctorUseCase struct{}

func NewInviteOrganizationDoctorUseCase ​

go
func NewInviteOrganizationDoctorUseCase() *InviteOrganizationDoctorUseCase

NewInviteOrganizationDoctorUseCase creates the documentation-first invite organization doctor use case.

func (*InviteOrganizationDoctorUseCase) Execute ​

go
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.

go
type InvoiceView = subscriptionpublic.OrganizationInvoice

type ListDoctorInvitationsInput ​

ListDoctorInvitationsInput contains the list doctor invitations request parameters.

go
type ListDoctorInvitationsInput struct {
    Authorization  string
    OrganizationID string
    Limit          int
    Cursor         string
}

type ListDoctorInvitationsUseCase ​

ListDoctorInvitationsUseCase defines the unimplemented list doctor invitations operation.

go
type ListDoctorInvitationsUseCase struct{}

func NewListDoctorInvitationsUseCase ​

go
func NewListDoctorInvitationsUseCase() *ListDoctorInvitationsUseCase

NewListDoctorInvitationsUseCase creates the documentation-first list doctor invitations use case.

func (*ListDoctorInvitationsUseCase) Execute ​

go
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.

go
type ListIncomingDoctorJoinRequestsInput struct {
    Authorization  string
    OrganizationID string
    Limit          int
    Cursor         string
}

type ListIncomingDoctorJoinRequestsUseCase ​

ListIncomingDoctorJoinRequestsUseCase defines the unimplemented list incoming doctor join requests operation.

go
type ListIncomingDoctorJoinRequestsUseCase struct{}

func NewListIncomingDoctorJoinRequestsUseCase ​

go
func NewListIncomingDoctorJoinRequestsUseCase() *ListIncomingDoctorJoinRequestsUseCase

NewListIncomingDoctorJoinRequestsUseCase creates the documentation-first list incoming doctor join requests use case.

func (*ListIncomingDoctorJoinRequestsUseCase) Execute ​

go
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.

go
type ListMembersUseCase struct {
    // contains filtered or unexported fields
}

func NewListMembersUseCase ​

go
func NewListMembersUseCase(repo ports.MemberRepository) *ListMembersUseCase

NewListMembersUseCase instantiates a new ListMembersUseCase.

func (*ListMembersUseCase) Execute ​

go
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.

go
type ListMyOrganizationsInput struct {
    Authorization string
    Limit         int
    Cursor        string
}

type ListMyOrganizationsUseCase ​

ListMyOrganizationsUseCase defines the unimplemented list my organizations operation.

go
type ListMyOrganizationsUseCase struct{}

func NewListMyOrganizationsUseCase ​

go
func NewListMyOrganizationsUseCase() *ListMyOrganizationsUseCase

NewListMyOrganizationsUseCase creates the documentation-first list my organizations use case.

func (*ListMyOrganizationsUseCase) Execute ​

go
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.

go
type ListOrganizationDoctorsInput struct {
    Authorization, OrganizationID, Search, Status, Cursor string
    Limit                                                 int
}

type ListOrganizationDoctorsUseCase ​

ListOrganizationDoctorsUseCase authorizes scoped reads and enriches affiliations.

go
type ListOrganizationDoctorsUseCase struct {
    Dependencies OrganizationDoctorDependencies
}

func NewListOrganizationDoctorsUseCase ​

go
func NewListOrganizationDoctorsUseCase() *ListOrganizationDoctorsUseCase

NewListOrganizationDoctorsUseCase 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 ​

go
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.

go
type ListOrganizationInvoicesInput struct {
    Authorization  string
    OrganizationID string
    Limit          int
    Cursor         string
}

type ListOrganizationInvoicesUseCase ​

ListOrganizationInvoicesUseCase defines the unimplemented list organization invoices operation.

go
type ListOrganizationInvoicesUseCase struct{ Dependencies BillingReadDependencies }

func NewListOrganizationInvoicesUseCase ​

go
func NewListOrganizationInvoicesUseCase() *ListOrganizationInvoicesUseCase

NewListOrganizationInvoicesUseCase creates the documentation-first list organization invoices use case.

func (*ListOrganizationInvoicesUseCase) Execute ​

go
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.

go
type ListOrganizationMembersInput struct {
    Authorization  string
    OrganizationID string
    Limit          int
    Cursor         string
}

type ListOrganizationMembersUseCase ​

ListOrganizationMembersUseCase defines the unimplemented list organization members operation.

go
type ListOrganizationMembersUseCase struct{}

func NewListOrganizationMembersUseCase ​

go
func NewListOrganizationMembersUseCase() *ListOrganizationMembersUseCase

NewListOrganizationMembersUseCase creates the documentation-first list organization members use case.

func (*ListOrganizationMembersUseCase) Execute ​

go
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.

go
type ListOrganizationsUseCase struct {
    // contains filtered or unexported fields
}

func NewListOrganizationsUseCase ​

go
func NewListOrganizationsUseCase(repo ports.OrganizationRepository) *ListOrganizationsUseCase

NewListOrganizationsUseCase instantiates a new ListOrganizationsUseCase.

func (*ListOrganizationsUseCase) Execute ​

go
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.

go
type ListTeamsUseCase struct {
    // contains filtered or unexported fields
}

func NewListTeamsUseCase ​

go
func NewListTeamsUseCase(repo ports.TeamRepository) *ListTeamsUseCase

NewListTeamsUseCase instantiates a new ListTeamsUseCase.

func (*ListTeamsUseCase) Execute ​

go
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.

go
type LoginInput struct{ Email, Password, IPAddress, UserAgent string }

type LoginUseCase ​

LoginUseCase authenticates an active member of at least one active organization.

go
type LoginUseCase struct {
    // contains filtered or unexported fields
}

func NewLoginUseCase ​

go
func NewLoginUseCase(authentication identitypublic.AuthenticationService, organizations ports.OrganizationRepository, members ports.MemberRepository) *LoginUseCase

NewLoginUseCase wires Identity authentication and organization repositories.

func (*LoginUseCase) Execute ​

go
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.

go
type ManagementEmpty struct{}

type MemberView ​

MemberView describes an ordinary organization member, separate from doctor affiliations.

go
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.

go
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.

go
type OrganizationDoctor = org.OrganizationDoctor

type OrganizationDoctorDependencies ​

OrganizationDoctorDependencies are configured by the composition root before serving.

go
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.

go
type OrganizationDoctorItem = org.OrganizationDoctorItem

type OrganizationDoctorReader ​

OrganizationDoctorReader shares affiliation reads across independently authorized portals.

go
type OrganizationDoctorReader struct {
    Dependencies OrganizationDoctorDependencies
}

func (*OrganizationDoctorReader) GetOrganizationDoctor ​

go
func (r *OrganizationDoctorReader) GetOrganizationDoctor(ctx context.Context, organizationID, doctorID string) (*org.OrganizationDoctorItem, error)

GetOrganizationDoctor requires the exact organization/profile intersection.

func (*OrganizationDoctorReader) ListOrganizationDoctors ​

go
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.

go
type OrganizationDoctorsPage = org.OrganizationDoctorsPage

type PatchDoctorAffiliationInput ​

PatchDoctorAffiliationInput contains the documentation-first request parameters.

go
type PatchDoctorAffiliationInput struct {
    Authorization  string
    OrganizationID string
    DoctorID       string
    Params         PatchDoctorAffiliationParams
}

type PatchDoctorAffiliationParams ​

PatchDoctorAffiliationParams changes affiliation status independently of ordinary membership.

go
type PatchDoctorAffiliationParams struct {
    Status string `json:"status" enum:"active,inactive"`
}

type PatchDoctorAffiliationUseCase ​

PatchDoctorAffiliationUseCase defines the unimplemented update doctor affiliation status operation.

go
type PatchDoctorAffiliationUseCase struct{}

func NewPatchDoctorAffiliationUseCase ​

go
func NewPatchDoctorAffiliationUseCase() *PatchDoctorAffiliationUseCase

NewPatchDoctorAffiliationUseCase creates the documentation-first operation.

func (*PatchDoctorAffiliationUseCase) Execute ​

go
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.

go
type PatchOrganizationTeamInput struct {
    Authorization  string
    OrganizationID string
    TeamID         string
    Params         PatchOrganizationTeamParams
}

type PatchOrganizationTeamParams ​

PatchOrganizationTeamParams preserves omissions; an empty description clears it.

go
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.

go
type PatchOrganizationTeamUseCase struct{}

func NewPatchOrganizationTeamUseCase ​

go
func NewPatchOrganizationTeamUseCase() *PatchOrganizationTeamUseCase

NewPatchOrganizationTeamUseCase creates the documentation-first operation.

func (*PatchOrganizationTeamUseCase) Execute ​

go
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.

go
type PatchPortalOrganizationInput struct {
    Authorization  string
    OrganizationID string
    Params         PatchPortalOrganizationParams
}

type PatchPortalOrganizationParams ​

PatchPortalOrganizationParams preserves omissions; empty strings clear optional contact fields.

go
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.

go
type PatchPortalOrganizationUseCase struct{}

func NewPatchPortalOrganizationUseCase ​

go
func NewPatchPortalOrganizationUseCase() *PatchPortalOrganizationUseCase

NewPatchPortalOrganizationUseCase creates the documentation-first operation.

func (*PatchPortalOrganizationUseCase) Execute ​

go
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.

go
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.

go
type RejectDoctorJoinRequestInput struct {
    Authorization  string
    OrganizationID string
    RequestID      string
}

type RejectDoctorJoinRequestUseCase ​

RejectDoctorJoinRequestUseCase defines the unimplemented reject doctor join request operation.

go
type RejectDoctorJoinRequestUseCase struct{}

func NewRejectDoctorJoinRequestUseCase ​

go
func NewRejectDoctorJoinRequestUseCase() *RejectDoctorJoinRequestUseCase

NewRejectDoctorJoinRequestUseCase creates the documentation-first reject doctor join request use case.

func (*RejectDoctorJoinRequestUseCase) Execute ​

go
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.

go
type RemoveMemberUseCase struct {
    // contains filtered or unexported fields
}

func NewRemoveMemberUseCase ​

go
func NewRemoveMemberUseCase(repo ports.MemberRepository, supplied ...ports.MutationRunner) *RemoveMemberUseCase

NewRemoveMemberUseCase instantiates a new RemoveMemberUseCase.

func (*RemoveMemberUseCase) Execute ​

go
func (uc *RemoveMemberUseCase) Execute(ctx context.Context, organizationID, membershipID string) error

Execute removes a member from an organization.

type RevokeDoctorInvitationInput ​

RevokeDoctorInvitationInput contains the revoke doctor invitation request parameters.

go
type RevokeDoctorInvitationInput struct {
    Authorization  string
    OrganizationID string
    InvitationID   string
}

type RevokeDoctorInvitationUseCase ​

RevokeDoctorInvitationUseCase defines the unimplemented revoke doctor invitation operation.

go
type RevokeDoctorInvitationUseCase struct{}

func NewRevokeDoctorInvitationUseCase ​

go
func NewRevokeDoctorInvitationUseCase() *RevokeDoctorInvitationUseCase

NewRevokeDoctorInvitationUseCase creates the documentation-first revoke doctor invitation use case.

func (*RevokeDoctorInvitationUseCase) Execute ​

go
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.

go
type SetActiveContextUseCase struct {
    // contains filtered or unexported fields
}

func NewSetActiveContextUseCase ​

go
func NewSetActiveContextUseCase(repo ports.MemberRepository, supplied ...ports.MutationRunner) *SetActiveContextUseCase

NewSetActiveContextUseCase instantiates a new SetActiveContextUseCase.

func (*SetActiveContextUseCase) Execute ​

go
func (uc *SetActiveContextUseCase) Execute(ctx context.Context, userID, orgID string) error

Execute sets the active organization context for a user.

type SubscriptionPlanView ​

SubscriptionPlanView aliases the authoritative shared offering schema.

go
type SubscriptionPlanView = subscriptionpublic.Plan

type 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.

go
type SubscriptionPolicy struct {
    Services      sub.TransactionServices
    Organizations org.BillingOrganizations
    Enforce       bool
}

func (SubscriptionPolicy) Check ​

go
func (p SubscriptionPolicy) Check(ctx context.Context, tx pgx.Tx, organizationID string, members, doctors int, initialAdmin bool) error

Check evaluates application policy before the protected business mutation.

type SubscriptionView ​

SubscriptionView aliases the authoritative snapshot and effective-feature schema.

go
type SubscriptionView = subscriptionpublic.Subscription

type TeamView ​

TeamView describes an organization-owned team.

go
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.

go
type UpdateMemberRoleUseCase struct {
    // contains filtered or unexported fields
}

func NewUpdateMemberRoleUseCase ​

go
func NewUpdateMemberRoleUseCase(repo ports.MemberRepository) *UpdateMemberRoleUseCase

NewUpdateMemberRoleUseCase instantiates a new UpdateMemberRoleUseCase.

func (*UpdateMemberRoleUseCase) Execute ​

go
func (uc *UpdateMemberRoleUseCase) Execute(ctx context.Context, membershipID string, role domain.MemberRole) error

Execute updates a member's role.

type UpdateOrganizationDTO ​

UpdateOrganizationDTO identifies an organization and its replacement details.

go
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.

go
type UpdateOrganizationUseCase struct {
    // contains filtered or unexported fields
}

func NewUpdateOrganizationUseCase ​

go
func NewUpdateOrganizationUseCase(repo ports.OrganizationRepository) *UpdateOrganizationUseCase

NewUpdateOrganizationUseCase wires persistence for organization updates.

func (*UpdateOrganizationUseCase) Execute ​

go
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.

go
type VerifiedOrganizationMember struct {
    Identity     *identitypublic.Account
    Member       *domain.Member
    Organization *domain.Organization
}

type VerifyAuthInput ​

VerifyAuthInput optionally scopes membership verification to a request subdomain.

go
type VerifyAuthInput struct {
    Authorization    string
    OrganizationSlug string
}

type VerifyAuthUseCase ​

VerifyAuthUseCase verifies an active member, optionally in a specific organization.

go
type VerifyAuthUseCase struct {
    // contains filtered or unexported fields
}

func NewVerifyAuthUseCase ​

go
func NewVerifyAuthUseCase(identity types.IIdentityService, accounts identitypublic.AccountReader, organizations ports.OrganizationRepository, members ports.MemberRepository) *VerifyAuthUseCase

NewVerifyAuthUseCase wires identity validation and organization repositories.

func (*VerifyAuthUseCase) Execute ​

go
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.

go
type ViewOrganizationDoctorInput struct {
    Authorization  string
    OrganizationID string
    DoctorID       string
}

type ViewOrganizationDoctorUseCase ​

ViewOrganizationDoctorUseCase defines the unimplemented view organization doctor operation.

go
type ViewOrganizationDoctorUseCase struct{}

func NewViewOrganizationDoctorUseCase ​

go
func NewViewOrganizationDoctorUseCase() *ViewOrganizationDoctorUseCase

NewViewOrganizationDoctorUseCase creates the documentation-first view organization doctor use case.

func (*ViewOrganizationDoctorUseCase) Execute ​

go
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.

go
type ViewOrganizationInput struct {
    Authorization  string
    OrganizationID string
}

type ViewOrganizationMemberInput ​

ViewOrganizationMemberInput contains the view organization member request parameters.

go
type ViewOrganizationMemberInput struct {
    Authorization  string
    OrganizationID string
    MemberID       string
}

type ViewOrganizationMemberUseCase ​

ViewOrganizationMemberUseCase defines the unimplemented view organization member operation.

go
type ViewOrganizationMemberUseCase struct{}

func NewViewOrganizationMemberUseCase ​

go
func NewViewOrganizationMemberUseCase() *ViewOrganizationMemberUseCase

NewViewOrganizationMemberUseCase creates the documentation-first view organization member use case.

func (*ViewOrganizationMemberUseCase) Execute ​

go
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.

go
type ViewOrganizationSubscriptionInput struct {
    Authorization  string
    OrganizationID string
}

type ViewOrganizationSubscriptionUseCase ​

ViewOrganizationSubscriptionUseCase defines the unimplemented view organization subscription operation.

go
type ViewOrganizationSubscriptionUseCase struct{ Dependencies BillingReadDependencies }

func NewViewOrganizationSubscriptionUseCase ​

go
func NewViewOrganizationSubscriptionUseCase() *ViewOrganizationSubscriptionUseCase

NewViewOrganizationSubscriptionUseCase creates the documentation-first view organization subscription use case.

func (*ViewOrganizationSubscriptionUseCase) Execute ​

go
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.

go
type ViewOrganizationUseCase struct{}

func NewViewOrganizationUseCase ​

go
func NewViewOrganizationUseCase() *ViewOrganizationUseCase

NewViewOrganizationUseCase creates the documentation-first view organization use case.

func (*ViewOrganizationUseCase) Execute ​

go
func (uc *ViewOrganizationUseCase) Execute(_ context.Context, _ ViewOrganizationInput) (*organizationpublic.Organization, error)

Execute returns ErrNotImplemented until the operation is implemented.

Generated by gomarkdoc

Documentation follows the source. Planned contracts are marked explicitly.