portfolio

package
v1.14.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 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 CreatePortfolioInput

type CreatePortfolioInput struct {
	EntityID string         `json:"entityId"`
	Name     string         `json:"name"`
	Status   Status         `json:"status"`
	Metadata map[string]any `json:"metadata"`
}

CreatePortfolioInput is a struct design to encapsulate request create payload data.

type Portfolio

type Portfolio struct {
	ID             string         `json:"id"`
	Name           string         `json:"name"`
	EntityID       string         `json:"entityId"`
	LedgerID       string         `json:"ledgerId"`
	OrganizationID string         `json:"organizationId"`
	Status         Status         `json:"status"`
	CreatedAt      time.Time      `json:"createdAt"`
	UpdatedAt      time.Time      `json:"updatedAt"`
	DeletedAt      *time.Time     `json:"deletedAt"`
	Metadata       map[string]any `json:"metadata"`
}

Portfolio is a struct designed to encapsulate request update payload data.

type PortfolioPostgreSQLModel

type PortfolioPostgreSQLModel struct {
	ID                string
	Name              string
	EntityID          string
	LedgerID          string
	OrganizationID    string
	Status            string
	StatusDescription *string
	AllowSending      bool
	AllowReceiving    bool
	CreatedAt         time.Time
	UpdatedAt         time.Time
	DeletedAt         sql.NullTime
	Metadata          map[string]any
}

PortfolioPostgreSQLModel represents the entity Portfolio into SQL context in Database

func (*PortfolioPostgreSQLModel) FromEntity

func (t *PortfolioPostgreSQLModel) FromEntity(portfolio *Portfolio)

FromEntity converts an entity.Portfolio to PortfolioPostgreSQLModel

func (*PortfolioPostgreSQLModel) ToEntity

func (t *PortfolioPostgreSQLModel) ToEntity() *Portfolio

ToEntity converts an PortfolioPostgreSQLModel to entity.Portfolio

type Repository

type Repository interface {
	Create(ctx context.Context, portfolio *Portfolio) (*Portfolio, error)
	FindByIDEntity(ctx context.Context, organizationID, ledgerID, entityID uuid.UUID) (*Portfolio, error)
	FindAll(ctx context.Context, organizationID, ledgerID uuid.UUID, limit, page int) ([]*Portfolio, error)
	Find(ctx context.Context, organizationID, ledgerID, id uuid.UUID) (*Portfolio, error)
	ListByIDs(ctx context.Context, organizationID, ledgerID uuid.UUID, ids []uuid.UUID) ([]*Portfolio, error)
	Update(ctx context.Context, organizationID, ledgerID, id uuid.UUID, portfolio *Portfolio) (*Portfolio, error)
	Delete(ctx context.Context, organizationID, ledgerID, id uuid.UUID) error
}

Repository provides an interface for operations related to portfolio entities.

type Status

type Status struct {
	Code           string  `json:"code"`
	Description    *string `json:"description"`
	AllowSending   bool    `json:"allowSending"`
	AllowReceiving bool    `json:"allowReceiving"`
}

Status structure for marshaling/unmarshalling JSON.

func (Status) IsEmpty

func (s Status) IsEmpty() bool

IsEmpty method that set empty or nil in fields

type UpdatePortfolioInput

type UpdatePortfolioInput struct {
	Name     string         `json:"name"`
	Status   Status         `json:"status"`
	Metadata map[string]any `json:"metadata"`
}

UpdatePortfolioInput is a struct design to encapsulate payload data.

Jump to

Keyboard shortcuts

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