Documentation
¶
Index ¶
- Constants
- Variables
- func NewService(orgRepo Repository, memberRepo MemberRepository, teamRepo TeamRepository, ...) *organization.Service
- type Config
- type CreateOrganizationRequest
- type CreateTeamRequest
- type DashboardExtension
- func (e *DashboardExtension) AddCustomPermission(c forge.Context) error
- func (e *DashboardExtension) CancelInvitation(c forge.Context) error
- func (e *DashboardExtension) CreateOrganization(c forge.Context) error
- func (e *DashboardExtension) CreateRoleTemplate(c forge.Context) error
- func (e *DashboardExtension) CreateTeam(c forge.Context) error
- func (e *DashboardExtension) DashboardWidgets() []ui.DashboardWidget
- func (e *DashboardExtension) DeleteOrganization(c forge.Context) error
- func (e *DashboardExtension) DeleteRoleTemplate(c forge.Context) error
- func (e *DashboardExtension) DeleteTeam(c forge.Context) error
- func (e *DashboardExtension) ExtensionID() string
- func (e *DashboardExtension) InviteMember(c forge.Context) error
- func (e *DashboardExtension) NavigationItems() []ui.NavigationItem
- func (e *DashboardExtension) RemoveMember(c forge.Context) error
- func (e *DashboardExtension) RenderDashboardWidget(basePath string, currentApp *app.App) g.Node
- func (e *DashboardExtension) RenderSettingsSection(basePath string, currentApp *app.App) g.Node
- func (e *DashboardExtension) Routes() []ui.Route
- func (e *DashboardExtension) SavePluginSettings(c forge.Context) error
- func (e *DashboardExtension) ServeCreateOrganizationPage(c forge.Context) error
- func (e *DashboardExtension) ServeCreateRoleTemplate(c forge.Context) error
- func (e *DashboardExtension) ServeEditRoleTemplate(c forge.Context) error
- func (e *DashboardExtension) ServeOrganizationDetailPage(c forge.Context) error
- func (e *DashboardExtension) ServeOrganizationInvitationsPage(c forge.Context) error
- func (e *DashboardExtension) ServeOrganizationMembersPage(c forge.Context) error
- func (e *DashboardExtension) ServeOrganizationSettings(c forge.Context) error
- func (e *DashboardExtension) ServeOrganizationTeamsPage(c forge.Context) error
- func (e *DashboardExtension) ServeOrganizationsListPage(c forge.Context) error
- func (e *DashboardExtension) ServeRoleTemplatesSettings(c forge.Context) error
- func (e *DashboardExtension) SetRegistry(registry *dashboard.ExtensionRegistry)
- func (e *DashboardExtension) SettingsPages() []ui.SettingsPage
- func (e *DashboardExtension) SettingsSections() []ui.SettingsSection
- func (e *DashboardExtension) UpdateMemberRole(c forge.Context) error
- func (e *DashboardExtension) UpdateOrganization(c forge.Context) error
- func (e *DashboardExtension) UpdateRoleTemplate(c forge.Context) error
- func (e *DashboardExtension) UpdateTeam(c forge.Context) error
- type ErrorResponse
- type InvitationRepository
- type InvitationResponse
- type InviteMemberRequest
- type MemberRepository
- type MembersListResponse
- type MembersResponse
- type MessageResponse
- type MockService
- func (m *MockService) AcceptInvitation(ctx context.Context, token string, userID xid.ID) (*organization.Member, error)
- func (m *MockService) AddMember(ctx context.Context, orgID, userID xid.ID, role string) (*organization.Member, error)
- func (m *MockService) AddTeamMember(ctx context.Context, teamID, memberID, adderUserID xid.ID) error
- func (m *MockService) CancelInvitation(ctx context.Context, id, cancellerUserID xid.ID) error
- func (m *MockService) CleanupExpiredInvitations(ctx context.Context) (int, error)
- func (m *MockService) CreateOrganization(ctx context.Context, req *organization.CreateOrganizationRequest, ...) (*organization.Organization, error)
- func (m *MockService) CreateTeam(ctx context.Context, orgID xid.ID, req *organization.CreateTeamRequest, ...) (*organization.Team, error)
- func (m *MockService) DeclineInvitation(ctx context.Context, token string) error
- func (m *MockService) DeleteOrganization(ctx context.Context, id, userID xid.ID) error
- func (m *MockService) DeleteTeam(ctx context.Context, id, deleterUserID xid.ID) error
- func (m *MockService) FindInvitationByID(ctx context.Context, id xid.ID) (*organization.Invitation, error)
- func (m *MockService) FindInvitationByToken(ctx context.Context, token string) (*organization.Invitation, error)
- func (m *MockService) FindMember(ctx context.Context, orgID, userID xid.ID) (*organization.Member, error)
- func (m *MockService) FindMemberByID(ctx context.Context, id xid.ID) (*organization.Member, error)
- func (m *MockService) FindOrganizationByID(ctx context.Context, id xid.ID) (*organization.Organization, error)
- func (m *MockService) FindOrganizationBySlug(ctx context.Context, appID, environmentID xid.ID, slug string) (*organization.Organization, error)
- func (m *MockService) FindTeamByID(ctx context.Context, id xid.ID) (*organization.Team, error)
- func (m *MockService) FindTeamByName(ctx context.Context, orgID xid.ID, name string) (*organization.Team, error)
- func (m *MockService) GetUserMemberships(ctx context.Context, userID xid.ID, filter *pagination.PaginationParams) (*pagination.PageResponse[*organization.Member], error)
- func (m *MockService) InviteMember(ctx context.Context, orgID xid.ID, req *organization.InviteMemberRequest, ...) (*organization.Invitation, error)
- func (m *MockService) IsAdmin(ctx context.Context, orgID, userID xid.ID) (bool, error)
- func (m *MockService) IsMember(ctx context.Context, orgID, userID xid.ID) (bool, error)
- func (m *MockService) IsOwner(ctx context.Context, orgID, userID xid.ID) (bool, error)
- func (m *MockService) IsTeamMember(ctx context.Context, teamID, memberID xid.ID) (bool, error)
- func (m *MockService) ListInvitations(ctx context.Context, filter *organization.ListInvitationsFilter) (*pagination.PageResponse[*organization.Invitation], error)
- func (m *MockService) ListMembers(ctx context.Context, filter *organization.ListMembersFilter) (*pagination.PageResponse[*organization.Member], error)
- func (m *MockService) ListOrganizations(ctx context.Context, filter *organization.ListOrganizationsFilter) (*pagination.PageResponse[*organization.Organization], error)
- func (m *MockService) ListTeamMembers(ctx context.Context, filter *organization.ListTeamMembersFilter) (*pagination.PageResponse[*organization.TeamMember], error)
- func (m *MockService) ListTeams(ctx context.Context, filter *organization.ListTeamsFilter) (*pagination.PageResponse[*organization.Team], error)
- func (m *MockService) ListUserOrganizations(ctx context.Context, userID xid.ID, filter *pagination.PaginationParams) (*pagination.PageResponse[*organization.Organization], error)
- func (m *MockService) RemoveMember(ctx context.Context, id, removerUserID xid.ID) error
- func (m *MockService) RemoveTeamMember(ctx context.Context, teamID, memberID, removerUserID xid.ID) error
- func (m *MockService) RemoveUserFromAllOrganizations(ctx context.Context, userID xid.ID) error
- func (m *MockService) RequireAdmin(ctx context.Context, orgID, userID xid.ID) error
- func (m *MockService) RequireOwner(ctx context.Context, orgID, userID xid.ID) error
- func (m *MockService) ResendInvitation(ctx context.Context, id, resenderUserID xid.ID) (*organization.Invitation, error)
- func (m *MockService) UpdateMember(ctx context.Context, id xid.ID, req *organization.UpdateMemberRequest, ...) (*organization.Member, error)
- func (m *MockService) UpdateOrganization(ctx context.Context, id xid.ID, req *organization.UpdateOrganizationRequest) (*organization.Organization, error)
- func (m *MockService) UpdateTeam(ctx context.Context, id xid.ID, req *organization.UpdateTeamRequest, ...) (*organization.Team, error)
- type OrganizationHandler
- func (h *OrganizationHandler) AcceptInvitation(c forge.Context) error
- func (h *OrganizationHandler) CreateOrganization(c forge.Context) error
- func (h *OrganizationHandler) CreateTeam(c forge.Context) error
- func (h *OrganizationHandler) DeclineInvitation(c forge.Context) error
- func (h *OrganizationHandler) DeleteOrganization(c forge.Context) error
- func (h *OrganizationHandler) DeleteTeam(c forge.Context) error
- func (h *OrganizationHandler) GetOrganization(c forge.Context) error
- func (h *OrganizationHandler) GetOrganizationBySlug(c forge.Context) error
- func (h *OrganizationHandler) InviteMember(c forge.Context) error
- func (h *OrganizationHandler) ListMembers(c forge.Context) error
- func (h *OrganizationHandler) ListOrganizations(c forge.Context) error
- func (h *OrganizationHandler) ListTeams(c forge.Context) error
- func (h *OrganizationHandler) RemoveMember(c forge.Context) error
- func (h *OrganizationHandler) UpdateMember(c forge.Context) error
- func (h *OrganizationHandler) UpdateOrganization(c forge.Context) error
- func (h *OrganizationHandler) UpdateTeam(c forge.Context) error
- type OrganizationsListResponse
- type Plugin
- func (p *Plugin) DashboardExtension() ui.DashboardExtension
- func (p *Plugin) ID() string
- func (p *Plugin) Init(authInstance core.Authsome) error
- func (p *Plugin) Migrate() error
- func (p *Plugin) RegisterHooks(hooks *hooks.HookRegistry) error
- func (p *Plugin) RegisterRoutes(router forge.Router) error
- func (p *Plugin) RegisterServiceDecorators(services *registry.ServiceRegistry) error
- type PluginOption
- func WithDefaultConfig(cfg Config) PluginOption
- func WithEnableUserCreation(enabled bool) PluginOption
- func WithInvitationExpiryHours(hours int) PluginOption
- func WithMaxMembersPerOrganization(max int) PluginOption
- func WithMaxOrganizationsPerUser(max int) PluginOption
- func WithMaxTeamsPerOrganization(max int) PluginOption
- func WithRequireInvitation(required bool) PluginOption
- type Repository
- type Service
- type StatusResponse
- type TeamRepository
- type TeamsListResponse
- type TeamsResponse
- type UpdateMemberRequest
- type UpdateOrganizationRequest
- type UpdateTeamRequest
Constants ¶
const ( RoleOwner = organization.RoleOwner RoleAdmin = organization.RoleAdmin RoleMember = organization.RoleMember )
Organization member roles
const ( StatusActive = organization.StatusActive StatusSuspended = organization.StatusSuspended StatusPending = organization.StatusPending )
Organization member statuses
const ( InvitationStatusPending = organization.InvitationStatusPending InvitationStatusAccepted = organization.InvitationStatusAccepted InvitationStatusExpired = organization.InvitationStatusExpired InvitationStatusCancelled = organization.InvitationStatusCancelled InvitationStatusDeclined = organization.InvitationStatusDeclined )
Organization invitation statuses
Variables ¶
var ( ErrOrganizationNotFound = organization.ErrOrganizationNotFound ErrMemberNotFound = organization.ErrMemberNotFound ErrTeamNotFound = organization.ErrTeamNotFound ErrInvalidRole = organization.ErrInvalidRole ErrInvalidStatus = organization.ErrInvalidStatus ErrOrganizationSlugExists = organization.ErrOrganizationSlugExists ErrMemberAlreadyExists = organization.ErrMemberAlreadyExists ErrNotOwner = organization.ErrNotOwner ErrNotAdmin = organization.ErrNotAdmin ErrCannotRemoveOwner = organization.ErrCannotRemoveOwner ErrMaxOrganizationsReached = organization.ErrMaxOrganizationsReached )
Errors for organization plugin operations
Functions ¶
func NewService ¶
func NewService( orgRepo Repository, memberRepo MemberRepository, teamRepo TeamRepository, inviteRepo InvitationRepository, config Config, rbacSvc *rbac.Service, ) *organization.Service
NewService creates a new organization service
Types ¶
type CreateOrganizationRequest ¶
type CreateOrganizationRequest = organization.CreateOrganizationRequest
CreateOrganizationRequest represents the request to create an organization
type CreateTeamRequest ¶
type CreateTeamRequest = organization.CreateTeamRequest
CreateTeamRequest represents the request to create a team
type DashboardExtension ¶
type DashboardExtension struct {
// contains filtered or unexported fields
}
DashboardExtension implements the ui.DashboardExtension interface This allows the organization plugin to add its own screens to the dashboard
func NewDashboardExtension ¶
func NewDashboardExtension(plugin *Plugin) *DashboardExtension
NewDashboardExtension creates a new dashboard extension for organization
func (*DashboardExtension) AddCustomPermission ¶
func (e *DashboardExtension) AddCustomPermission(c forge.Context) error
AddCustomPermission handles creating custom permissions inline
func (*DashboardExtension) CancelInvitation ¶
func (e *DashboardExtension) CancelInvitation(c forge.Context) error
CancelInvitation handles invitation cancellation
func (*DashboardExtension) CreateOrganization ¶
func (e *DashboardExtension) CreateOrganization(c forge.Context) error
CreateOrganization handles organization creation
func (*DashboardExtension) CreateRoleTemplate ¶
func (e *DashboardExtension) CreateRoleTemplate(c forge.Context) error
CreateRoleTemplate handles role template creation
func (*DashboardExtension) CreateTeam ¶
func (e *DashboardExtension) CreateTeam(c forge.Context) error
CreateTeam handles team creation
func (*DashboardExtension) DashboardWidgets ¶
func (e *DashboardExtension) DashboardWidgets() []ui.DashboardWidget
DashboardWidgets returns widgets to show on the main dashboard
func (*DashboardExtension) DeleteOrganization ¶
func (e *DashboardExtension) DeleteOrganization(c forge.Context) error
DeleteOrganization handles organization deletion
func (*DashboardExtension) DeleteRoleTemplate ¶
func (e *DashboardExtension) DeleteRoleTemplate(c forge.Context) error
DeleteRoleTemplate handles role template deletion
func (*DashboardExtension) DeleteTeam ¶
func (e *DashboardExtension) DeleteTeam(c forge.Context) error
DeleteTeam handles team deletion
func (*DashboardExtension) ExtensionID ¶
func (e *DashboardExtension) ExtensionID() string
ExtensionID returns the unique identifier for this extension
func (*DashboardExtension) InviteMember ¶
func (e *DashboardExtension) InviteMember(c forge.Context) error
InviteMember handles member invitation
func (*DashboardExtension) NavigationItems ¶
func (e *DashboardExtension) NavigationItems() []ui.NavigationItem
NavigationItems returns navigation items to register
func (*DashboardExtension) RemoveMember ¶
func (e *DashboardExtension) RemoveMember(c forge.Context) error
RemoveMember handles member removal
func (*DashboardExtension) RenderDashboardWidget ¶
Dashboard widget rendering
func (*DashboardExtension) RenderSettingsSection ¶
Settings rendering
func (*DashboardExtension) Routes ¶
func (e *DashboardExtension) Routes() []ui.Route
Routes returns routes to register under /dashboard/app/:appId/
func (*DashboardExtension) SavePluginSettings ¶
func (e *DashboardExtension) SavePluginSettings(c forge.Context) error
SavePluginSettings handles plugin settings updates
func (*DashboardExtension) ServeCreateOrganizationPage ¶
func (e *DashboardExtension) ServeCreateOrganizationPage(c forge.Context) error
ServeCreateOrganizationPage renders the create organization page
func (*DashboardExtension) ServeCreateRoleTemplate ¶
func (e *DashboardExtension) ServeCreateRoleTemplate(c forge.Context) error
ServeCreateRoleTemplate renders the create role template form
func (*DashboardExtension) ServeEditRoleTemplate ¶
func (e *DashboardExtension) ServeEditRoleTemplate(c forge.Context) error
ServeEditRoleTemplate renders the edit role template form
func (*DashboardExtension) ServeOrganizationDetailPage ¶
func (e *DashboardExtension) ServeOrganizationDetailPage(c forge.Context) error
ServeOrganizationDetailPage renders the organization detail page
func (*DashboardExtension) ServeOrganizationInvitationsPage ¶
func (e *DashboardExtension) ServeOrganizationInvitationsPage(c forge.Context) error
ServeOrganizationInvitationsPage renders the invitations page
func (*DashboardExtension) ServeOrganizationMembersPage ¶
func (e *DashboardExtension) ServeOrganizationMembersPage(c forge.Context) error
ServeOrganizationMembersPage renders the members management page
func (*DashboardExtension) ServeOrganizationSettings ¶
func (e *DashboardExtension) ServeOrganizationSettings(c forge.Context) error
ServeOrganizationSettings renders the organization settings page
func (*DashboardExtension) ServeOrganizationTeamsPage ¶
func (e *DashboardExtension) ServeOrganizationTeamsPage(c forge.Context) error
ServeOrganizationTeamsPage renders the teams management page
func (*DashboardExtension) ServeOrganizationsListPage ¶
func (e *DashboardExtension) ServeOrganizationsListPage(c forge.Context) error
ServeOrganizationsListPage renders the organizations list page
func (*DashboardExtension) ServeRoleTemplatesSettings ¶
func (e *DashboardExtension) ServeRoleTemplatesSettings(c forge.Context) error
ServeRoleTemplatesSettings renders the role templates settings page
func (*DashboardExtension) SetRegistry ¶
func (e *DashboardExtension) SetRegistry(registry *dashboard.ExtensionRegistry)
SetRegistry sets the extension registry reference (called by dashboard after registration)
func (*DashboardExtension) SettingsPages ¶
func (e *DashboardExtension) SettingsPages() []ui.SettingsPage
SettingsPages returns full settings pages for the new sidebar layout
func (*DashboardExtension) SettingsSections ¶
func (e *DashboardExtension) SettingsSections() []ui.SettingsSection
SettingsSections returns settings sections to add to the settings page Deprecated: Use SettingsPages() instead
func (*DashboardExtension) UpdateMemberRole ¶
func (e *DashboardExtension) UpdateMemberRole(c forge.Context) error
UpdateMemberRole handles member role updates
func (*DashboardExtension) UpdateOrganization ¶
func (e *DashboardExtension) UpdateOrganization(c forge.Context) error
UpdateOrganization handles organization updates
func (*DashboardExtension) UpdateRoleTemplate ¶
func (e *DashboardExtension) UpdateRoleTemplate(c forge.Context) error
UpdateRoleTemplate handles role template updates
func (*DashboardExtension) UpdateTeam ¶
func (e *DashboardExtension) UpdateTeam(c forge.Context) error
UpdateTeam handles team updates
type ErrorResponse ¶
type ErrorResponse = responses.ErrorResponse
DTOs for organization routes - use shared responses from core
type InvitationRepository ¶
type InvitationRepository = organization.InvitationRepository
InvitationRepository type alias
type InvitationResponse ¶
type InvitationResponse struct {
Invitation *organization.Invitation `json:"invitation"`
Message string `json:"message,omitempty"`
}
type InviteMemberRequest ¶
type InviteMemberRequest = organization.InviteMemberRequest
InviteMemberRequest represents the request to invite a member
type MemberRepository ¶
type MemberRepository = organization.MemberRepository
MemberRepository type alias
type MembersListResponse ¶
type MembersListResponse []schema.OrganizationMember
MembersListResponse represents a list of members
type MembersResponse ¶
type MembersResponse struct {
Members []*organization.Member `json:"members"`
Total int `json:"total,omitempty"`
}
type MessageResponse ¶
type MessageResponse = responses.MessageResponse
Response types Use shared response type
type MockService ¶
type MockService struct {
// Error injection for testing
CreateOrgError error
FindOrgError error
AddMemberError error
InviteMemberError error
AcceptInvitationError error
// contains filtered or unexported fields
}
MockService provides a mock implementation of organization.Service for testing
func NewMockService ¶
func NewMockService() *MockService
NewMockService creates a new mock organization service
func (*MockService) AcceptInvitation ¶
func (m *MockService) AcceptInvitation(ctx context.Context, token string, userID xid.ID) (*organization.Member, error)
func (*MockService) AddMember ¶
func (m *MockService) AddMember(ctx context.Context, orgID, userID xid.ID, role string) (*organization.Member, error)
AddMember mocks adding a member
func (*MockService) AddTeamMember ¶
func (*MockService) CancelInvitation ¶
func (*MockService) CleanupExpiredInvitations ¶
func (m *MockService) CleanupExpiredInvitations(ctx context.Context) (int, error)
func (*MockService) CreateOrganization ¶
func (m *MockService) CreateOrganization(ctx context.Context, req *organization.CreateOrganizationRequest, creatorUserID, appID, environmentID xid.ID) (*organization.Organization, error)
CreateOrganization mocks creating an organization
func (*MockService) CreateTeam ¶
func (m *MockService) CreateTeam(ctx context.Context, orgID xid.ID, req *organization.CreateTeamRequest, creatorUserID xid.ID) (*organization.Team, error)
func (*MockService) DeclineInvitation ¶
func (m *MockService) DeclineInvitation(ctx context.Context, token string) error
func (*MockService) DeleteOrganization ¶
DeleteOrganization mocks deleting an organization
func (*MockService) DeleteTeam ¶
func (*MockService) FindInvitationByID ¶
func (m *MockService) FindInvitationByID(ctx context.Context, id xid.ID) (*organization.Invitation, error)
func (*MockService) FindInvitationByToken ¶
func (m *MockService) FindInvitationByToken(ctx context.Context, token string) (*organization.Invitation, error)
func (*MockService) FindMember ¶
func (m *MockService) FindMember(ctx context.Context, orgID, userID xid.ID) (*organization.Member, error)
FindMember mocks finding a member by org and user ID
func (*MockService) FindMemberByID ¶
func (m *MockService) FindMemberByID(ctx context.Context, id xid.ID) (*organization.Member, error)
FindMemberByID mocks finding a member by ID
func (*MockService) FindOrganizationByID ¶
func (m *MockService) FindOrganizationByID(ctx context.Context, id xid.ID) (*organization.Organization, error)
FindOrganizationByID mocks finding an organization by ID
func (*MockService) FindOrganizationBySlug ¶
func (m *MockService) FindOrganizationBySlug(ctx context.Context, appID, environmentID xid.ID, slug string) (*organization.Organization, error)
FindOrganizationBySlug mocks finding an organization by slug
func (*MockService) FindTeamByID ¶
func (m *MockService) FindTeamByID(ctx context.Context, id xid.ID) (*organization.Team, error)
func (*MockService) FindTeamByName ¶
func (m *MockService) FindTeamByName(ctx context.Context, orgID xid.ID, name string) (*organization.Team, error)
func (*MockService) GetUserMemberships ¶
func (m *MockService) GetUserMemberships(ctx context.Context, userID xid.ID, filter *pagination.PaginationParams) (*pagination.PageResponse[*organization.Member], error)
GetUserMemberships mocks getting user memberships
func (*MockService) InviteMember ¶
func (m *MockService) InviteMember(ctx context.Context, orgID xid.ID, req *organization.InviteMemberRequest, inviterUserID xid.ID) (*organization.Invitation, error)
func (*MockService) IsTeamMember ¶
func (*MockService) ListInvitations ¶
func (m *MockService) ListInvitations(ctx context.Context, filter *organization.ListInvitationsFilter) (*pagination.PageResponse[*organization.Invitation], error)
func (*MockService) ListMembers ¶
func (m *MockService) ListMembers(ctx context.Context, filter *organization.ListMembersFilter) (*pagination.PageResponse[*organization.Member], error)
ListMembers mocks listing members
func (*MockService) ListOrganizations ¶
func (m *MockService) ListOrganizations(ctx context.Context, filter *organization.ListOrganizationsFilter) (*pagination.PageResponse[*organization.Organization], error)
ListOrganizations mocks listing organizations
func (*MockService) ListTeamMembers ¶
func (m *MockService) ListTeamMembers(ctx context.Context, filter *organization.ListTeamMembersFilter) (*pagination.PageResponse[*organization.TeamMember], error)
func (*MockService) ListTeams ¶
func (m *MockService) ListTeams(ctx context.Context, filter *organization.ListTeamsFilter) (*pagination.PageResponse[*organization.Team], error)
func (*MockService) ListUserOrganizations ¶
func (m *MockService) ListUserOrganizations(ctx context.Context, userID xid.ID, filter *pagination.PaginationParams) (*pagination.PageResponse[*organization.Organization], error)
ListUserOrganizations mocks listing user organizations
func (*MockService) RemoveMember ¶
RemoveMember mocks removing a member
func (*MockService) RemoveTeamMember ¶
func (*MockService) RemoveUserFromAllOrganizations ¶
RemoveUserFromAllOrganizations mocks removing user from all orgs
func (*MockService) RequireAdmin ¶
RequireAdmin mocks requiring admin status
func (*MockService) RequireOwner ¶
RequireOwner mocks requiring owner status
func (*MockService) ResendInvitation ¶
func (m *MockService) ResendInvitation(ctx context.Context, id, resenderUserID xid.ID) (*organization.Invitation, error)
func (*MockService) UpdateMember ¶
func (m *MockService) UpdateMember(ctx context.Context, id xid.ID, req *organization.UpdateMemberRequest, updaterUserID xid.ID) (*organization.Member, error)
UpdateMember mocks updating a member
func (*MockService) UpdateOrganization ¶
func (m *MockService) UpdateOrganization(ctx context.Context, id xid.ID, req *organization.UpdateOrganizationRequest) (*organization.Organization, error)
UpdateOrganization mocks updating an organization
func (*MockService) UpdateTeam ¶
func (m *MockService) UpdateTeam(ctx context.Context, id xid.ID, req *organization.UpdateTeamRequest, updaterUserID xid.ID) (*organization.Team, error)
type OrganizationHandler ¶
type OrganizationHandler struct {
// contains filtered or unexported fields
}
OrganizationHandler handles organization-related HTTP requests
func NewOrganizationHandler ¶
func NewOrganizationHandler(orgService *organization.Service) *OrganizationHandler
NewOrganizationHandler creates a new organization handler
func (*OrganizationHandler) AcceptInvitation ¶
func (h *OrganizationHandler) AcceptInvitation(c forge.Context) error
AcceptInvitation handles invitation acceptance requests
func (*OrganizationHandler) CreateOrganization ¶
func (h *OrganizationHandler) CreateOrganization(c forge.Context) error
CreateOrganization handles organization creation requests
func (*OrganizationHandler) CreateTeam ¶
func (h *OrganizationHandler) CreateTeam(c forge.Context) error
CreateTeam handles team creation requests
func (*OrganizationHandler) DeclineInvitation ¶
func (h *OrganizationHandler) DeclineInvitation(c forge.Context) error
DeclineInvitation handles invitation decline requests
func (*OrganizationHandler) DeleteOrganization ¶
func (h *OrganizationHandler) DeleteOrganization(c forge.Context) error
DeleteOrganization handles organization deletion requests
func (*OrganizationHandler) DeleteTeam ¶
func (h *OrganizationHandler) DeleteTeam(c forge.Context) error
DeleteTeam handles team deletion requests
func (*OrganizationHandler) GetOrganization ¶
func (h *OrganizationHandler) GetOrganization(c forge.Context) error
GetOrganization handles get organization requests
func (*OrganizationHandler) GetOrganizationBySlug ¶
func (h *OrganizationHandler) GetOrganizationBySlug(c forge.Context) error
GetOrganizationBySlug handles get organization by slug requests
func (*OrganizationHandler) InviteMember ¶
func (h *OrganizationHandler) InviteMember(c forge.Context) error
InviteMember handles member invitation requests
func (*OrganizationHandler) ListMembers ¶
func (h *OrganizationHandler) ListMembers(c forge.Context) error
ListMembers handles list organization members requests
func (*OrganizationHandler) ListOrganizations ¶
func (h *OrganizationHandler) ListOrganizations(c forge.Context) error
ListOrganizations handles list organizations requests (user's organizations)
func (*OrganizationHandler) ListTeams ¶
func (h *OrganizationHandler) ListTeams(c forge.Context) error
ListTeams handles list teams requests
func (*OrganizationHandler) RemoveMember ¶
func (h *OrganizationHandler) RemoveMember(c forge.Context) error
RemoveMember handles member removal requests
func (*OrganizationHandler) UpdateMember ¶
func (h *OrganizationHandler) UpdateMember(c forge.Context) error
UpdateMember handles member update requests
func (*OrganizationHandler) UpdateOrganization ¶
func (h *OrganizationHandler) UpdateOrganization(c forge.Context) error
UpdateOrganization handles organization update requests
func (*OrganizationHandler) UpdateTeam ¶
func (h *OrganizationHandler) UpdateTeam(c forge.Context) error
UpdateTeam handles team update requests
type OrganizationsListResponse ¶
type OrganizationsListResponse []schema.Organization
OrganizationsListResponse represents a list of organizations
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin implements the user-created organizations plugin
func NewPlugin ¶
func NewPlugin(opts ...PluginOption) *Plugin
NewPlugin creates a new organization plugin instance with optional configuration
func (*Plugin) DashboardExtension ¶
func (p *Plugin) DashboardExtension() ui.DashboardExtension
DashboardExtension returns the dashboard extension interface implementation
func (*Plugin) RegisterHooks ¶
func (p *Plugin) RegisterHooks(hooks *hooks.HookRegistry) error
RegisterHooks registers the plugin's hooks
func (*Plugin) RegisterRoutes ¶
RegisterRoutes registers the plugin's HTTP routes
func (*Plugin) RegisterServiceDecorators ¶
func (p *Plugin) RegisterServiceDecorators(services *registry.ServiceRegistry) error
RegisterServiceDecorators registers service decorators
type PluginOption ¶
type PluginOption func(*Plugin)
PluginOption is a functional option for configuring the plugin
func WithDefaultConfig ¶
func WithDefaultConfig(cfg Config) PluginOption
WithDefaultConfig sets the default configuration for the plugin
func WithEnableUserCreation ¶
func WithEnableUserCreation(enabled bool) PluginOption
WithEnableUserCreation sets whether user creation is enabled
func WithInvitationExpiryHours ¶
func WithInvitationExpiryHours(hours int) PluginOption
WithInvitationExpiryHours sets the invitation expiry hours
func WithMaxMembersPerOrganization ¶
func WithMaxMembersPerOrganization(max int) PluginOption
WithMaxMembersPerOrganization sets the maximum members per organization
func WithMaxOrganizationsPerUser ¶
func WithMaxOrganizationsPerUser(max int) PluginOption
WithMaxOrganizationsPerUser sets the maximum organizations per user
func WithMaxTeamsPerOrganization ¶
func WithMaxTeamsPerOrganization(max int) PluginOption
WithMaxTeamsPerOrganization sets the maximum teams per organization
func WithRequireInvitation ¶
func WithRequireInvitation(required bool) PluginOption
WithRequireInvitation sets whether invitation is required
type Repository ¶
type Repository = organization.OrganizationRepository
Repository type aliases for core organization repositories
type StatusResponse ¶
type StatusResponse = responses.StatusResponse
type TeamsListResponse ¶
type TeamsListResponse []schema.OrganizationTeam
TeamsListResponse represents a list of teams
type TeamsResponse ¶
type TeamsResponse struct {
Teams []*organization.Team `json:"teams"`
Total int `json:"total,omitempty"`
}
type UpdateMemberRequest ¶
type UpdateMemberRequest = organization.UpdateMemberRequest
UpdateMemberRequest represents the request to update a member
type UpdateOrganizationRequest ¶
type UpdateOrganizationRequest = organization.UpdateOrganizationRequest
UpdateOrganizationRequest represents the request to update an organization
type UpdateTeamRequest ¶
type UpdateTeamRequest = organization.UpdateTeamRequest
UpdateTeamRequest represents the request to update a team