models

package
v0.0.0-...-58bfa7f Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entity

type Entity struct {
	// AccountNumber is the account number for the entity.
	AccountNumber string `bson:"account_number" json:"account_number"`
	// BankID is the bank ID for the entity.
	BankID string `bson:"bank_id" json:"bank_id"`
	// Name is the name of the entity.
	Name string `bson:"name" json:"name"`
}

Entity represents a party involved in a payment.

func (*Entity) Validate

func (e *Entity) Validate() error

Validate validates the current Entity object.

type Payment

type Payment struct {
	// ID is the ID of the payments.
	ID primitive.ObjectID `bson:"_id,omitempty" json:"id"`
	// UpdatedAt is the record's modification date.
	UpdatedAt time.Time `bson:"updated_at" json:"-"`
	// DeletedAt is the record's deletion date.
	DeletedAt *time.Time `bson:"deleted_at" json:"-"`

	// Beneficiary is the entity that received the payment.
	Beneficiary Entity `bson:"beneficiary" json:"beneficiary"`
	// Debtor is the entity that sent the payment.
	Debtor Entity `bson:"debtor" json:"debtor"`

	// Amount is the amount involved in the payment.
	// It is a required field.
	Amount float64 `bson:"amount" json:"amount"`
	// Currency is the currency in which the payment was made.
	// It is a required field.
	Currency string `bson:"currency" json:"currency"`
	// Date is the date at which the payment was processed.
	// It is a required field.
	Date time.Time `bson:"date" json:"date"`
	// Description is the description associated with the payment.
	// It is an optional field.
	Description string `bson:"description" json:"description"`
}

Payment represents a payment to an entity (the beneficiary) made by another entity (the debtor).

func (*Payment) Validate

func (p *Payment) Validate() error

Validate validates the current Payment object.

Jump to

Keyboard shortcuts

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