Documentation ¶
Index ¶
- Constants
- Variables
- func DecimalStringToInt(s string) int
- func IntToDecimalString(i int) string
- type AccountInformation
- type AddFeeReduction
- type AddInvoiceAdjustmentRequest
- type AddManualInvoice
- type AdjustmentStatus
- type AdjustmentType
- func (i AdjustmentType) AmountRequired() bool
- func (i AdjustmentType) Key() string
- func (i AdjustmentType) MarshalJSON() ([]byte, error)
- func (i AdjustmentType) String() string
- func (i AdjustmentType) Translation() string
- func (i *AdjustmentType) UnmarshalJSON(data []byte) (err error)
- func (i AdjustmentType) Valid() bool
- type Assignee
- type BaseBillingEvent
- type BillingEvent
- type BillingEventType
- type BillingHistory
- type CancelFeeReduction
- type ClientCreatedEvent
- type Date
- type DebtPositionChangedEvent
- type Enum
- type Event
- type FeeReduction
- type FeeReductionApplied
- type FeeReductionAwarded
- type FeeReductionCancelled
- type FeeReductionType
- type FeeReductions
- type FinanceAdminUploadEvent
- type Invoice
- type InvoiceAdjustment
- type InvoiceAdjustmentApplied
- type InvoiceAdjustmentPending
- type InvoiceAdjustments
- type InvoiceEvent
- type InvoiceGenerated
- type InvoiceReference
- type InvoiceType
- func (i InvoiceType) Key() string
- func (i InvoiceType) MarshalJSON() ([]byte, error)
- func (i InvoiceType) RequiresDateValidation() bool
- func (i InvoiceType) RequiresSameFinancialYearValidation() bool
- func (i InvoiceType) String() string
- func (i InvoiceType) Translation() string
- func (i *InvoiceType) UnmarshalJSON(data []byte) (err error)
- func (i InvoiceType) Valid() bool
- type Invoices
- type Ledger
- type Nillable
- type PaymentBreakdown
- type PaymentProcessed
- type Person
- type ReappliedCredit
- type SupervisionLevel
- type Task
- type TransactionEvent
- type TransactionType
- type UnknownEvent
- type UpdateInvoiceAdjustment
Constants ¶
View Source
const ( EventSourceSirius = "opg.supervision.sirius" EventSourceFinanceAdmin = "opg.supervision.finance.admin" DetailTypeDebtPositionChanged = "debt-position-changed" DetailTypeClientCreated = "client-created" DetailTypeFinanceAdminUpload = "finance-admin-upload" )
View Source
const StatusActive string = "Active"
View Source
const StatusCancelled string = "Cancelled"
View Source
const StatusExpired string = "Expired"
View Source
const StatusPending string = "Pending"
Variables ¶
View Source
var InvoiceTypes = []InvoiceType{ InvoiceTypeAD, InvoiceTypeS2, InvoiceTypeS3, InvoiceTypeB2, InvoiceTypeB3, InvoiceTypeSF, InvoiceTypeSE, InvoiceTypeSO, InvoiceTypeGA, InvoiceTypeGS, InvoiceTypeGT, }
View Source
var TransactionTypeMap = map[string]TransactionType{ "CREDIT WRITE OFF": TransactionTypeWriteOff, "CREDIT MEMO": TransactionTypeCreditMemo, "DEBIT MEMO": TransactionTypeDebitMemo, "WRITE OFF REVERSAL": TransactionTypeWriteOffReversal, "EXEMPTION": TransactionTypeExemption, "HARDSHIP": TransactionTypeHardship, "REMISSION": TransactionTypeRemission, "CREDIT REAPPLY": TransactionTypeReapply, "MOTO CARD PAYMENT": TransactionTypeMotoCardPayment, "ONLINE CARD PAYMENT": TransactionTypeOnlineCardPayment, "SUPERVISION BACS PAYMENT": TransactionTypeSupervisionBACSPayment, "OPG BACS PAYMENT": TransactionTypeOPGBACSPayment, }
Functions ¶
func DecimalStringToInt ¶
func IntToDecimalString ¶
Types ¶
type AccountInformation ¶
type AddFeeReduction ¶
type AddFeeReduction struct { FeeType FeeReductionType `json:"feeType" validate:"required,valid-enum"` StartYear string `json:"startYear" validate:"required"` LengthOfAward int `json:"lengthOfAward" validate:"required,gte=1,lte=3"` DateReceived *Date `json:"dateReceived,omitempty" validate:"required,date-in-the-past"` Notes string `json:"notes" validate:"required,thousand-character-limit"` }
type AddInvoiceAdjustmentRequest ¶
type AddInvoiceAdjustmentRequest struct { AdjustmentType AdjustmentType `json:"adjustmentType" validate:"valid-enum"` AdjustmentNotes string `json:"notes" validate:"required,thousand-character-limit"` Amount int `json:"amount,omitempty" validate:"required_if=AdjustmentType 2,required_if=AdjustmentType 3,omitempty,gt=0"` }
type AddManualInvoice ¶
type AddManualInvoice struct { InvoiceType InvoiceType `json:"invoiceType" validate:"required,valid-enum"` Amount Nillable[int] `json:"amount" validate:"nillable-int-gt=50,nillable-int-lte=32000"` RaisedDate Nillable[Date] `json:"raisedDate" validate:"nillable-date-required"` StartDate Nillable[Date] `json:"startDate" validate:"nillable-date-required"` EndDate Nillable[Date] `json:"endDate" validate:"nillable-date-required"` SupervisionLevel Nillable[string] `json:"supervisionLevel" validate:"nillable-string-oneof=GENERAL MINIMAL"` }
type AdjustmentStatus ¶
type AdjustmentStatus int
const ( AdjustmentStatusUnknown AdjustmentStatus = iota AdjustmentStatusPending AdjustmentStatusApproved AdjustmentStatusRejected )
func ParseAdjustmentStatus ¶
func ParseAdjustmentStatus(s string) AdjustmentStatus
func (AdjustmentStatus) Key ¶
func (i AdjustmentStatus) Key() string
func (AdjustmentStatus) MarshalJSON ¶
func (i AdjustmentStatus) MarshalJSON() ([]byte, error)
func (AdjustmentStatus) String ¶
func (i AdjustmentStatus) String() string
func (*AdjustmentStatus) UnmarshalJSON ¶
func (i *AdjustmentStatus) UnmarshalJSON(data []byte) (err error)
func (AdjustmentStatus) Valid ¶
func (i AdjustmentStatus) Valid() bool
type AdjustmentType ¶
type AdjustmentType int
const ( AdjustmentTypeUnknown AdjustmentType = iota AdjustmentTypeWriteOff AdjustmentTypeCreditMemo AdjustmentTypeDebitMemo AdjustmentTypeWriteOffReversal )
func ParseAdjustmentType ¶
func ParseAdjustmentType(s string) AdjustmentType
func (AdjustmentType) AmountRequired ¶
func (i AdjustmentType) AmountRequired() bool
func (AdjustmentType) Key ¶
func (i AdjustmentType) Key() string
func (AdjustmentType) MarshalJSON ¶
func (i AdjustmentType) MarshalJSON() ([]byte, error)
func (AdjustmentType) String ¶
func (i AdjustmentType) String() string
func (AdjustmentType) Translation ¶
func (i AdjustmentType) Translation() string
func (*AdjustmentType) UnmarshalJSON ¶
func (i *AdjustmentType) UnmarshalJSON(data []byte) (err error)
func (AdjustmentType) Valid ¶
func (i AdjustmentType) Valid() bool
type Assignee ¶
type BaseBillingEvent ¶
type BaseBillingEvent struct {
Type BillingEventType `json:"type"`
}
func (BaseBillingEvent) GetType ¶
func (d BaseBillingEvent) GetType() BillingEventType
type BillingEvent ¶
type BillingEvent interface {
GetType() BillingEventType
}
type BillingEventType ¶
type BillingEventType int
const ( EventTypeUnknown BillingEventType = iota EventTypeInvoiceGenerated EventTypeFeeReductionAwarded EventTypeFeeReductionCancelled EventTypeFeeReductionApplied EventTypeInvoiceAdjustmentApplied EventTypePaymentProcessed EventTypeInvoiceAdjustmentPending EventTypeReappliedCredit )
func (BillingEventType) MarshalJSON ¶
func (b BillingEventType) MarshalJSON() ([]byte, error)
func (BillingEventType) String ¶
func (b BillingEventType) String() string
func (*BillingEventType) UnmarshalJSON ¶
func (b *BillingEventType) UnmarshalJSON(data []byte) (err error)
type BillingHistory ¶
type BillingHistory struct { User int `json:"user"` Date Date `json:"date"` Event BillingEvent `json:"event"` OutstandingBalance int `json:"outstanding_balance"` CreditBalance int `json:"credit_balance"` }
func (*BillingHistory) UnmarshalJSON ¶
func (b *BillingHistory) UnmarshalJSON(data []byte) (err error)
type CancelFeeReduction ¶
type CancelFeeReduction struct {
CancellationReason string `json:"cancellationReason" validate:"required,thousand-character-limit"`
}
type ClientCreatedEvent ¶
type Date ¶
func (Date) IsSameFinancialYear ¶
func (Date) MarshalJSON ¶
func (*Date) UnmarshalJSON ¶
type DebtPositionChangedEvent ¶
type DebtPositionChangedEvent struct {
ClientID int `json:"clientId"`
}
type Event ¶
type Event struct { Source string `json:"source"` EventBusName string `json:"event-bus-name"` DetailType string `json:"detail-type"` Detail interface{} `json:"detail"` }
func (*Event) UnmarshalJSON ¶
type FeeReduction ¶
type FeeReductionApplied ¶
type FeeReductionApplied struct {
TransactionEvent
}
type FeeReductionAwarded ¶
type FeeReductionAwarded struct { ReductionType FeeReductionType `json:"reduction_type"` StartDate Date `json:"start_date"` EndDate Date `json:"end_date"` DateReceived Date `json:"date_received"` Notes string `json:"notes"` BaseBillingEvent }
type FeeReductionCancelled ¶
type FeeReductionCancelled struct { ReductionType FeeReductionType `json:"reduction_type"` CancellationReason string `json:"cancellation_reason"` BaseBillingEvent }
type FeeReductionType ¶
type FeeReductionType int
const ( FeeReductionTypeUnknown FeeReductionType = iota FeeReductionTypeExemption FeeReductionTypeHardship FeeReductionTypeRemission )
func ParseFeeReductionType ¶
func ParseFeeReductionType(s string) FeeReductionType
func (FeeReductionType) Key ¶
func (f FeeReductionType) Key() string
func (FeeReductionType) MarshalJSON ¶
func (f FeeReductionType) MarshalJSON() ([]byte, error)
func (FeeReductionType) String ¶
func (f FeeReductionType) String() string
func (*FeeReductionType) UnmarshalJSON ¶
func (f *FeeReductionType) UnmarshalJSON(data []byte) (err error)
func (FeeReductionType) Valid ¶
func (f FeeReductionType) Valid() bool
type FeeReductions ¶
type FeeReductions []FeeReduction
type FinanceAdminUploadEvent ¶
type Invoice ¶
type Invoice struct { Id int `json:"id"` Ref string `json:"ref"` Status string `json:"status"` Amount int `json:"amount"` RaisedDate Date `json:"raisedDate"` Received int `json:"received"` OutstandingBalance int `json:"outstandingBalance"` Ledgers []Ledger `json:"ledgers"` SupervisionLevels []SupervisionLevel `json:"supervisionLevels"` }
type InvoiceAdjustment ¶
type InvoiceAdjustmentApplied ¶
type InvoiceAdjustmentApplied struct {
TransactionEvent
}
type InvoiceAdjustmentPending ¶
type InvoiceAdjustmentPending struct { AdjustmentType AdjustmentType `json:"adjustment_type"` ClientId int `json:"client_id"` Notes string `json:"notes"` PaymentBreakdown `json:"payment_breakdown"` BaseBillingEvent }
type InvoiceAdjustments ¶
type InvoiceAdjustments []InvoiceAdjustment
type InvoiceEvent ¶
type InvoiceGenerated ¶
type InvoiceGenerated struct { ClientId int `json:"client_id"` InvoiceReference InvoiceEvent `json:"invoice_reference"` InvoiceType InvoiceType `json:"invoice_type"` Amount int `json:"amount"` BaseBillingEvent }
type InvoiceReference ¶
type InvoiceReference struct {
InvoiceRef string
}
type InvoiceType ¶
type InvoiceType int
const ( InvoiceTypeUnknown InvoiceType = iota InvoiceTypeAD InvoiceTypeS2 InvoiceTypeS3 InvoiceTypeB2 InvoiceTypeB3 InvoiceTypeSF InvoiceTypeSE InvoiceTypeSO InvoiceTypeGA InvoiceTypeGS InvoiceTypeGT )
func ParseInvoiceType ¶
func ParseInvoiceType(s string) InvoiceType
func (InvoiceType) Key ¶
func (i InvoiceType) Key() string
func (InvoiceType) MarshalJSON ¶
func (i InvoiceType) MarshalJSON() ([]byte, error)
func (InvoiceType) RequiresDateValidation ¶
func (i InvoiceType) RequiresDateValidation() bool
func (InvoiceType) RequiresSameFinancialYearValidation ¶ added in v1.112.0
func (i InvoiceType) RequiresSameFinancialYearValidation() bool
func (InvoiceType) String ¶
func (i InvoiceType) String() string
func (InvoiceType) Translation ¶
func (i InvoiceType) Translation() string
func (*InvoiceType) UnmarshalJSON ¶
func (i *InvoiceType) UnmarshalJSON(data []byte) (err error)
func (InvoiceType) Valid ¶
func (i InvoiceType) Valid() bool
type Nillable ¶
func TransformNillableDate ¶
func TransformNillableInt ¶
func TransformNillableString ¶
type PaymentBreakdown ¶
type PaymentBreakdown struct { InvoiceReference InvoiceEvent `json:"invoice_reference"` Amount int `json:"amount"` Status string `json:"status"` }
type PaymentProcessed ¶
type PaymentProcessed struct {
TransactionEvent
}
type ReappliedCredit ¶
type ReappliedCredit struct {
TransactionEvent
}
type SupervisionLevel ¶
type TransactionEvent ¶
type TransactionEvent struct { ClientId int `json:"client_id"` TransactionType TransactionType `json:"transaction_type"` Amount int `json:"amount"` // the amount that triggered the transaction, excluding unapplies Breakdown []PaymentBreakdown `json:"breakdown"` BaseBillingEvent }
type TransactionType ¶
type TransactionType int
const ( TransactionTypeUnknown TransactionType = iota TransactionTypeWriteOff TransactionTypeCreditMemo TransactionTypeDebitMemo TransactionTypeWriteOffReversal TransactionTypeExemption TransactionTypeHardship TransactionTypeRemission TransactionTypeReapply TransactionTypeMotoCardPayment TransactionTypeOnlineCardPayment TransactionTypeSupervisionBACSPayment TransactionTypeOPGBACSPayment )
func ParseTransactionType ¶
func ParseTransactionType(s string) TransactionType
func (TransactionType) Key ¶
func (t TransactionType) Key() string
func (TransactionType) MarshalJSON ¶
func (t TransactionType) MarshalJSON() ([]byte, error)
func (TransactionType) String ¶
func (t TransactionType) String() string
func (*TransactionType) UnmarshalJSON ¶
func (t *TransactionType) UnmarshalJSON(data []byte) (err error)
func (TransactionType) Valid ¶
func (t TransactionType) Valid() bool
type UnknownEvent ¶
type UnknownEvent struct {
BaseBillingEvent
}
type UpdateInvoiceAdjustment ¶
type UpdateInvoiceAdjustment struct {
Status AdjustmentStatus `json:"status" validate:"valid-enum,oneof=2 3"` // APPROVED, REJECTED
}
Source Files ¶
- account_information.go
- add_fee_reduction.go
- add_manual_invoice.go
- adjustment_status.go
- adjustment_type.go
- assignee.go
- billing_history.go
- cancel_fee_reduction.go
- date.go
- event.go
- fee_reduction.go
- fee_reduction_type.go
- invoice.go
- invoice_adjustment.go
- invoice_reference.go
- invoice_type.go
- ledger_entry.go
- nillable.go
- person.go
- task.go
- transaction_type.go
- transform.go
- update_invoice_adjustment.go
Click to show internal directories.
Click to hide internal directories.