models

package module
v0.0.0-...-17eb709 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2019 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	VersionKeyTemplate = "v/%v/%v/%v"
	EventKeyTemplate   = "e/%v/%v/%v/%v"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountType

type AccountType int

type Charges

type Charges struct {
	Amount   float32  `json:"amount,string"`
	Currency Currency `json:"currency"`
}

type ChargesInformation

type ChargesInformation struct {
	BearerCode              string    `json:"bearer_code"`
	SenderCharges           []Charges `json:"sender_charges"`
	ReceiverChargesAmount   float64   `json:"receiver_charges_amount,string"`
	ReceiverChargesCurrency Currency  `json:"receiver_charges_currency"`
}

type Currency

type Currency string

type Event

type Event struct {
	EventType EventType `json:"event_type"`
	Version   int64     `json:"version"`
	CreatedAt int64     `json:"created_at"`
	UpdatedAt *int64    `json:"updated_at"`
	Resource  string    `json:"resource"`
}

Event is the generic event holder

type EventType

type EventType string
const (
	ServiceErrorEvent EventType = "service:error"

	ResourceFoundEvent    EventType = "resource:found"
	ResourceNotFoundEvent EventType = "resource:notfound"

	CreatePaymentEvent EventType = "payment:create"
	UpdatePaymentEvent EventType = "payment:update"
	DeletePaymentEvent EventType = "payment:delete"

	FetchPaymentEvent EventType = "payment:fetch"
	ListPaymentEvent  EventType = "payment:list"
	DumpPaymentEvent  EventType = "payment:dump"

	PaymentCreatedEvent EventType = "payment:created"
	PaymentUpdatedEvent EventType = "payment:updated"
	PaymentDeletedEvent EventType = "payment:deleted"
	PaymentDumpedEvent  EventType = "payment:dumped"
)

type Exchange

type Exchange struct {
	ContractReference string  `json:"contract_reference"`
	ExchangeRate      float64 `json:"exchange_rate,string"`
	OriginalAmount    float64 `json:"original_amount,string"`
	OriginalCurrency  string  `json:"original_currency"`
}

type Party

type Party struct {
	AccountNumber     string      `json:"account_number"`
	BankId            string      `json:"bank_id"`
	BankIdCode        string      `json:"bank_id_code"`
	Name              string      `json:"name,omitempty"`
	Address           string      `json:"address,omitempty"`
	AccountName       string      `json:"account_name,omitempty"`
	AccountNumberCode string      `json:"account_number_code,omitempty"`
	AccountType       AccountType `json:"account_type,omitempty"`
}

type Payment

type Payment struct {
	Type           ResourceType       `json:"type"`
	OrganisationID uuid.UUID          `json:"organisation_id"`
	ID             uuid.UUID          `json:"id"`
	Version        int                `json:"version"`
	Attributes     *PaymentAttributes `json:"attributes"`
}

func (*Payment) Validate

func (p *Payment) Validate() error

type PaymentAttributes

type PaymentAttributes struct {
	PaymentID            string               `json:"payment_id"`
	Amount               float32              `json:"amount,string"`
	Currency             Currency             `json:"currency"`
	Purpose              string               `json:"payment_purpose"`
	Scheme               string               `json:"payment_scheme"`
	Type                 PaymentType          `json:"payment_type"`
	ProcessingDate       civil.Date           `json:"processing_date"`
	NumericReference     uint64               `json:"numeric_reference,string"`
	Reference            string               `json:"reference"`
	EndToEndReference    string               `json:"end_to_end_reference"`
	ChargesInformation   ChargesInformation   `json:"charges_information"`
	Exchange             Exchange             `json:"fx"`
	SchemePaymentSubType SchemePaymentSubType `json:"scheme_payment_sub_type"`
	SchemePaymentType    SchemePaymentType    `json:"scheme_payment_type"`
	BeneficiaryParty     Party                `json:"beneficiary_party"`
	DebtorParty          Party                `json:"debtor_party"`
	SponsorParty         Party                `json:"sponsor_party"`
}

type PaymentType

type PaymentType string

type ResourceLocator

type ResourceLocator struct {
	ResourceType   *ResourceType `json:"resource_type"`
	OrganisationID *uuid.UUID    `json:"organisation_id"`
	ID             *uuid.UUID    `json:"id"`
}

type ResourceType

type ResourceType string
const (
	PaymentResource ResourceType = "Payment"
)

type SchemePaymentSubType

type SchemePaymentSubType string

type SchemePaymentType

type SchemePaymentType string

type ServiceError

type ServiceError struct {
	Cause   string    `json:"cause"`
	Request *nats.Msg `json:"request"`
}

Jump to

Keyboard shortcuts

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