handler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LedgerHandler

type LedgerHandler struct {
	// contains filtered or unexported fields
}

LedgerHandler handles HTTP requests for ledger operations.

func NewLedgerHandler

func NewLedgerHandler(ledgerService *service.LedgerService) *LedgerHandler

NewLedgerHandler creates a new ledger handler.

func (*LedgerHandler) CreateAccount

func (h *LedgerHandler) CreateAccount(w http.ResponseWriter, r *http.Request)

CreateAccount creates a new ledger account. POST /api/v1/accounts

func (*LedgerHandler) CreateAccountInternal

func (h *LedgerHandler) CreateAccountInternal(w http.ResponseWriter, r *http.Request)

CreateAccountInternal creates a new ledger account (internal endpoint). POST /internal/v1/accounts This is an internal endpoint for service-to-service communication (no authentication required).

func (*LedgerHandler) CreateJournalEntry

func (h *LedgerHandler) CreateJournalEntry(w http.ResponseWriter, r *http.Request)

CreateJournalEntry creates a new journal entry. POST /api/v1/journal-entries

func (*LedgerHandler) GetAccount

func (h *LedgerHandler) GetAccount(w http.ResponseWriter, r *http.Request)

GetAccount retrieves an account by ID. GET /api/v1/accounts/:id

func (*LedgerHandler) GetAccountBalance

func (h *LedgerHandler) GetAccountBalance(w http.ResponseWriter, r *http.Request)

GetAccountBalance retrieves the current balance of an account. GET /api/v1/accounts/:id/balance

func (*LedgerHandler) GetAccountByCode

func (h *LedgerHandler) GetAccountByCode(w http.ResponseWriter, r *http.Request)

GetAccountByCode retrieves an account by code. GET /api/v1/accounts/code/:code

func (*LedgerHandler) GetJournalEntry

func (h *LedgerHandler) GetJournalEntry(w http.ResponseWriter, r *http.Request)

GetJournalEntry retrieves a journal entry with its lines. GET /api/v1/journal-entries/:id

func (*LedgerHandler) ListAccounts

func (h *LedgerHandler) ListAccounts(w http.ResponseWriter, r *http.Request)

ListAccounts retrieves accounts with optional filters. GET /api/v1/accounts?type=asset&status=active&limit=50&offset=0

func (*LedgerHandler) ListJournalEntries

func (h *LedgerHandler) ListJournalEntries(w http.ResponseWriter, r *http.Request)

ListJournalEntries retrieves journal entries with optional filters. GET /api/v1/journal-entries?status=posted&limit=50&offset=0

func (*LedgerHandler) PostJournalEntry

func (h *LedgerHandler) PostJournalEntry(w http.ResponseWriter, r *http.Request)

PostJournalEntry posts a draft journal entry. POST /api/v1/journal-entries/:id/post

func (*LedgerHandler) ReverseJournalEntry

func (h *LedgerHandler) ReverseJournalEntry(w http.ResponseWriter, r *http.Request)

ReverseJournalEntry creates a reversing entry. POST /api/v1/journal-entries/:id/reverse

func (*LedgerHandler) UpdateAccount

func (h *LedgerHandler) UpdateAccount(w http.ResponseWriter, r *http.Request)

UpdateAccount updates an account. PUT /api/v1/accounts/:id

func (*LedgerHandler) VoidJournalEntry

func (h *LedgerHandler) VoidJournalEntry(w http.ResponseWriter, r *http.Request)

VoidJournalEntry voids a posted journal entry. POST /api/v1/journal-entries/:id/void

type Router

type Router struct {
	// contains filtered or unexported fields
}

Router sets up HTTP routes for the Ledger Service.

func NewRouter

func NewRouter(ledgerService *service.LedgerService, jwtSecret string) *Router

NewRouter creates a new router with all handlers.

func (*Router) SetupRoutes

func (r *Router) SetupRoutes() http.Handler

SetupRoutes configures all HTTP routes for the Ledger Service.

Jump to

Keyboard shortcuts

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