people

package
v0.9.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OfficershipRepo added in v0.9.6

type OfficershipRepo interface {
	OfficershipCount(c echo.Context) error
	ListOfficerships(c echo.Context) error
	GetOfficership(c echo.Context) error
	AddOfficership(c echo.Context) error
	EditOfficership(c echo.Context) error
	DeleteOfficership(c echo.Context) error
	ListOfficershipTeams(c echo.Context) error
	GetOfficershipTeam(c echo.Context) error
	AddOfficershipTeam(c echo.Context) error
	EditOfficershipTeam(c echo.Context) error
	DeleteOfficershipTeam(c echo.Context) error
	ListOfficers(c echo.Context) error
	GetOfficer(c echo.Context) error
	AddOfficer(c echo.Context) error
	EditOfficer(c echo.Context) error
	DeleteOfficer(c echo.Context) error
	OfficershipTeamAddOfficership(c echo.Context) error
	OfficershipTeamRemoveOfficership(c echo.Context) error
}

type PermissionRepo added in v0.9.6

type PermissionRepo interface {
	ListPermissions(c echo.Context) error
	ListPermissionsWithRolesCount(c echo.Context) error
	ListPermissionMembersByID(c echo.Context) error
	GetPermissionByID(c echo.Context) error
	GetPermissionByIDWithRolesCount(ctx echo.Context) error
	AddPermission(c echo.Context) error
	EditPermission(c echo.Context) error
	DeletePermission(c echo.Context) error
}

type Repos added in v0.9.6

type Repos interface {
	PermissionRepo
	RoleRepo
	UserRepo
	OfficershipRepo
}

func NewRepos added in v0.9.6

func NewRepos(db *sqlx.DB, cdn *s3.S3, access utils.Repo, cdnEndpoint string) Repos

NewRepos creates our data store

type RoleRepo added in v0.9.6

type RoleRepo interface {
	ListRolesWithPermissions(c echo.Context) error
	ListRolesWithCount(c echo.Context) error
	GetRoleFull(c echo.Context) error
	GetRole(c echo.Context) error
	ListRoleMembersByID(c echo.Context) error
	ListRolePermissionsByID(c echo.Context) error
	AddRole(c echo.Context) error
	EditRole(c echo.Context) error
	DeleteRole(c echo.Context) error
	RoleAddPermission(c echo.Context) error
	RoleRemovePermission(c echo.Context) error
	ListUsersNotInRole(c echo.Context) error
	ListPermissionsNotInRole(c echo.Context) error
	RoleAddUser(c echo.Context) error
	RoleRemoveUser(c echo.Context) error
}

type Store added in v0.9.6

type Store struct {
	// contains filtered or unexported fields
}

Store stores our dependencies

func (*Store) AddOfficer added in v0.9.6

func (s *Store) AddOfficer(c echo.Context) error

AddOfficer handles creating an officer

@Summary Create an officer @ID add-people-officership-officer @Tags people-officership-officer @Produce json @Param officership body people.OfficershipMemberAddEditDTO true "Officer object" @Success 201 {object} people.OfficershipMember @Router /v1/internal/people/officership/officer [post]

func (*Store) AddOfficership added in v0.9.6

func (s *Store) AddOfficership(c echo.Context) error

AddOfficership handles creating an officership

@Summary Create an officership @ID add-people-officership @Tags people-officership @Produce json @Param officership body people.OfficershipAddEditDTO true "Officership object" @Success 201 {object} people.Officership @Router /v1/internal/people/officership [post]

func (*Store) AddOfficershipTeam added in v0.9.6

func (s *Store) AddOfficershipTeam(c echo.Context) error

AddOfficershipTeam handles creating an officership team

@Summary Create an officership team @ID add-people-officership-team @Tags people-officership-team @Produce json @Param officership body people.OfficershipTeamAddEditDTO true "Officership Team object" @Success 201 {object} people.OfficershipTeam @Router /v1/internal/people/officership/team [post]

func (*Store) AddPermission added in v0.9.6

func (s *Store) AddPermission(c echo.Context) error

AddPermission handles creating a permission

@Summary Create a permission @ID add-people-permission @Tags people-permission @Produce json @Param permission body people.PermissionAddEditDTO true "Permission object" @Success 201 {object} people.Permission @Router /v1/internal/people/permission [post]

func (*Store) AddRole added in v0.9.6

func (s *Store) AddRole(c echo.Context) error

AddRole handles creating a role

@Summary Create a role @ID add-people-role @Tags people-role @Produce json @Param role body people.RoleAddEditDTO true "Role object" @Success 201 {object} people.Role @Router /v1/internal/people/role [post]

func (*Store) AddUser added in v0.9.6

func (s *Store) AddUser(c echo.Context) error

func (*Store) DeleteOfficer added in v0.9.6

func (s *Store) DeleteOfficer(c echo.Context) error

DeleteOfficer handles deleting an officer

@Summary Deletes officer @ID delete-people-officership-officer @Tags people-officership-officer @Param officerid path int true "officer id" @Produce json @Success 204 @Router /v1/internal/people/officership/officer/{officerid} [delete]

func (*Store) DeleteOfficership added in v0.9.6

func (s *Store) DeleteOfficership(c echo.Context) error

DeleteOfficership handles deleting an officership

@Summary Deletes officership @ID delete-people-officership @Tags people-officership @Param officershipid path int true "officership id" @Produce json @Success 204 @Router /v1/internal/people/officership/{officershipid} [delete]

func (*Store) DeleteOfficershipTeam added in v0.9.6

func (s *Store) DeleteOfficershipTeam(c echo.Context) error

DeleteOfficershipTeam handles deleting an officership team

@Summary Deletes officership team @ID delete-people-officership-team @Tags people-officership-team @Param officershipteamid path int true "officership team id" @Produce json @Success 204 @Router /v1/internal/people/officership/team/{officershipteamid} [delete]

func (*Store) DeletePermission added in v0.9.6

func (s *Store) DeletePermission(c echo.Context) error

DeletePermission handles deleting a permission

@Summary Deletes a permission and links to roles @ID delete-people-permission @Tags people-permission @Produce json @Param permissionid path int true "Permission ID" @Success 204 @Router /v1/internal/people/permission/{permissionid} [delete]

func (*Store) DeleteRole added in v0.9.6

func (s *Store) DeleteRole(c echo.Context) error

DeleteRole handles deleting a role

@Summary Deletes role @ID delete-people-role @Tags people-role @Param roleid path int true "role id" @Produce json @Success 204 @Router /v1/internal/people/role/{roleid} [delete]

func (*Store) EditOfficer added in v0.9.6

func (s *Store) EditOfficer(c echo.Context) error

EditOfficer handles editing an officer

@Summary Edits an officer @ID edit-people-officership-officer @Tags people-officership-officer @Produce json @Param officerid path int true "officer id" @Param officership body people.OfficershipMemberAddEditDTO true "Officer object" @Success 200 {object} people.OfficershipMember @Router /v1/internal/people/officership/officer/{officerid} [put]

func (*Store) EditOfficership added in v0.9.6

func (s *Store) EditOfficership(c echo.Context) error

EditOfficership handles editing an officership

@Summary Edits an officership @ID edit-people-officership @Tags people-officership @Produce json @Param officershipid path int true "officership id" @Param officership body people.OfficershipAddEditDTO true "Officership object" @Success 200 {object} people.Officership @Router /v1/internal/people/officership/{officershipid} [put]

func (*Store) EditOfficershipTeam added in v0.9.6

func (s *Store) EditOfficershipTeam(c echo.Context) error

EditOfficershipTeam handles editing an officership team

@Summary Edits an officership team @ID edit-people-officership-team @Tags people-officership-team @Produce json @Param officershipteamid path int true "officership team id" @Param officership body people.OfficershipTeamAddEditDTO true "Officership Team object" @Success 200 {object} people.OfficershipTeam @Router /v1/internal/people/officership/team/{officershipteamid} [put]

func (*Store) EditPermission added in v0.9.6

func (s *Store) EditPermission(c echo.Context) error

EditPermission handles editing a permission

@Summary Edits a permission @ID edit-people-permission @Tags people-permission @Produce json @Param permissionid path int true "Permission ID" @Param permission body people.PermissionAddEditDTO true "Permission object" @Success 200 {object} people.Permission @Router /v1/internal/people/permission/{permissionid} [put]

func (*Store) EditRole added in v0.9.6

func (s *Store) EditRole(c echo.Context) error

EditRole handles editing a role

@Summary Edit a role @ID edit-people-role @Tags people-role @Param roleid path int true "Role ID" @Produce json @Param role body people.RoleAddEditDTO true "Role object" @Success 200 {object} people.Role @Router /v1/internal/people/role/{roleid} [put]

func (*Store) GetOfficer added in v0.9.6

func (s *Store) GetOfficer(c echo.Context) error

GetOfficer handles getting an officer

@Summary Provides officer @ID get-people-officership-officer @Tags people-officership-officer @Param officerid path int true "officer id" @Produce json @Success 200 {object} people.OfficershipMember @Router /v1/internal/people/officership/officer/{officerid} [get]

func (*Store) GetOfficership added in v0.9.6

func (s *Store) GetOfficership(c echo.Context) error

GetOfficership handles getting an officership

@Summary Provides officership @Description Contains members and a range of descriptions @ID get-people-officership @Tags people-officership @Param officershipid path int true "officership id" @Produce json @Success 200 {object} people.Officership @Router /v1/internal/people/officership/{officershipid} [get]

func (*Store) GetOfficershipTeam added in v0.9.6

func (s *Store) GetOfficershipTeam(c echo.Context) error

GetOfficershipTeam handles getting an officership team

@Summary Provides officership team @Description Contains members and a range of descriptions @ID get-people-officership-team @Tags people-officership-team @Param officershipteamid path int true "officership team id" @Produce json @Success 200 {object} people.OfficershipTeam @Router /v1/internal/people/officership/team/{officershipteamid} [get]

func (*Store) GetPermissionByID added in v0.9.6

func (s *Store) GetPermissionByID(c echo.Context) error

GetPermissionByID handles getting a single permission

@Summary Get a single permission based on the permission id @ID get-people-permission @Tags people-permission @Produce json @Param permissionid path int true "Permission ID" @Success 200 {object} people.Permission @Router /v1/internal/people/permission/{permissionid} [get]

func (*Store) GetPermissionByIDWithRolesCount added in v0.9.6

func (s *Store) GetPermissionByIDWithRolesCount(c echo.Context) error

GetPermissionByIDWithRolesCount handles getting a single permission with roles count

@Summary Get a single permission based on the permission id with roles count @ID get-people-permission-count @Tags people-permission @Produce json @Param permissionid path int true "Permission ID" @Success 200 {object} people.PermissionWithRolesCount @Router /v1/internal/people/permission/{permissionid}/count [get]

func (*Store) GetRole added in v0.9.6

func (s *Store) GetRole(c echo.Context) error

GetRole handles getting a certain role

@Summary Provides a given role @ID get-people-role @Tags people-role @Produce json @Param roleid path int true "Role ID" @Success 200 {object} people.Role @Router /v1/internal/people/role/{roleid} [get]

func (*Store) GetRoleFull added in v0.9.6

func (s *Store) GetRoleFull(c echo.Context) error

GetRoleFull handles getting a certain role and all users and permissions

@Summary List all users and permissions of a given role @ID get-people-role-full @Tags people-role @Produce json @Param roleid path int true "Role ID" @Success 200 {object} people.RoleFull @Router /v1/internal/people/role/{roleid}/full [get]

func (*Store) ListOfficers added in v0.9.6

func (s *Store) ListOfficers(c echo.Context) error

ListOfficers handles listing officers with options

@Summary List officers with options @ID get-people-officers @Tags people-officership-officer @Produce json @Param officershipStatus query int false "Optional if officership is current (default), retired or any" @Param officerStatus query int false "Optional if officer is current (default), retired or any" @Param officershipId query int false "Optional officership id for getting all officers where id equal" @Param userId query int false "Optional user id for getting where user is equal to id" @Success 200 {array} people.OfficershipMember @Router /v1/internal/people/officership/officers [get]

func (*Store) ListOfficershipTeams added in v0.9.6

func (s *Store) ListOfficershipTeams(c echo.Context) error

ListOfficershipTeams handles listing officership teams with options

@Summary List officership teams with options @ID get-people-officership-teams @Tags people-officership-team @Produce json @Success 200 {array} people.OfficershipTeam @Router /v1/internal/people/officership/teams [get]

func (*Store) ListOfficerships added in v0.9.6

func (s *Store) ListOfficerships(c echo.Context) error

ListOfficerships handles listing officerships with options

@Summary List officerships with options @ID get-people-officerships @Tags people-officership @Produce json @Param officershipStatus query int false "Optional if officership is current (default), retired or any" @Success 200 {array} people.Officership @Router /v1/internal/people/officerships [get]

func (*Store) ListPermissionMembersByID added in v0.9.6

func (s *Store) ListPermissionMembersByID(c echo.Context) error

ListPermissionMembersByID handles listing all members of a certain permission

@Summary List all users of a given permission @ID get-people-permission-members @Tags people-permission @Produce json @Param permissionid path int true "Permission ID" @Success 200 {array} people.Permission @Router /v1/internal/people/permission/{permissionid}/members [get]

func (*Store) ListPermissions added in v0.9.6

func (s *Store) ListPermissions(c echo.Context) error

ListPermissions handles listing permissions

@Summary List permissions @ID get-people-permissions @Tags people-permission @Produce json @Success 200 {array} people.Permission @Router /v1/internal/people/permissions [get]

func (*Store) ListPermissionsNotInRole added in v0.9.6

func (s *Store) ListPermissionsNotInRole(c echo.Context) error

ListPermissionsNotInRole handles listing the permissions not in a role

@Summary Lists permissions not in role @ID list-people-role-permission-not @Tags people-role @Produce json @Param roleid path int true "role id" @Success 201 {array} people.Permission @Router /v1/internal/people/role/{roleid}/permissions/notinrole [post]

func (*Store) ListPermissionsWithRolesCount added in v0.9.6

func (s *Store) ListPermissionsWithRolesCount(c echo.Context) error

ListPermissionsWithRolesCount handles listing permissions with role count

@Summary List permissions with roles count @ID get-people-permissions-count @Tags people-permission @Produce json @Success 200 {array} people.PermissionWithRolesCount @Router /v1/internal/people/permissions/count [get]

func (*Store) ListRoleMembersByID added in v0.9.6

func (s *Store) ListRoleMembersByID(c echo.Context) error

ListRoleMembersByID handles listing all members of a certain role

@Summary List all users of a given role @ID get-people-role-members @Tags people-role @Produce json @Param roleid path int true "Role ID" @Success 200 {array} people.User @Failure 404 {object} utils.HTTPError "Role Not Found" @Failure 500 {object} utils.HTTPError "Server Side Role Error" @Router /v1/internal/people/role/{roleid}/members [get]

func (*Store) ListRolePermissionsByID added in v0.9.6

func (s *Store) ListRolePermissionsByID(c echo.Context) error

ListRolePermissionsByID handles listing permissions of a certain role

@Summary List permissions of a given role @ID get-people-role-permissions @Tags people-role @Produce json @Param roleid path int true "Role ID" @Success 200 {array} people.Permission @Router /v1/internal/people/role/{roleid}/permissions [get]

func (*Store) ListRolesWithCount added in v0.9.6

func (s *Store) ListRolesWithCount(c echo.Context) error

ListRolesWithCount handles listing roles

@Summary List roles with count @ID get-people-roles-count @Tags people-role @Produce json @Success 200 {array} people.RoleWithCount @Router /v1/internal/people/roles/count [get]

func (*Store) ListRolesWithPermissions added in v0.9.6

func (s *Store) ListRolesWithPermissions(c echo.Context) error

ListRolesWithPermissions handles listing roles

@Summary List roles @ID get-people-roles-with-permissions @Tags people-role @Produce json @Success 200 {array} people.RoleWithPermissions @Router /v1/internal/people/roles [get]

func (*Store) ListUsers added in v0.9.6

func (s *Store) ListUsers(c echo.Context) error

ListUsers handles listing users

@Summary List users @ID list-people-users @Tags people-user @Produce json @Success 200 {array} people.User @Router /v1/internal/people/users [get]

func (*Store) ListUsersNotInRole added in v0.9.6

func (s *Store) ListUsersNotInRole(c echo.Context) error

ListUsersNotInRole handles listing the users not in a role

@Summary Lists users not in role @ID list-people-role-user-not @Tags people-role @Produce json @Param roleid path int true "role id" @Success 201 {array} people.User @Router /v1/internal/people/role/{roleid}/users/notinrole [post]

func (*Store) ListUsersPagination added in v0.9.6

func (s *Store) ListUsersPagination(c echo.Context) error

ListUsersPagination handles listing users with pagination

@Summary List users with pagination @ID list-people-users-pagination @Tags people-user @Produce json @Param size query int false "Page size" @Param page query int false "Page number" @Param search query string false "Search string" @Param column query string false "Ordering column" @Param direction query string false "Ordering direction" @Param enabled query string false "Is user enabled" @Param deleted query string false "Is user deleted" @Success 200 {array} people.UserFull @Router /v1/internal/people/users/pagination [get]

func (*Store) OfficershipCount added in v0.9.6

func (s *Store) OfficershipCount(c echo.Context) error

OfficershipCount handles getting the officership count

@Summary Provides officership count @Description Contains a number of stats @ID get-people-officership-count @Tags people-officership @Produce json @Success 200 {object} people.CountOfficerships @Router /v1/internal/people/officership/count [get]

func (*Store) OfficershipTeamAddOfficership added in v0.9.6

func (s *Store) OfficershipTeamAddOfficership(c echo.Context) error

OfficershipTeamAddOfficership handles adding an officership to a team

@Summary Create an officership link to a team @ID add-people-officership-team-officership @Tags people-officership-team @Param officershipteamid path int true "officership team id" @Produce json @Param officership body people.OfficershipTeamMemberAddDTO true "Officership team member object" @Success 201 {object} people.OfficershipTeamMember @Router /v1/internal/people/officership/team/{officershipteamid}/officership [post]

func (*Store) OfficershipTeamRemoveOfficership added in v0.9.6

func (s *Store) OfficershipTeamRemoveOfficership(c echo.Context) error

OfficershipTeamRemoveOfficership handles deleting an officership from a team

@Summary Removes officership from team @ID remove-people-officership-from-team @Tags people-officership-team @Param officershipteamid path int true "officership team id" @Param officershipid path int true "officership id" @Produce json @Success 204 @Router /v1/internal/people/officership/team/{officershipteamid}/officership/{officershipid} [delete]

func (*Store) RoleAddPermission added in v0.9.6

func (s *Store) RoleAddPermission(c echo.Context) error

RoleAddPermission handles adding a permission to a role

@Summary Adds a permission to a role @ID add-people-role-permission @Tags people-role @Produce json @Param roleid path int true "role id" @Param permissionid path int true "permission id" @Success 201 {object} people.RolePermission @Router /v1/internal/people/role/{roleid}/permission/{permissionid} [post]

func (*Store) RoleAddUser added in v0.9.6

func (s *Store) RoleAddUser(c echo.Context) error

RoleAddUser handles adding a user to a role

@Summary Adds a user to a role @ID add-people-role-user @Tags people-role @Produce json @Param roleid path int true "role id" @Param userid path int true "user id" @Success 201 {object} people.RoleUser @Router /v1/internal/people/role/{roleid}/user/{userid} [post]

func (*Store) RoleRemovePermission added in v0.9.6

func (s *Store) RoleRemovePermission(c echo.Context) error

RoleRemovePermission handles removing a permission from a role

@Summary Removes a permission from a role @ID remove-people-role-permission @Tags people-role @Produce json @Param roleid path int true "role id" @Param permissionid path int true "permission id" @Success 204 @Router /v1/internal/people/role/{roleid}/permission/{permissionid} [delete]

func (*Store) RoleRemoveUser added in v0.9.6

func (s *Store) RoleRemoveUser(c echo.Context) error

RoleRemoveUser handles removing a user from a role

@Summary Removes a user from a role @ID remove-people-role-user @Tags people-role @Produce json @Param roleid path int true "role id" @Param userid path int true "user id" @Success 204 @Router /v1/internal/people/role/{roleid}/user/{userid} [delete]

func (*Store) UserByEmail added in v0.9.6

func (s *Store) UserByEmail(c echo.Context) error

UserByEmail finds a user by email @Summary Get a user by email @Description Get a basic user object by email. @ID get-user-email @Tags people-user @Produce json @Param email path int true "Email" @Success 200 {object} people.User @Router /v1/internal/people/user/{email} [get]

func (*Store) UserByEmailFull added in v0.9.6

func (s *Store) UserByEmailFull(c echo.Context) error

UserByEmailFull finds a user by email returning all info @Summary Get a full user by email @Description Get a complete user object by email. @ID get-user-email-full @Tags people-user @Produce json @Param email path int true "Email" @Success 200 {object} people.User @Router /v1/internal/people/user/{email}/full [get]

func (*Store) UserByID added in v0.9.6

func (s *Store) UserByID(c echo.Context) error

UserByID finds a user by ID @Summary Get a user by ID @Description Get a basic user object by ID. @ID get-user-id @Tags people-user @Produce json @Param userid path int true "User ID" @Success 200 {object} people.User @Router /v1/internal/people/user/{userid} [get]

func (*Store) UserByIDFull added in v0.9.6

func (s *Store) UserByIDFull(c echo.Context) error

UserByIDFull finds a user by ID returning all info @Summary Get a full user by ID @Description Get a complete user object by ID. @ID get-user-id-full @Tags people-user @Produce json @Param userid path int true "User ID" @Success 200 {object} people.UserFull @Router /v1/internal/people/user/{userid}/full [get]

func (*Store) UserByToken added in v0.9.6

func (s *Store) UserByToken(c echo.Context) error

UserByToken finds a user by their JWT token @Summary Get a user by token @Description Get a basic user object by JWT token generated by web-auth. @ID get-user-token @Tags people-user @Produce json @Success 200 {object} people.User @Router /v1/internal/people/user [get]

func (*Store) UserByTokenFull added in v0.9.6

func (s *Store) UserByTokenFull(c echo.Context) error

UserByTokenFull finds a user by their JWT token returning all info @Summary Get a full user by token @Description Get a complete user object by JWT token generated by web-auth. @ID get-user-token-full @Tags people-user @Produce json @Success 200 {object} people.UserFull @Router /v1/internal/people/user/full [get]

func (*Store) UserFullDBToUserFull added in v0.9.6

func (s *Store) UserFullDBToUserFull(userFullDB people.UserFullDB) people.UserFull

func (*Store) UserStats added in v0.9.6

func (s *Store) UserStats(c echo.Context) error

UserStats lists the user stats @Summary Get user stats @Description Get an overview of users. @ID get-user-stats @Tags people-user @Produce json @Success 200 {object} people.CountUsers @Router /v1/internal/people/users/stats [get]

type UserRepo added in v0.9.6

type UserRepo interface {
	UserStats(c echo.Context) error
	UserByID(c echo.Context) error
	UserByIDFull(c echo.Context) error
	UserByEmail(c echo.Context) error
	UserByEmailFull(c echo.Context) error
	UserByToken(c echo.Context) error
	UserByTokenFull(c echo.Context) error
	AddUser(c echo.Context) error
	ListUsers(c echo.Context) error
	ListUsersPagination(c echo.Context) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL