Skip to content

Conversation

@jafar75
Copy link
Collaborator

@jafar75 jafar75 commented Nov 28, 2025

Summary

Implements composite persistence for MintInvoiceManager using the child() method to split large monolithic JSON files into smaller, organized files.

Changes

  • Added child(key) method to Persistence trait
  • Implemented child() for JsonFilePersistence and InMemoryPersistence
  • Updated MintInvoiceManager to store metadata in root JSON and full invoice data (lots, positions) in individual files
  • File structure: chain_{id}/address_{addr}/order_{id}.json
  • As discussed, invoice metadata (IDs, amounts, timestamps) is stored in the root JSON file, while large nested data (lots array and position object) is stored in separate child files. This keeps the root file lightweight for fast queries while heavy data is loaded on-demand only when needed.

Migration

Run one-time migration test (commented) to convert existing data from old format to new format with child files.

@jafar75 jafar75 marked this pull request as ready for review November 28, 2025 17:04
@sadhbh-c0d3
Copy link
Collaborator

removed persistence folder :)

@sadhbh-c0d3 sadhbh-c0d3 reopened this Nov 28, 2025
Copy link
Collaborator

@sadhbh-c0d3 sadhbh-c0d3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all great!

@sadhbh-c0d3 sadhbh-c0d3 merged commit 782138d into main Nov 28, 2025
2 checks passed
@sadhbh-c0d3 sadhbh-c0d3 deleted the feat/persistence-composite branch November 28, 2025 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants