Add documentation comments for db subprefix types

This commit is contained in:
lash 2024-12-08 21:21:48 +00:00
parent 3416fdf50c
commit 890f50704f
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -7,43 +7,88 @@ import (
"git.defalsify.org/vise.git/logging" "git.defalsify.org/vise.git/logging"
) )
// DataType is a subprefix value used in association with vise/db.DATATYPE_USERDATA.
//
// All keys are used only within the context of a single account. Unless otherwise specified, the user context is the session id.
//
// * The first byte is vise/db.DATATYPE_USERDATA
// * The last 2 bytes are the DataTyp value, big-endian.
// * The intermediate bytes are the id of the user context.
//
// All values are strings
type DataTyp uint16 type DataTyp uint16
const ( const (
// TODO: Seems unused
DATA_ACCOUNT DataTyp = iota DATA_ACCOUNT DataTyp = iota
// TODO: Seems unused, only read not written
DATA_ACCOUNT_CREATED DATA_ACCOUNT_CREATED
// API Tracking id to follow status of account creation
DATA_TRACKING_ID DATA_TRACKING_ID
// EVM address returned from API on account creation
DATA_PUBLIC_KEY DATA_PUBLIC_KEY
// TODO: Seems unused
DATA_CUSTODIAL_ID DATA_CUSTODIAL_ID
// Currently active PIN used to authenticate ussd state change requests
DATA_ACCOUNT_PIN DATA_ACCOUNT_PIN
// TODO: Seems unused
DATA_ACCOUNT_STATUS DATA_ACCOUNT_STATUS
// The first name of the user
DATA_FIRST_NAME DATA_FIRST_NAME
// The last name of the user
DATA_FAMILY_NAME DATA_FAMILY_NAME
// The year-of-birth of the user
DATA_YOB DATA_YOB
// The location of the user
DATA_LOCATION DATA_LOCATION
// The gender of the user
DATA_GENDER DATA_GENDER
// The offerings description of the user
DATA_OFFERINGS DATA_OFFERINGS
// The ethereum address of the recipient of an ongoing send request
DATA_RECIPIENT DATA_RECIPIENT
// The voucher value amount of an ongoing send request
DATA_AMOUNT DATA_AMOUNT
// A general swap field for temporary values
DATA_TEMPORARY_VALUE DATA_TEMPORARY_VALUE
// Currently active voucher symbol of user
DATA_ACTIVE_SYM DATA_ACTIVE_SYM
// Voucher balance of user's currently active voucher
DATA_ACTIVE_BAL DATA_ACTIVE_BAL
// String boolean indicating whether use of PIN is blocked
DATA_BLOCKED_NUMBER DATA_BLOCKED_NUMBER
// Reverse mapping of a user's evm address to a session id.
DATA_PUBLIC_KEY_REVERSE DATA_PUBLIC_KEY_REVERSE
// Decimal count of the currently active voucher
DATA_ACTIVE_DECIMAL DATA_ACTIVE_DECIMAL
// EVM address of the currently active voucher
DATA_ACTIVE_ADDRESS DATA_ACTIVE_ADDRESS
// Start the sub prefix data at 256 (0x0100) )
const (
// List of valid voucher symbols in the user context.
DATA_VOUCHER_SYMBOLS DataTyp = 256 + iota DATA_VOUCHER_SYMBOLS DataTyp = 256 + iota
// List of voucher balances for vouchers valid in the user context.
DATA_VOUCHER_BALANCES DATA_VOUCHER_BALANCES
// List of voucher decimal counts for vouchers valid in the user context.
DATA_VOUCHER_DECIMALS DATA_VOUCHER_DECIMALS
// List of voucher EVM addresses for vouchers valid in the user context.
DATA_VOUCHER_ADDRESSES DATA_VOUCHER_ADDRESSES
// List of senders for valid transactions in the user context.
DATA_TX_SENDERS DATA_TX_SENDERS
// List of recipients for valid transactions in the user context.
DATA_TX_RECIPIENTS DATA_TX_RECIPIENTS
// List of voucher values for valid transactions in the user context.
DATA_TX_VALUES DATA_TX_VALUES
// List of voucher EVM addresses for valid transactions in the user context.
DATA_TX_ADDRESSES DATA_TX_ADDRESSES
// List of valid transaction hashes in the user context.
DATA_TX_HASHES DATA_TX_HASHES
// List of transaction dates for valid transactions in the user context.
DATA_TX_DATES DATA_TX_DATES
// List of voucher symbols for valid transactions in the user context.
DATA_TX_SYMBOLS DATA_TX_SYMBOLS
// List of voucher decimal counts for valid transactions in the user context.
DATA_TX_DECIMALS DATA_TX_DECIMALS
) )