server

package
v1.253.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAssigneeFromId added in v1.153.0

func GetAssigneeFromId(id int, teamMembers []model.TeamMember) model.Assignee

func LoggerRequest added in v1.209.0

func LoggerRequest(l *slog.Logger, r *http.Request, err error)

func New

func New(logger *slog.Logger, client Client, templates map[string]*template.Template, envVars EnvironmentVars) http.Handler

func RenameErrors added in v1.127.0

func RenameErrors(errors sirius.ValidationErrors, deputyType string) sirius.ValidationErrors

func RetainFormData added in v1.153.0

func RetainFormData(task model.Task, assignees []model.TeamMember, dueDate string, notes string, assigneeId int) (model.Task, bool)

Types

type AddAssuranceClient added in v1.157.0

type AddAssuranceClient interface {
	AddAssurance(ctx sirius.Context, assuranceType string, requestedDate string, userId, deputyId int) error
}

type AddAssuranceVars added in v1.157.0

type AddAssuranceVars struct {
	AppVars
}

type AddDocumentClient added in v1.211.0

type AddDocumentClient interface {
	AddDocument(ctx sirius.Context, file multipart.File, filename string, documentType string, direction string, date string, notes string, deputyId int) error
	GetDocumentDirections(ctx sirius.Context) ([]model.RefData, error)
	GetDocumentTypes(ctx sirius.Context, deputyType string) ([]model.RefData, error)
}

type AddDocumentVars added in v1.211.0

type AddDocumentVars struct {
	SuccessMessage string
	AppVars
	DocumentDirectionRefData []model.RefData
	DocumentTypes            []model.RefData
	DocumentType             string
	Direction                string
	Date                     string
	Notes                    string
}

type AddGcmIssue added in v1.217.0

type AddGcmIssue interface {
	GetGCMIssueTypes(ctx sirius.Context) ([]model.RefData, error)
	GetDeputyClient(ctx sirius.Context, caseRecNumber string, deputyId int) (sirius.DeputyClient, error)
	AddGcmIssue(ctx sirius.Context, caseRecNumber, notes string, gcmIssueType string, deputyId int) error
}

type AddGcmIssueVars added in v1.217.0

type AddGcmIssueVars struct {
	AppVars
	GcmIssueTypes []model.RefData
	CaseRecNumber string
	Client        sirius.DeputyClient
	GcmIssueType  string
	Notes         string
}

type AddTaskVars added in v1.118.0

type AddTaskVars struct {
	TaskTypes      []model.TaskType
	Assignees      []model.TeamMember
	TaskType       string
	DueDate        string
	Notes          string
	SuccessMessage string
	IsManageTasks  bool
	AppVars
}

type AddTasksClient added in v1.118.0

type AddTasksClient interface {
	AddTask(ctx sirius.Context, deputyId int, taskType string, typeName string, dueDate string, notes string, assigneeId int) error
	GetTaskTypesForDeputyType(ctx sirius.Context, deputyType string) ([]model.TaskType, error)
	GetDeputyTeamMembers(ctx sirius.Context, defaultPATeam int, deputy sirius.DeputyDetails) ([]model.TeamMember, error)
}

type AppVars added in v1.137.0

type AppVars struct {
	Path          string
	XSRFToken     string
	UserDetails   sirius.UserDetails
	DeputyDetails sirius.DeputyDetails
	PageName      string
	Error         string
	Errors        sirius.ValidationErrors
	EnvironmentVars
}

func NewAppVars added in v1.137.0

func NewAppVars(client AppVarsClient, r *http.Request, envVars EnvironmentVars) (*AppVars, error)

func (AppVars) DeputyId added in v1.137.0

func (a AppVars) DeputyId() int

func (AppVars) DeputyType added in v1.146.0

func (a AppVars) DeputyType() string

type AppVarsClient added in v1.137.0

type AppVarsClient interface {
	GetUserDetails(sirius.Context) (sirius.UserDetails, error)
	GetDeputyDetails(sirius.Context, int, int, int) (sirius.DeputyDetails, error)
}

type AssurancesVars added in v1.157.0

type AssurancesVars struct {
	AddVisitDisabled bool
	SuccessMessage   string
	Assurances       []model.Assurance
	ErrorMessage     string
	AppVars
}

type ChangeECMInformation added in v1.25.0

type ChangeECMInformation interface {
	GetDeputyTeamMembers(sirius.Context, int, sirius.DeputyDetails) ([]model.TeamMember, error)
	ChangeECM(sirius.Context, sirius.ExecutiveCaseManagerOutgoing, sirius.DeputyDetails) error
}

type CompleteTask added in v1.129.0

type CompleteTask interface {
	GetTask(sirius.Context, int) (model.Task, error)
	GetTaskTypesForDeputyType(ctx sirius.Context, deputyType string) ([]model.TaskType, error)
	CompleteTask(sirius.Context, int, string) error
}

type DeleteContact added in v1.140.0

type DeleteContact interface {
	GetContactById(ctx sirius.Context, deputyId int, contactId int) (sirius.Contact, error)
	DeleteContact(sirius.Context, int, int) error
}

type DeleteContactVars added in v1.140.0

type DeleteContactVars struct {
	ContactName string
	AppVars
}

Could just use ErrorVars?

type DeleteDeputy added in v1.151.0

type DeleteDeputy interface {
	DeleteDeputy(sirius.Context, int) error
}

type DeleteDeputyVars added in v1.151.0

type DeleteDeputyVars struct {
	SuccessMessage string
	AppVars
}

type DeputyChangeFirmInformation added in v1.41.0

type DeputyChangeFirmInformation interface {
	GetFirms(sirius.Context) ([]sirius.FirmForList, error)
	AssignDeputyToFirm(sirius.Context, int, int) error
}

type DeputyContactDetailsInformation added in v1.33.0

type DeputyContactDetailsInformation interface {
	UpdateDeputyContactDetails(sirius.Context, int, sirius.DeputyContactDetails) error
}

type DeputyHubClient added in v1.137.0

type DeputyHubClient interface {
	GetUserDetails(ctx sirius.Context) (sirius.UserDetails, error)
	GetDeputyDetails(sirius.Context, int, int, int) (sirius.DeputyDetails, error)
}

type DeputyHubClientInformation

type DeputyHubClientInformation interface {
	GetDeputyClients(sirius.Context, sirius.ClientListParams) (sirius.ClientList, error)
	GetAccommodationTypes(sirius.Context) ([]model.RefData, error)
	GetSupervisionLevels(sirius.Context) ([]model.RefData, error)
}

type DeputyHubContactInformation added in v1.126.0

type DeputyHubContactInformation interface {
	GetDeputyContacts(sirius.Context, int) (sirius.ContactList, error)
}

type DeputyHubEventInformation

type DeputyHubEventInformation interface {
	GetDeputyEvents(sirius.Context, int) (sirius.DeputyEvents, error)
}

type DeputyHubInformation

type DeputyHubInformation interface {
	GetDeputyClients(sirius.Context, sirius.ClientListParams) (sirius.ClientList, error)
}

type DeputyHubNotesInformation

type DeputyHubNotesInformation interface {
	GetDeputyNotes(sirius.Context, int) (sirius.DeputyNoteCollection, error)
	AddNote(ctx sirius.Context, title, note string, deputyId, userId int, deputyType string) error
}

type DocumentsClient added in v1.211.0

type DocumentsClient interface {
	GetDeputyDocuments(ctx sirius.Context, deputyId int, sort string) (sirius.DocumentList, error)
}

type DocumentsVars added in v1.211.0

type DocumentsVars struct {
	DocumentList   sirius.DocumentList
	SuccessMessage string
	AppVars
	Sort string
}

type EditDeputyHubInformation

type EditDeputyHubInformation interface {
	EditDeputyDetails(sirius.Context, sirius.DeputyDetails) error
}

type EnvironmentVars added in v1.137.0

type EnvironmentVars struct {
	Port            string
	WebDir          string
	SiriusURL       string
	SiriusPublicURL string
	FirmHubURL      string
	Prefix          string
	DefaultPaTeam   int
	DefaultProTeam  int
	Features        []string
}

func NewEnvironmentVars added in v1.137.0

func NewEnvironmentVars() (EnvironmentVars, error)

type ErrorVars added in v1.137.0

type ErrorVars struct {
	Code  int
	Error string
	EnvironmentVars
}

type ExpandedError added in v1.209.0

type ExpandedError interface {
	Title() string
	Data() interface{}
}

type FilterByAccommodation added in v1.167.0

type FilterByAccommodation struct {
	ListPage
	AccommodationTypes         []model.RefData
	SelectedAccommodationTypes []string
}

type FilterByOrderStatus added in v1.155.0

type FilterByOrderStatus struct {
	ListPage
	OrderStatusOptions    []model.RefData
	SelectedOrderStatuses []string
	OrderStatuses         []model.OrderStatus
}

type FilterBySupervisionLevel added in v1.169.0

type FilterBySupervisionLevel struct {
	ListPage
	SupervisionLevels         []model.RefData
	SelectedSupervisionLevels []string
}

type FirmInformation added in v1.33.0

type FirmInformation interface {
	AddFirmDetails(sirius.Context, sirius.FirmDetails) (int, error)
	AssignDeputyToFirm(sirius.Context, int, int) error
}

type GcmIssuesVars added in v1.217.0

type GcmIssuesVars struct {
	ErrorMessage   string
	SuccessMessage string
	GcmIssues      []sirius.GcmIssue
	Sort           urlbuilder.Sort
	AppVars
	UrlBuilder     urlbuilder.UrlBuilder
	GCMIssueStatus string
}

func (GcmIssuesVars) CreateUrlBuilder added in v1.217.0

func (gv GcmIssuesVars) CreateUrlBuilder() urlbuilder.UrlBuilder

type GetAssurancesClient added in v1.157.0

type GetAssurancesClient interface {
	GetAssurances(ctx sirius.Context, deputyId int) ([]model.Assurance, error)
}

type GetGcmIssues added in v1.217.0

type GetGcmIssues interface {
	GetGCMIssues(ctx sirius.Context, deputyId int, params sirius.GcmIssuesParams) ([]sirius.GcmIssue, error)
	CloseGCMIssues(ctx sirius.Context, gcmIds []string) error
}

type Handler

type Handler func(v AppVars, w http.ResponseWriter, r *http.Request) error

type ListClientsVars added in v1.114.0

func (ListClientsVars) CreateUrlBuilder added in v1.155.0

func (lcv ListClientsVars) CreateUrlBuilder() urlbuilder.UrlBuilder

func (ListClientsVars) GetAppliedFilters added in v1.155.0

func (lcv ListClientsVars) GetAppliedFilters() []string

func (ListClientsVars) ValidateSelectedOrderStatuses added in v1.155.0

func (lcv ListClientsVars) ValidateSelectedOrderStatuses(selectedOrderStatuses []string, orderStatuses []model.OrderStatus) []string

type ListContactsVars added in v1.125.0

type ListContactsVars struct {
	SuccessMessage string
	ContactList    sirius.ContactList
	AppVars
}

type ListPage added in v1.167.0

type ListPage struct {
	AppVars
	AppliedFilters []string
	Sort           urlbuilder.Sort
	Error          string
	Pagination     paginate.Pagination
	PerPage        int
	UrlBuilder     urlbuilder.UrlBuilder
}

func (ListPage) HasFilterBy added in v1.167.0

func (lp ListPage) HasFilterBy(page interface{}, filter string) bool

type ManageAssuranceClient added in v1.157.0

type ManageAssuranceClient interface {
	UpdateAssurance(ctx sirius.Context, manageAssuranceForm sirius.UpdateAssuranceDetails, deputyId, visitId int) error
	GetVisitors(ctx sirius.Context) ([]model.Visitor, error)
	GetRagRatingTypes(ctx sirius.Context) ([]model.RAGRating, error)
	GetVisitOutcomeTypes(ctx sirius.Context) ([]model.RefData, error)
	GetPdrOutcomeTypes(ctx sirius.Context) ([]model.RefData, error)
	GetAssuranceById(ctx sirius.Context, deputyId int, visitId int) (model.Assurance, error)
}

type ManageAssuranceVars added in v1.157.0

type ManageAssuranceVars struct {
	Visitors          []model.Visitor
	RagRatingTypes    []model.RAGRating
	VisitOutcomeTypes []model.RefData
	PdrOutcomeTypes   []model.RefData
	Assurance         model.Assurance
	ErrorNote         string
	AppVars
}

type ManageContact added in v1.130.0

type ManageContact interface {
	GetContactById(ctx sirius.Context, deputyId int, contactId int) (sirius.Contact, error)
	AddContact(sirius.Context, int, sirius.ContactForm) error
	UpdateContact(sirius.Context, int, int, sirius.ContactForm) error
}

type ManageContactVars added in v1.130.0

type ManageContactVars struct {
	ContactId                     int
	ContactName                   string
	JobTitle                      string
	Email                         string
	PhoneNumber                   string
	OtherPhoneNumber              string
	ContactNotes                  string
	IsNamedDeputy                 string
	IsMainContact                 string
	IsNewContact                  bool
	IsMonthlySpreadsheetRecipient string
	AppVars
}

type ManageProDeputyImportantInformation added in v1.36.0

type ManageProDeputyImportantInformation interface {
	UpdateImportantInformation(sirius.Context, int, sirius.ImportantInformationDetails) error
	GetDeputyAnnualInvoiceBillingTypes(ctx sirius.Context) ([]model.RefData, error)
	GetDeputyBooleanTypes(ctx sirius.Context) ([]model.RefData, error)
	GetDeputyReportSystemTypes(ctx sirius.Context) ([]model.RefData, error)
}

type ManageTasks added in v1.127.0

type ManageTasks interface {
	GetTask(sirius.Context, int) (model.Task, error)
	GetDeputyTeamMembers(ctx sirius.Context, defaultPATeam int, deputy sirius.DeputyDetails) ([]model.TeamMember, error)
	UpdateTask(ctx sirius.Context, deputyId, taskId int, dueDate, notes string, assigneeId int) error
	GetTaskTypesForDeputyType(ctx sirius.Context, deputyType string) ([]model.TaskType, error)
}

type Redirect

type Redirect string

func (Redirect) Error

func (e Redirect) Error() string

func (Redirect) To

func (e Redirect) To() string

type ReplaceDocumentClient added in v1.215.0

type ReplaceDocumentClient interface {
	ReplaceDocument(ctx sirius.Context, file multipart.File, filename, documentType, direction, date, notes string, deputyId, documentId int) error
	GetDocumentDirections(ctx sirius.Context) ([]model.RefData, error)
	GetDocumentTypes(ctx sirius.Context, deputyType string) ([]model.RefData, error)
	GetDocumentById(ctx sirius.Context, deputyId, documentId int) (model.Document, error)
}

type ReplaceDocumentVars added in v1.215.0

type ReplaceDocumentVars struct {
	SuccessMessage   string
	OriginalDocument model.Document
	AppVars
	DocumentDirectionRefData []model.RefData
	DocumentTypes            []model.RefData
	DocumentType             string
	Direction                string
	Date                     string
	Notes                    string
}

type StatusError

type StatusError int

func (StatusError) Code

func (e StatusError) Code() int

func (StatusError) Error

func (e StatusError) Error() string

type TasksClient added in v1.118.0

type TasksClient interface {
	GetTaskTypesForDeputyType(ctx sirius.Context, deputyType string) ([]model.TaskType, error)
	GetTasks(ctx sirius.Context, deputyId int) (sirius.TaskList, error)
}

type TasksVars added in v1.118.0

type TasksVars struct {
	TaskTypes      []model.TaskType
	TaskList       sirius.TaskList
	TaskType       string
	DueDate        string
	Notes          string
	SuccessMessage string
	AppVars
}

type Template

type Template interface {
	ExecuteTemplate(io.Writer, string, interface{}) error
}

Jump to

Keyboard shortcuts

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