server

package
v1.119.0-renovate-all-... Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsHxRequest

func IsHxRequest(req *http.Request) bool

func New

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

Types

type AdjustInvoiceFormHandler

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

type AdjustInvoiceVars

type AdjustInvoiceVars struct {
	AdjustmentTypes *[]shared.AdjustmentType
	ClientId        string
	InvoiceId       string
	AppVars
}

type ApiClient

type ApiClient interface {
	GetCurrentUserDetails(api.Context) (shared.Assignee, error)
	GetPersonDetails(api.Context, int) (shared.Person, error)
	GetFeeReductions(api.Context, int) (shared.FeeReductions, error)
	GetInvoices(api.Context, int) (shared.Invoices, error)
	GetPermittedAdjustments(api.Context, int, int) ([]shared.AdjustmentType, error)
	AdjustInvoice(api.Context, int, int, int, string, string, string) error
	GetAccountInformation(api.Context, int) (shared.AccountInformation, error)
	GetInvoiceAdjustments(api.Context, int) (shared.InvoiceAdjustments, error)
	AddFeeReduction(api.Context, int, string, string, string, string, string) error
	CancelFeeReduction(api.Context, int, int, string) error
	UpdatePendingInvoiceAdjustment(api.Context, int, int, string) error
	AddManualInvoice(api.Context, int, string, *string, *string, *string, *string, *string, *string) error
	GetBillingHistory(api.Context, int) ([]shared.BillingHistory, error)
	GetUser(api.Context, int) (shared.Assignee, error)
	SubmitDirectDebit(string, string, string, string) error
}

type AppVars

type AppVars struct {
	Path            string
	XSRFToken       string
	Tabs            []Tab
	EnvironmentVars EnvironmentVars
	Errors          apierror.ValidationErrors
	Error           string
}

func NewAppVars

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

type BillingHistory

type BillingHistory struct {
	User               string
	Date               shared.Date
	Event              shared.BillingEvent
	OutstandingBalance string
	CreditBalance      string
}

type BillingHistoryHandler

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

type BillingHistoryVars

type BillingHistoryVars struct {
	BillingHistory []BillingHistory
	AppVars
}

type CancelFeeReduction

type CancelFeeReduction struct {
	ClientId string
	Id       string
	AppVars
}

type CancelFeeReductionHandler

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

type EnvironmentVars

type EnvironmentVars struct {
	Port                   string
	WebDir                 string
	SiriusURL              string
	SiriusPublicURL        string
	Prefix                 string
	BackendUrl             string
	SupervisionBillingTeam int
}

func NewEnvironmentVars

func NewEnvironmentVars() (EnvironmentVars, error)

type ErrorVars

type ErrorVars struct {
	Code  int
	Error string
	EnvironmentVars
}

type FeeReduction

type FeeReduction struct {
	Type                     string
	StartDate                string
	EndDate                  string
	DateReceived             string
	Status                   string
	Notes                    string
	FeeReductionCancelAction bool
	Id                       string
}

type FeeReductions

type FeeReductions []FeeReduction

type FeeReductionsHandler

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

type FeeReductionsTab

type FeeReductionsTab struct {
	FeeReductions FeeReductions
	ClientId      string
	AppVars
}

type FinanceClient

type FinanceClient struct {
	FirstName          string
	Surname            string
	CourtRef           string
	OutstandingBalance string
	CreditBalance      string
	PaymentMethod      string
	ClientId           string
}

type Handler

type Handler interface {
	// contains filtered or unexported methods
}

type HeaderData

type HeaderData struct {
	MyDetails     shared.Assignee
	FinanceClient FinanceClient
}

type Invoice

type Invoice struct {
	Id                 int
	Ref                string
	Status             string
	Amount             string
	RaisedDate         string
	Received           string
	OutstandingBalance string
	Ledgers            LedgerAllocations
	SupervisionLevels  SupervisionLevels
	ClientId           int
}

type InvoiceAdjustmentForm

type InvoiceAdjustmentForm struct {
	AdjustmentType shared.AdjustmentType
	Notes          string
	Amount         string
}

type Invoices

type Invoices []Invoice

type InvoicesHandler

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

type InvoicesVars

type InvoicesVars struct {
	Invoices Invoices
	ClientId string
	AppVars
}

type LedgerAllocation

type LedgerAllocation struct {
	Amount          string
	ReceivedDate    shared.Date
	TransactionType string
	Status          string
}

type LedgerAllocations

type LedgerAllocations []LedgerAllocation

type PageData

type PageData struct {
	Data           any
	SuccessMessage string
	HeaderData
}

type PendingInvoiceAdjustment

type PendingInvoiceAdjustment struct {
	Id               string
	Invoice          string
	DateRaised       shared.Date
	AdjustmentType   string
	AdjustmentAmount string
	Notes            string
	Status           string
}

type PendingInvoiceAdjustments

type PendingInvoiceAdjustments []PendingInvoiceAdjustment

type PendingInvoiceAdjustmentsHandler

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

type PendingInvoiceAdjustmentsTab

type PendingInvoiceAdjustmentsTab struct {
	PendingInvoiceAdjustments PendingInvoiceAdjustments
	ClientId                  string
	AppVars
}

type StatusError

type StatusError int

func (StatusError) Code

func (e StatusError) Code() int

func (StatusError) Error

func (e StatusError) Error() string

type SubmitCancelFeeReductionsHandler

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

type SubmitDirectDebitHandler added in v1.116.0

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

type SubmitFeeReductionsHandler

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

type SubmitInvoiceAdjustmentHandler

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

type SubmitManualInvoiceHandler

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

type SubmitUpdatePendingInvoiceAdjustmentHandler

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

type SupervisionLevel

type SupervisionLevel struct {
	Level  string
	Amount string
	From   shared.Date
	To     shared.Date
}

type SupervisionLevels

type SupervisionLevels []SupervisionLevel

type Tab

type Tab struct {
	Id       string
	Title    string
	BasePath string
	Selected bool
}

type Template

type Template interface {
	Execute(wr io.Writer, data any) error
	ExecuteTemplate(wr io.Writer, name string, data any) error
}

type UpdateDirectDebit added in v1.116.0

type UpdateDirectDebit struct {
	ClientId string
	AppVars
}

type UpdateDirectDebitHandler added in v1.116.0

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

type UpdateFeeReductionHandler

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

type UpdateFeeReductions

type UpdateFeeReductions struct {
	ClientId string
	AppVars
}

type UpdateManualInvoice

type UpdateManualInvoice struct {
	ClientId     string
	InvoiceTypes *[]shared.InvoiceType
	AppVars
}

type UpdateManualInvoiceHandler

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

Jump to

Keyboard shortcuts

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