feat: add TenantLedger model and query generation

- Introduced TenantLedger model with fields for managing tenant transactions, including ID, TenantID, UserID, OrderID, transaction Type, Amount, and balance details.
- Implemented CRUD operations for TenantLedger with methods for Create, Update, Delete, and Reload.
- Generated query methods for TenantLedger to facilitate database interactions, including filtering, pagination, and aggregation functions.
- Established relationships with Order model for foreign key references.
This commit is contained in:
2025-12-18 13:12:26 +08:00
parent f93caefcb2
commit 1da84f2af3
42 changed files with 6468 additions and 265 deletions

View File

@@ -32,6 +32,12 @@ field_type:
discount_type: consts.DiscountType
content_access:
status: consts.ContentAccessStatus
orders:
type: consts.OrderType
status: consts.OrderStatus
currency: consts.Currency
tenant_ledgers:
type: consts.TenantLedgerType
field_relate:
users:
OwnedTenant:
@@ -55,3 +61,30 @@ field_relate:
json: users
join_foreign_key: tenant_id
join_references: user_id
orders:
Items:
relation: has_many
table: order_items
json: items
foreign_key: order_id
references: id
order_items:
Order:
relation: belongs_to
table: orders
json: order
foreign_key: order_id
references: id
Content:
relation: belongs_to
table: contents
json: content
foreign_key: content_id
references: id
tenant_ledgers:
Order:
relation: belongs_to
table: orders
json: order
foreign_key: order_id
references: id