Skip to content

2. Foundation Models #3

@mrserverless

Description

@mrserverless
  • 2.1 Implement models/money.go with decimal support
    • Money struct with Amount (decimal.Decimal) and Currency (string)
    • Arithmetic operations (Add, Subtract, Multiply, Divide)
    • Comparison operations (Equal, GreaterThan, LessThan)
    • JSON marshaling/unmarshaling (string format)
    • Validation (currency code, negative amounts where appropriate)
  • 2.2 Implement models/enums.go
    • AccountType (Checking, Savings, CreditCard, Investment)
    • TransactionType (Debit, Credit, Transfer, Payment, Fee)
    • ConsentStatus (Active, Expired, Revoked, Pending)
    • BalanceType (Current, Available, Pending)
  • 2.3 Implement models/account.go
    • Account ID, account number, account type
    • Product name, nickname
    • Account status (open, closed, suspended)
    • Open date, close date (optional)
  • 2.4 Implement models/balance.go
    • Balance type (current, available)
    • Amount (Money)
    • Timestamp
  • 2.5 Implement models/transaction.go
    • Transaction ID, reference
    • Transaction type
    • Amount (Money)
    • Description, merchant name
    • Posting date, value date
    • Running balance (optional)
  • 2.6 Implement models/consent.go
    • Consent ID
    • Status (ConsentStatus enum)
    • Scopes (string slice)
    • Grant date, expiry date
    • Revocation date (optional)
  • 2.7 Write unit tests for Money model
    • Test arithmetic operations
    • Test JSON serialization/deserialization
    • Test currency validation
    • Test edge cases (zero, negative, very large amounts)
  • 2.8 Write unit tests for enum validation

Source: openspec/changes/bootstrap-mvp-foundation/tasks.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions