COOPENOMICS  v1
Кооперативная Экономика
Файл accounts.hpp
#include <array>
#include <cstdint>
#include <string_view>

См. исходные тексты.

Классы

struct  ledger2_accounts
 План счетов ledger2 (MVP) со смещением *1000. Подробнее...
 
struct  Ledger2AccountMeta
 Справочник счёта: id → (имя, тип). Подробнее...
 

Пространства имен

namespace  ledger2_accounts_detail
 

Перечисления

enum class  AccountType : uint8_t { AccountType::ACTIVE = 0 , AccountType::PASSIVE = 1 , AccountType::ACTIVE_PASSIVE = 2 }
 Тип бухгалтерского счёта. Подробнее...
 

Функции

constexpr bool ledger2_accounts_detail::account_ids_unique ()
 
constexpr const Ledger2AccountMetaledger2_find_account_meta (uint64_t account_id)
 
std::string_view ledger2_get_account_name_by_id (uint64_t account_id)
 
constexpr AccountType ledger2_get_account_type_by_id (uint64_t account_id)
 

Переменные

constexpr std::array< Ledger2AccountMeta, 6 > LEDGER2_ACCOUNT_MAP
 Хардкод-справочник плана счетов (MVP, 7 записей). Подробнее...
 
static constexpr size_t LEDGER2_ACCOUNT_MAP_SIZE = LEDGER2_ACCOUNT_MAP.size()
 

Функции

◆ ledger2_find_account_meta()

constexpr const Ledger2AccountMeta * ledger2_find_account_meta ( uint64_t  account_id)
inlineconstexpr

◆ ledger2_get_account_name_by_id()

std::string_view ledger2_get_account_name_by_id ( uint64_t  account_id)
inline

◆ ledger2_get_account_type_by_id()

constexpr AccountType ledger2_get_account_type_by_id ( uint64_t  account_id)
inlineconstexpr

Переменные

◆ LEDGER2_ACCOUNT_MAP

constexpr std::array<Ledger2AccountMeta, 6> LEDGER2_ACCOUNT_MAP
inlineconstexpr
Инициализатор
= {{
{ ledger2_accounts::INTANGIBLE_ASSETS, "Нематериальные активы", AccountType::ACTIVE },
{ ledger2_accounts::NON_CURRENT_INVESTMENTS, "Вложения во внеоборотные активы", AccountType::ACTIVE },
{ ledger2_accounts::BANK_ACCOUNT, "Расчётный счёт", AccountType::ACTIVE },
{ ledger2_accounts::FINANCIAL_INVESTMENTS, "Финансовые вложения", AccountType::ACTIVE },
{ ledger2_accounts::SHARE_FUND, "Паевой фонд (складочный капитал)", AccountType::PASSIVE },
{ ledger2_accounts::TARGET_RECEIPTS, "Целевое финансирование", AccountType::PASSIVE },
}}
static constexpr uint64_t TARGET_RECEIPTS
86 — Целевое финансирование (П)
Definition: accounts.hpp:60
static constexpr uint64_t FINANCIAL_INVESTMENTS
58 — Финансовые вложения (А)
Definition: accounts.hpp:56
static constexpr uint64_t INTANGIBLE_ASSETS
04 — Нематериальные активы (А)
Definition: accounts.hpp:53
static constexpr uint64_t NON_CURRENT_INVESTMENTS
08 — Вложения во внеоборотные активы (А)
Definition: accounts.hpp:54
static constexpr uint64_t BANK_ACCOUNT
51 — Расчётный счёт (А)
Definition: accounts.hpp:55
static constexpr uint64_t SHARE_FUND
80 — Паевой фонд (П)
Definition: accounts.hpp:59

Хардкод-справочник плана счетов (MVP, 7 записей).

constexpr std::array + string_view — чтобы не было dynamic init при загрузке контракта и тип был полностью заморожен на этапе сборки.

◆ LEDGER2_ACCOUNT_MAP_SIZE

constexpr size_t LEDGER2_ACCOUNT_MAP_SIZE = LEDGER2_ACCOUNT_MAP.size()
staticconstexpr