mmodel

package
v1.51.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2025 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertBalancesToLibBalances added in v1.50.0

func ConvertBalancesToLibBalances(balances []*Balance) []*libTransaction.Balance

ConvertBalancesToLibBalances is a func that convert []*Balance to []*libTransaction.Balance

Types

type Account

type Account struct {
	// Unique identifier for the account (UUID format)
	ID string `json:"id" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Name of the account (max length 256 characters)
	Name string `json:"name" example:"My Account" maxLength:"256"`

	// ID of the parent account if this is a sub-account (UUID format)
	ParentAccountID *string `json:"parentAccountId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Optional external entity identifier (max length 256 characters)
	EntityID *string `json:"entityId" example:"00000000-0000-0000-0000-000000000000" maxLength:"256"`

	// Asset code associated with this account (max length 100 characters)
	AssetCode string `json:"assetCode" example:"BRL" maxLength:"100"`

	// ID of the organization that owns this account (UUID format)
	OrganizationID string `json:"organizationId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// ID of the ledger this account belongs to (UUID format)
	LedgerID string `json:"ledgerId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// ID of the portfolio this account belongs to (UUID format)
	PortfolioID *string `json:"portfolioId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// ID of the segment this account belongs to (UUID format)
	SegmentID *string `json:"segmentId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Status of the account (active, inactive, pending)
	Status Status `json:"status"`

	// Unique alias for the account (max length 100 characters)
	Alias *string `json:"alias" example:"@person1" maxLength:"100"`

	// Type of the account (e.g., checking, savings, creditCard, expense)
	Type string `json:"type" example:"creditCard"`

	// Timestamp when the account was created
	CreatedAt time.Time `json:"createdAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the account was last updated
	UpdatedAt time.Time `json:"updatedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the account was deleted (null if not deleted)
	DeletedAt *time.Time `json:"deletedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Additional custom attributes for the account
	Metadata map[string]any `json:"metadata,omitempty"`

} // @name Account

Account is a struct designed to encapsulate response payload data.

swagger:model Account

@Description Account represents an individual financial entity within a ledger, such as a bank account, credit card, or expense category.

func (*Account) IDtoUUID added in v1.48.0

func (a *Account) IDtoUUID() uuid.UUID

IDtoUUID is a func that convert UUID string to uuid.UUID

type Accounts

type Accounts struct {
	// Array of account records
	Items []Account `json:"items"`

	// Current page number
	Page int `json:"page" example:"1" minimum:"1"`

	// Maximum number of items per page
	Limit int `json:"limit" example:"10" minimum:"1" maximum:"100"`

} // @name Accounts

Accounts struct to return get all.

swagger:model Accounts

@Description Accounts represents a paginated collection of account records returned by list operations.

type Address

type Address struct {
	// Primary address line (street address or PO Box)
	Line1 string `json:"line1" example:"Street 1" maxLength:"256"`

	// Secondary address information like apartment number, suite, or floor
	Line2 *string `json:"line2" example:"Street 2" maxLength:"256"`

	// Postal code or ZIP code
	ZipCode string `json:"zipCode" example:"00000-000" maxLength:"20"`

	// City or locality name
	City string `json:"city" example:"New York" maxLength:"100"`

	// State, province, or region name or code
	State string `json:"state" example:"NY" maxLength:"100"`

	// Country code in ISO 3166-1 alpha-2 format (two-letter country code)
	Country string `json:"country" example:"US" minLength:"2" maxLength:"2"` // According to ISO 3166-1 alpha-2

} // @name Address

Address structure for marshaling/unmarshalling JSON.

swagger:model Address @Description Structured address information following standard postal address format. Country field follows ISO 3166-1 alpha-2 standard (2-letter country codes).

func (Address) IsEmpty

func (a Address) IsEmpty() bool

IsEmpty method that set empty or nil in fields

type Asset

type Asset struct {
	// Unique identifier for the asset (UUID format)
	ID string `json:"id" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Name of the asset (max length 256 characters)
	Name string `json:"name" example:"Brazilian Real" maxLength:"256"`

	// Type of the asset (e.g., currency, cryptocurrency, commodity, stock)
	Type string `json:"type" example:"currency"`

	// Unique code/symbol for the asset (max length 100 characters)
	Code string `json:"code" example:"BRL" maxLength:"100"`

	// Status of the asset (active, inactive, pending)
	Status Status `json:"status"`

	// ID of the ledger this asset belongs to (UUID format)
	LedgerID string `json:"ledgerId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// ID of the organization that owns this asset (UUID format)
	OrganizationID string `json:"organizationId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Timestamp when the asset was created
	CreatedAt time.Time `json:"createdAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the asset was last updated
	UpdatedAt time.Time `json:"updatedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the asset was deleted (null if not deleted)
	DeletedAt *time.Time `json:"deletedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Additional custom attributes for the asset
	Metadata map[string]any `json:"metadata,omitempty"`

} //	@name	Asset

Asset is a struct designed to encapsulate payload data.

swagger:model Asset

@Description	Asset represents a financial instrument within a ledger, such as a currency, cryptocurrency, commodity, or other asset type.

type Assets

type Assets struct {
	// Array of asset records
	Items []Asset `json:"items"`

	// Current page number
	Page int `json:"page" example:"1" minimum:"1"`

	// Maximum number of items per page
	Limit int `json:"limit" example:"10" minimum:"1" maximum:"100"`

} //	@name	Assets

Assets struct to return get all.

swagger:model Assets

@Description	Assets represents a paginated collection of asset records returned by list operations.

type Balance

type Balance struct {
	ID             string         `json:"id" example:"00000000-0000-0000-0000-000000000000"`
	OrganizationID string         `json:"organizationId" example:"00000000-0000-0000-0000-000000000000"`
	LedgerID       string         `json:"ledgerId" example:"00000000-0000-0000-0000-000000000000"`
	AccountID      string         `json:"accountId" example:"00000000-0000-0000-0000-000000000000"`
	Alias          string         `json:"alias" example:"@person1"`
	AssetCode      string         `json:"assetCode" example:"BRL"`
	Available      int64          `json:"available" example:"1500"`
	OnHold         int64          `json:"onHold" example:"500"`
	Scale          int64          `json:"scale" example:"2"`
	Version        int64          `json:"version" example:"1"`
	AccountType    string         `json:"accountType" example:"creditCard"`
	AllowSending   bool           `json:"allowSending" example:"true"`
	AllowReceiving bool           `json:"allowReceiving" example:"true"`
	CreatedAt      time.Time      `json:"createdAt" example:"2021-01-01T00:00:00Z"`
	UpdatedAt      time.Time      `json:"updatedAt" example:"2021-01-01T00:00:00Z"`
	DeletedAt      *time.Time     `json:"deletedAt" example:"2021-01-01T00:00:00Z"`
	Metadata       map[string]any `json:"metadata,omitempty"`
}

Balance is a struct designed to encapsulate response payload data.

swagger:model Balance @Description Balance is a struct designed to store balance data.

func (*Balance) ConvertToLibBalance added in v1.50.0

func (b *Balance) ConvertToLibBalance() *libTransaction.Balance

ConvertToLibBalance is a func that convert Balance to libTransaction.Balance

func (*Balance) IDtoUUID added in v1.48.0

func (b *Balance) IDtoUUID() uuid.UUID

IDtoUUID is a func that convert UUID string to uuid.UUID

type BalanceRedis added in v1.49.0

type BalanceRedis struct {
	ID             string `json:"id"`
	AccountID      string `json:"accountId"`
	AssetCode      string `json:"assetCode"`
	Available      int64  `json:"available"`
	OnHold         int64  `json:"onHold"`
	Scale          int64  `json:"scale"`
	Version        int64  `json:"version"`
	AccountType    string `json:"accountType"`
	AllowSending   int    `json:"allowSending"`
	AllowReceiving int    `json:"allowReceiving"`
}

type Balances added in v1.48.0

type Balances struct {
	Items []Balance `json:"items"`
	Page  int       `json:"page" example:"1"`
	Limit int       `json:"limit" example:"10"`

} // @name Balances

Balances struct to return get all.

swagger:model Balances @Description Balances is the struct designed to return a list of balances with pagination.

type CreateAccountInput

type CreateAccountInput struct {
	// Name of the account (optional, max length 256 characters)
	Name string `json:"name" validate:"max=256" example:"My Account"`

	// ID of the parent account if this is a sub-account (optional, UUID format)
	ParentAccountID *string `json:"parentAccountId" validate:"omitempty,uuid" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Optional external entity identifier (max length 256 characters)
	EntityID *string `json:"entityId" validate:"omitempty,max=256" example:"00000000-0000-0000-0000-000000000000" maxLength:"256"`

	// Asset code that this account will use (required, max length 100 characters)
	AssetCode string `json:"assetCode" validate:"required,max=100" example:"BRL" maxLength:"100"`

	// ID of the portfolio this account belongs to (optional, UUID format)
	PortfolioID *string `json:"portfolioId" validate:"omitempty,uuid" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// ID of the segment this account belongs to (optional, UUID format)
	SegmentID *string `json:"segmentId" validate:"omitempty,uuid" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Status of the account (active, inactive, pending)
	Status Status `json:"status"`

	// Unique alias for the account (optional, max length 100 characters, must follow alias format rules)
	Alias *string `json:"alias" validate:"omitempty,max=100,prohibitedexternalaccountprefix" example:"@person1" maxLength:"100"`

	// Type of the account (e.g., checking, savings, creditCard, expense)
	Type string `json:"type" validate:"required" example:"creditCard"`

	// Additional custom attributes for the account
	// Keys max length: 100 characters, Values max length: 2000 characters
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,nonested,valuemax=2000"`

} // @name CreateAccountInput

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

swagger:model CreateAccountInput

@Description CreateAccountInput is the input payload to create an account within a ledger, representing an individual financial entity like a bank account, credit card, or expense category.

type CreateAssetInput

type CreateAssetInput struct {
	// Name of the asset (required, max length 256 characters)
	Name string `json:"name" validate:"required,max=256" example:"Brazilian Real"`

	// Type of the asset (e.g., currency, cryptocurrency, commodity, stock)
	Type string `json:"type" example:"currency"`

	// Unique code/symbol for the asset (required, max length 100 characters)
	Code string `json:"code" validate:"required,max=100" example:"BRL"`

	// Status of the asset (active, inactive, pending)
	Status Status `json:"status"`

	// Additional custom attributes for the asset
	// Keys max length: 100 characters, Values max length: 2000 characters
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,nonested,valuemax=2000"`

} //	@name	CreateAssetInput

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

swagger:model CreateAssetInput

@Description	CreateAssetInput is the input payload to create an asset within a ledger, such as a currency, cryptocurrency, or other financial instrument.

type CreateLedgerInput

type CreateLedgerInput struct {
	// Display name of the ledger (required)
	Name string `json:"name" validate:"required,max=256" example:"Lerian Studio" maxLength:"256"`

	// Current operating status of the ledger (defaults to ACTIVE if not specified)
	Status Status `json:"status"`

	// Custom key-value pairs for extending the ledger information
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,nonested,valuemax=2000"`

} // @name CreateLedgerInput

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

swagger:model CreateLedgerInput @Description Request payload for creating a new ledger. Contains the ledger name (required), status, and optional metadata.

type CreateOrganizationInput

type CreateOrganizationInput struct {
	// Official legal name of the organization (required)
	LegalName string `json:"legalName" validate:"required,max=256" example:"Lerian Studio" maxLength:"256"`

	// UUID of the parent organization if this is a child organization (optional)
	ParentOrganizationID *string `json:"parentOrganizationId" validate:"omitempty,uuid" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Trading or brand name of the organization, if different from legal name (optional)
	DoingBusinessAs *string `json:"doingBusinessAs" validate:"max=256" example:"Lerian Studio" maxLength:"256"`

	// Official tax ID, company registration number, or other legal identification (required)
	LegalDocument string `json:"legalDocument" validate:"required,max=256" example:"00000000000000" maxLength:"256"`

	// Physical address of the organization (optional)
	Address Address `json:"address"`

	// Current operating status of the organization (defaults to ACTIVE if not specified)
	Status Status `json:"status"`

	// Custom key-value pairs for extending the organization information
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,nonested,valuemax=2000"`

} // @name CreateOrganizationInput

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

// swagger:model CreateOrganizationInput @Description Request payload for creating a new organization. Contains all the necessary fields for organization creation, with required fields marked as such.

type CreatePortfolioInput

type CreatePortfolioInput struct {
	// Optional external entity identifier (max length 256 characters)
	EntityID string `json:"entityId" validate:"omitempty,max=256" example:"00000000-0000-0000-0000-000000000000"`

	// Name of the portfolio (required, max length 256 characters)
	Name string `json:"name" validate:"required,max=256" example:"My Portfolio"`

	// Status of the portfolio (active, inactive, pending)
	Status Status `json:"status"`

	// Additional custom attributes for the portfolio
	// Keys max length: 100 characters, Values max length: 2000 characters
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,nonested,valuemax=2000"`

} // @name CreatePortfolioInput

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

swagger:model CreatePortfolioInput

@Description CreatePortfolioInput is the input payload to create a portfolio within a ledger, representing a collection of accounts grouped for specific purposes.

type CreateSegmentInput added in v1.47.0

type CreateSegmentInput struct {
	// Name of the segment (required, max length 256 characters)
	Name string `json:"name" validate:"required,max=256" example:"My Segment"`

	// Status of the segment (active, inactive, pending)
	Status Status `json:"status"`

	// Additional custom attributes for the segment
	// Keys max length: 100 characters, Values max length: 2000 characters
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,nonested,valuemax=2000"`

} // @name CreateSegmentInput

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

swagger:model CreateSegmentInput

@Description CreateSegmentInput is the input payload to create a segment within a ledger, representing a logical division such as a business area, product line, or customer category.

type Error added in v1.51.0

type Error struct {
	// Error code identifying the specific error condition
	// example: ERR_INVALID_INPUT
	Code string `json:"code"`

	// Short, human-readable error title
	// example: Bad Request
	Title string `json:"title"`

	// Detailed error message explaining the issue
	// example: The request contains invalid fields. Please check the field 'name' and try again.
	Message string `json:"message"`

	// Optional type of entity associated with the error
	// example: Organization
	EntityType string `json:"entityType,omitempty"`

	// Optional detailed field validations for client-side handling
	// example: {"name": "Field 'name' is required"}
	Fields map[string]string `json:"fields,omitempty"`

} // @name Error

Error represents a standardized API error response format

swagger:model Error @Description Standardized error response format used across all API endpoints for error situations

type Ledger

type Ledger struct {
	// Unique identifier for the ledger (UUID format)
	ID string `json:"id" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Display name of the ledger
	Name string `json:"name" example:"Lerian Studio" maxLength:"256"`

	// Reference to the organization that owns this ledger
	OrganizationID string `json:"organizationId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Current operating status of the ledger
	Status Status `json:"status"`

	// Timestamp when the ledger was created (RFC3339 format)
	CreatedAt time.Time `json:"createdAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the ledger was last updated (RFC3339 format)
	UpdatedAt time.Time `json:"updatedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the ledger was soft deleted, null if not deleted (RFC3339 format)
	DeletedAt *time.Time `json:"deletedAt" sql:"index" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Custom key-value pairs for extending the ledger information
	Metadata map[string]any `json:"metadata,omitempty"`

} // @name Ledger

Ledger is a struct designed to encapsulate payload data.

swagger:model Ledger @Description Complete ledger entity containing all fields including system-generated fields like ID, creation timestamps, and metadata. This is the response format for ledger operations.

type Ledgers

type Ledgers struct {
	// List of ledger items in the current page
	Items []Ledger `json:"items"`

	// Current page number
	Page int `json:"page" example:"1" minimum:"1"`

	// Maximum number of items per page
	Limit int `json:"limit" example:"10" minimum:"1" maximum:"100"`

} // @name Ledgers

Ledgers struct to return get all.

swagger:model Ledgers @Description Paginated list of ledgers with metadata about the current page, limit, and the ledger items themselves.

type Organization

type Organization struct {
	// Unique identifier for the organization (UUID format)
	ID string `json:"id" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Reference to the parent organization, if this is a child organization
	ParentOrganizationID *string `json:"parentOrganizationId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Official legal name of the organization
	LegalName string `json:"legalName" example:"Lerian Studio" maxLength:"256"`

	// Trading or brand name of the organization, if different from legal name
	DoingBusinessAs *string `json:"doingBusinessAs" example:"Lerian Studio" maxLength:"256"`

	// Official tax ID, company registration number, or other legal identification
	LegalDocument string `json:"legalDocument" example:"00000000000000" maxLength:"256"`

	// Physical address of the organization
	Address Address `json:"address"`

	// Current operating status of the organization
	Status Status `json:"status"`

	// Timestamp when the organization was created (RFC3339 format)
	CreatedAt time.Time `json:"createdAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the organization was last updated (RFC3339 format)
	UpdatedAt time.Time `json:"updatedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the organization was soft deleted, null if not deleted (RFC3339 format)
	DeletedAt *time.Time `json:"deletedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Custom key-value pairs for extending the organization information
	Metadata map[string]any `json:"metadata,omitempty"`

} // @name Organization

Organization is a struct designed to encapsulate response payload data.

swagger:model Organization @Description Complete organization entity containing all fields including system-generated fields like ID, creation timestamps, and metadata. This is the response format for organization operations.

type Organizations

type Organizations struct {
	Items []Organization `json:"items"`
	Page  int            `json:"page" example:"1"`
	Limit int            `json:"limit" example:"10"`

} // @name Organizations

Organizations struct to return get all.

swagger:model Organizations @Description Paginated list of organizations with metadata about the current page, limit, and the organization items themselves.

type Portfolio

type Portfolio struct {
	// Unique identifier for the portfolio (UUID format)
	ID string `json:"id" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Name of the portfolio (max length 256 characters)
	Name string `json:"name" example:"My Portfolio" maxLength:"256"`

	// Optional external entity identifier (max length 256 characters)
	EntityID string `json:"entityId,omitempty" example:"00000000-0000-0000-0000-000000000000" maxLength:"256"`

	// ID of the ledger this portfolio belongs to (UUID format)
	LedgerID string `json:"ledgerId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// ID of the organization that owns this portfolio (UUID format)
	OrganizationID string `json:"organizationId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Status of the portfolio (active, inactive, pending)
	Status Status `json:"status"`

	// Timestamp when the portfolio was created
	CreatedAt time.Time `json:"createdAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the portfolio was last updated
	UpdatedAt time.Time `json:"updatedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the portfolio was deleted (null if not deleted)
	DeletedAt *time.Time `json:"deletedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Additional custom attributes for the portfolio
	Metadata map[string]any `json:"metadata,omitempty"`

} // @name Portfolio

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

swagger:model Portfolio

@Description Portfolio represents a collection of accounts grouped for specific purposes such as business units, departments, or client portfolios.

type Portfolios

type Portfolios struct {
	// Array of portfolio records
	Items []Portfolio `json:"items"`

	// Current page number
	Page int `json:"page" example:"1" minimum:"1"`

	// Maximum number of items per page
	Limit int `json:"limit" example:"10" minimum:"1" maximum:"100"`

} // @name Portfolios

Portfolios struct to return get all.

swagger:model Portfolios

@Description Portfolios represents a paginated collection of portfolio records returned by list operations.

type Queue added in v1.31.0

type Queue struct {
	OrganizationID uuid.UUID   `json:"organizationId"`
	LedgerID       uuid.UUID   `json:"ledgerId"`
	AuditID        uuid.UUID   `json:"auditId"`
	AccountID      uuid.UUID   `json:"accountId"`
	QueueData      []QueueData `json:"queueData"`
}

type QueueData added in v1.31.0

type QueueData struct {
	ID    uuid.UUID       `json:"id"`
	Value json.RawMessage `json:"value"`
}

type Segment added in v1.47.0

type Segment struct {
	// Unique identifier for the segment (UUID format)
	ID string `json:"id" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Name of the segment (max length 256 characters)
	Name string `json:"name" example:"My Segment" maxLength:"256"`

	// ID of the ledger this segment belongs to (UUID format)
	LedgerID string `json:"ledgerId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// ID of the organization that owns this segment (UUID format)
	OrganizationID string `json:"organizationId" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Status of the segment (active, inactive, pending)
	Status Status `json:"status"`

	// Timestamp when the segment was created
	CreatedAt time.Time `json:"createdAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the segment was last updated
	UpdatedAt time.Time `json:"updatedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Timestamp when the segment was deleted (null if not deleted)
	DeletedAt *time.Time `json:"deletedAt" example:"2021-01-01T00:00:00Z" format:"date-time"`

	// Additional custom attributes for the segment
	Metadata map[string]any `json:"metadata,omitempty"`

} // @name Segment

Segment is a struct designed to encapsulate payload data.

swagger:model Segment

@Description Segment represents a logical division within a ledger such as a business area, product line, or customer category.

type Segments added in v1.47.0

type Segments struct {
	// Array of segment records
	Items []Segment `json:"items"`

	// Current page number
	Page int `json:"page" example:"1" minimum:"1"`

	// Maximum number of items per page
	Limit int `json:"limit" example:"10" minimum:"1" maximum:"100"`

} // @name Segments

Segments struct to return get all.

swagger:model Segments

@Description Segments represents a paginated collection of segment records returned by list operations.

type Status

type Status struct {
	// Status code identifier, common values include: ACTIVE, INACTIVE, PENDING, SUSPENDED, DELETED
	Code string `json:"code" validate:"max=100" example:"ACTIVE" maxLength:"100" enum:"ACTIVE,INACTIVE,PENDING,SUSPENDED,DELETED"`

	// Optional human-readable description of the status
	Description *string `json:"description" validate:"omitempty,max=256" example:"Active status" maxLength:"256"`

} // @name Status

Status structure for marshaling/unmarshalling JSON.

swagger:model Status @Description Entity status information with a standardized code and optional description. Common status codes include: ACTIVE, INACTIVE, PENDING, SUSPENDED, DELETED.

func (Status) IsEmpty

func (s Status) IsEmpty() bool

IsEmpty method that set empty or nil in fields

type UpdateAccountInput

type UpdateAccountInput struct {
	// Updated name of the account (optional, max length 256 characters)
	Name string `json:"name" validate:"max=256" example:"My Account Updated" maxLength:"256"`

	// Updated segment ID for the account (optional, UUID format)
	SegmentID *string `json:"segmentId" validate:"omitempty,uuid" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Updated portfolio ID for the account (optional, UUID format)
	PortfolioID *string `json:"portfolioId" validate:"omitempty,uuid" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Updated status of the account (active, inactive, pending)
	Status Status `json:"status"`

	// Updated or additional custom attributes for the account
	// Keys max length: 100 characters, Values max length: 2000 characters
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,omitempty,nonested,valuemax=2000"`

} // @name UpdateAccountInput

UpdateAccountInput is a struct design to encapsulate request update payload data.

swagger:model UpdateAccountInput

@Description UpdateAccountInput is the input payload to update an existing account's properties such as name, status, portfolio, segment, and metadata.

type UpdateAssetInput

type UpdateAssetInput struct {
	// Updated name of the asset (optional, max length 256 characters)
	Name string `json:"name" validate:"max=256" example:"Bitcoin"`

	// Updated status of the asset (active, inactive, pending)
	Status Status `json:"status"`

	// Updated or additional custom attributes for the asset
	// Keys max length: 100 characters, Values max length: 2000 characters
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,omitempty,nonested,valuemax=2000"`

} //	@name	UpdateAssetInput

UpdateAssetInput is a struct design to encapsulate request update payload data.

swagger:model UpdateAssetInput

@Description	UpdateAssetInput is the input payload to update an existing asset's properties such as name, status, and metadata.

type UpdateBalance added in v1.48.0

type UpdateBalance struct {
	AllowSending   *bool `json:"allowSending" example:"true"`
	AllowReceiving *bool `json:"allowReceiving" example:"true"`
}

type UpdateLedgerInput

type UpdateLedgerInput struct {
	// Updated display name of the ledger (optional)
	Name string `json:"name" validate:"max=256" example:"Lerian Studio Updated" maxLength:"256"`

	// Updated status of the ledger (optional)
	Status Status `json:"status"`

	// Updated custom key-value pairs for extending the ledger information (optional)
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,omitempty,nonested,valuemax=2000"`

} // @name UpdateLedgerInput

UpdateLedgerInput is a struct design to encapsulate request update payload data.

swagger:model UpdateLedgerInput @Description Request payload for updating an existing ledger. All fields are optional - only specified fields will be updated. Omitted fields will remain unchanged.

type UpdateOrganizationInput

type UpdateOrganizationInput struct {
	// Updated legal name of the organization (optional)
	LegalName string `json:"legalName" validate:"max=256" example:"Lerian Studio Updated" maxLength:"256"`

	// UUID of the parent organization if this is a child organization (optional)
	ParentOrganizationID *string `json:"parentOrganizationId" validate:"omitempty,uuid" example:"00000000-0000-0000-0000-000000000000" format:"uuid"`

	// Updated trading or brand name of the organization (optional)
	DoingBusinessAs string `json:"doingBusinessAs" validate:"max=256" example:"The ledger.io" maxLength:"256"`

	// Updated physical address of the organization (optional)
	Address Address `json:"address"`

	// Updated status of the organization (optional)
	Status Status `json:"status"`

	// Updated custom key-value pairs for extending the organization information (optional)
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,omitempty,nonested,valuemax=2000"`

} // @name UpdateOrganizationInput

UpdateOrganizationInput is a struct design to encapsulate request update payload data.

// swagger:model UpdateOrganizationInput @Description Request payload for updating an existing organization. All fields are optional - only specified fields will be updated. Omitted fields will remain unchanged.

type UpdatePortfolioInput

type UpdatePortfolioInput struct {
	// Updated external entity identifier (optional, max length 256 characters)
	EntityID string `json:"entityId" validate:"omitempty,max=256" example:"00000000-0000-0000-0000-000000000000"`

	// Updated name of the portfolio (optional, max length 256 characters)
	Name string `json:"name" validate:"max=256" example:"My Portfolio Updated"`

	// Updated status of the portfolio (active, inactive, pending)
	Status Status `json:"status"`

	// Updated or additional custom attributes for the portfolio
	// Keys max length: 100 characters, Values max length: 2000 characters
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,omitempty,nonested,valuemax=2000"`

} // @name UpdatePortfolioInput

UpdatePortfolioInput is a struct design to encapsulate payload data.

swagger:model UpdatePortfolioInput

@Description UpdatePortfolioInput is the input payload to update an existing portfolio's properties such as name, entity ID, status, and metadata.

type UpdateSegmentInput added in v1.47.0

type UpdateSegmentInput struct {
	// Updated name of the segment (optional, max length 256 characters)
	Name string `json:"name" validate:"max=256" example:"My Segment Updated"`

	// Updated status of the segment (active, inactive, pending)
	Status Status `json:"status"`

	// Updated or additional custom attributes for the segment
	// Keys max length: 100 characters, Values max length: 2000 characters
	Metadata map[string]any `json:"metadata" validate:"dive,keys,keymax=100,endkeys,omitempty,nonested,valuemax=2000"`

} // @name UpdateSegmentInput

UpdateSegmentInput is a struct design to encapsulate request update payload data.

swagger:model UpdateSegmentInput

@Description UpdateSegmentInput is the input payload to update an existing segment's properties such as name, status, and metadata.

Jump to

Keyboard shortcuts

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