feat: add GORM integration with repository pattern

- Add GORM models in models/ directory with proper column tags
- Create repository interfaces and implementations in core/repository/
- Add database package with MySQL and SQLite support
- Add UUID ID utility for GORM models
- Implement complete repository layer replacing SQL-based data access
- Add database migrations and index creation
- Support both MySQL and SQLite drivers with auto-migration

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-06-30 22:07:51 +12:00
parent e865c4c1a2
commit bd3f101fb4
19 changed files with 1467 additions and 0 deletions

17
models/split.go Normal file
View File

@@ -0,0 +1,17 @@
package models
// Split represents a single entry in a transaction
type Split struct {
ID uint `gorm:"primaryKey;autoIncrement"`
TransactionID []byte `gorm:"column:transactionId;type:BINARY(16);not null"`
AccountID []byte `gorm:"column:accountId;type:BINARY(16);not null"`
Date uint64 `gorm:"column:date;not null"`
Inserted uint64 `gorm:"column:inserted;not null"`
Updated uint64 `gorm:"column:updated;not null"`
Amount int64 `gorm:"column:amount;not null"`
NativeAmount int64 `gorm:"column:nativeAmount;not null"`
Deleted bool `gorm:"column:deleted;default:false"`
Transaction Transaction `gorm:"foreignKey:TransactionID"`
Account Account `gorm:"foreignKey:AccountID"`
}