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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user