Logotipo Hedhog

Get Hedhog updates in your inbox

New releases, fresh recipes, and breaking changes — no spam.

Back to LMS modulesLMS Submodule

LMS Submodule

bitcode-wallets

Virtual currency (Bitcode) wallets for learners with a credit/debit transaction ledger. Bitcodes are awarded primarily through Achievements.

Source path: libraries/lms/src/bitcode-wallet

Module file: bitcode-wallet.module.ts

Introduction

Each wallet is a one-to-one ledger tied to a `person`, holding a running balance built from individual credit/debit transactions rather than a single mutable number — every change to a student's Bitcode balance is recorded as its own auditable row with a type, amount, and optional description. The admin-facing `BitcodeWalletController` (`/lms/bitcode-wallets`) covers wallet CRUD and lets an operator post manual transactions directly.

A second, self-service path exists outside this submodule's own controller: the Platforma student portal exposes `GET /lms/platforma/bitcodes/wallet` and `POST /lms/platforma/bitcodes/transactions`, letting an authenticated student view their own wallet and create their own transactions using a dedicated `CreateCurrentBitcodeWalletTransactionDto` (which adds an optional `source` field not present on the admin DTO, for tagging where a self-service credit originated). An `UpdateBitcodeWalletTransactionDto` also exists in source but has no controller route anywhere in the codebase — individual transactions can be created but never edited or listed on their own; the wallet's transaction history is presumably surfaced as part of the wallet-detail response instead.

HTTP Endpoints

6 endpoints

Paginated wallet list, searchable by person name.

Query
page, pageSize, search

Gets a wallet including its transaction history.

Params
id (int)

Creates a wallet for a person.

Body

FieldTypeRequiredNotes
personIdnumberyesMin 1

Updates the person linked to a wallet.

Params
id (int)

Body

FieldTypeRequiredNotes
personIdnumbernoMin 1

Deletes a wallet; 204 No Content.

Params
id (int)

Records a credit or debit transaction on the wallet.

Params
id (int, wallet id)

Body

FieldTypeRequiredNotes
type'credit' | 'debit'yes
amountnumberyesMin 1
descriptionstring | nullnoMax 2000 chars

MCP Tools

Named tools callable by AI models via the Model Context Protocol (MCP).

  • lms.bitcode-wallet.list

    Lists LMS BitCode wallets with optional pagination and search by person name

  • lms.bitcode-wallet.get

    Returns a single BitCode wallet by ID including its transaction history

  • lms.bitcode-wallet.create

    Creates a new BitCode wallet for a person

  • lms.bitcode-wallet.update

    Updates the person linked to a BitCode wallet

  • lms.bitcode-wallet.delete

    Deletes a BitCode wallet by ID

  • lms.bitcode-wallet.create-transaction

    Creates a credit or debit transaction on a BitCode wallet