model spec

This commit is contained in:
2025-05-09 12:42:42 +03:00
parent d8b40b6995
commit 99bc97b104
16 changed files with 500 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
module finance
import base
pub struct Account {
base.Base
pub mut:
name string // internal name of the account for the user
user_id u32 // user id of the owner of the account
description string // optional description of the account
ledger string // describes the ledger/blockchain where the account is located e.g. "ethereum", "bitcoin" or other institutions
address string // address of the account on the blockchain
pubkey string
assets []Asset
}

View File

@@ -0,0 +1,31 @@
module finance
import base
pub enum AssetType {
erc20
erc721
erc1155
native
}
pub struct Asset {
base.Base
pub mut:
name string
description string
amount f64
address string // address of the asset on the blockchain or bank
asset_type AssetType // type of the asset
decimals u8 // number of decimals of the asset
}
pub fn (self Asset) index_keys() map[string]string {
return {
'name': self.name
}
}
pub fn (self Asset) ftindex_keys() map[string]string {
return map[string]string{}
}