Skip to content

Refactor lock and transfer data models to remove deprecated inheritance message - #1660

Merged
YoshihitoAso merged 3 commits into
dev-25.9from
feature/#1657
Jul 24, 2025
Merged

Refactor lock and transfer data models to remove deprecated inheritance message#1660
YoshihitoAso merged 3 commits into
dev-25.9from
feature/#1657

Conversation

@purplesmoke05

@purplesmoke05 purplesmoke05 commented Jul 23, 2025

Copy link
Copy Markdown
Member

📌 Description

This pull request introduces new data models for lock and unlock messages, refactors existing code to use these models, and updates database migration and test cases accordingly. The changes aim to improve data validation and consistency across the system.

✅ Related Issues

🔄 Changes

Lock/Unlock Message Standardization

  • Added LockDataMessage and UnlockDataMessage classes in app/model/db/idx_lock_unlock.py to define structured data models for lock and unlock messages using pydantic and StrEnum. [1] [2] [3]
  • Updated IDXLock and IDXUnlock models to explicitly document that the data field uses LockDataMessage and UnlockDataMessage. [1] [2]

Data Validation

  • Incorporated validation of lock and unlock data using model_validate in batch processing scripts (indexer_Position_Bond.py and indexer_Position_Share.py). [1] [2] [3] [4]

Migration Script

  • Added a migration script (migrations/versions/819325835c3d_v25_9_0_feature_1657.py) to clean up legacy data by removing references to the deprecated "inheritance" message type from IDXTransfer, IDXLock, and IDXUnlock.

📌 Checklist

  • I have added tests where necessary.
  • I have updated the documentation where necessary.

@github-actions
github-actions Bot requested a review from YoshihitoAso July 23, 2025 10:00
@purplesmoke05
purplesmoke05 marked this pull request as draft July 23, 2025 23:39
@purplesmoke05
purplesmoke05 marked this pull request as ready for review July 24, 2025 00:19
@github-actions

Copy link
Copy Markdown

Coverage

Coverage Report •
FileStmtsMissCoverMissing
app/model/db
   __init__.py200100% 
   idx_lock_unlock.py691085%110–113, 116, 191–194, 197
   idx_transfer.py46197%97
batch
   indexer_Position_Bond.py90611986%92–95, 253, 450–451, 469–470, 533–534, 552–553, 617–618, 636–637, 702–703, 721–722, 807–808, 827–828, 865–866, 903–904, 941–942, 979–980, 1017–1018, 1030, 1044–1045, 1069–1070, 1077, 1094–1095, 1102, 1119–1120, 1144–1145, 1147–1148, 1151–1153, 1163, 1179–1180, 1238–1239, 1251, 1265–1266, 1273, 1288–1289, 1291–1292, 1295–1297, 1311–1312, 1319, 1372–1373, 1385, 1399–1400, 1407, 1422–1423, 1425–1426, 1429–1431, 1445–1446, 1453, 1468–1469, 1476, 1529–1530, 1639–1640, 1669–1670, 1723–1724, 1804–1805, 1955, 1960–1961, 1973–1974, 1989–1990, 2002–2003, 2012–2015, 2018, 2022–2025
   indexer_Position_Share.py90611787%94–95, 253, 450–451, 469–470, 533–534, 552–553, 617–618, 636–637, 702–703, 721–722, 807–808, 827–828, 865–866, 903–904, 941–942, 979–980, 1017–1018, 1030, 1044–1045, 1069–1070, 1077, 1094–1095, 1102, 1119–1120, 1144–1145, 1147–1148, 1151–1153, 1163, 1179–1180, 1238–1239, 1251, 1265–1266, 1273, 1288–1289, 1291–1292, 1295–1297, 1311–1312, 1319, 1372–1373, 1385, 1399–1400, 1407, 1422–1423, 1425–1426, 1429–1431, 1445–1446, 1453, 1468–1469, 1476, 1529–1530, 1639–1640, 1669–1670, 1723–1724, 1804–1805, 1955, 1960–1961, 1973–1974, 1989–1990, 2002–2003, 2012–2015, 2018, 2022–2025
   indexer_Transfer.py3115083%98, 118, 194–196, 252–256, 294, 369, 393–394, 459, 476–477, 527, 544–545, 595, 612–613, 631–632, 635–643, 646–657, 661–664
tests/batch
   indexer_Position_Bond_test.py9730100% 
   indexer_Position_Share_test.py9700100% 
   indexer_Transfer_test.py5950100% 
TOTAL44360157596% 

Tests Skipped Failures Errors Time
1485 0 💤 0 ❌ 0 🔥 13m 6s ⏱️

@YoshihitoAso
YoshihitoAso merged commit 349063e into dev-25.9 Jul 24, 2025
11 checks passed
@YoshihitoAso
YoshihitoAso deleted the feature/#1657 branch July 24, 2025 01:30
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.

[FEATURE] Remove deprecated "inheritance" message from Lock/Unlock events and Transfer Data

2 participants