Skip to content

Feature: Replace Floating-Point Monetary Storage #64

Description

@3m1n3nc3

Description

Replace binary floating-point money fields with exact asset units and explicit asset identity.

File Location

learnault-api/prisma/schema.prisma, monetary utilities, migrations, and affected tests

Design Reference

API Roadmap Phase 0: Replace Floating-Point Monetary Storage.

Dependencies

  • Status: Blocked
  • Blocked by: Feature: Repair Clean Install and Prisma Generation
  • Blocks: API Phase 1 wallet schema and later rewards/payouts

Tasks

  • Inventory all persisted and calculated amounts using Float or JavaScript number
  • Choose integer stroops/asset units or exact decimals and rounding rules
  • Persist asset code, issuer, network, and decimals where required
  • Create checked forward migration and rollback notes
  • Prevent implicit number coercion in serializers and arithmetic
  • Test conversion, rounding, overflow, and boundaries

Acceptance Criteria

  • No persisted monetary amount uses binary floating point
  • Asset and unit are explicit
  • Unsafe legacy conversion fails visibly
  • Migration and arithmetic tests pass

Verification Evidence

  • Attach schema diff, migration dry-run, and exact-arithmetic tests

Difficulty

Advanced

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions