Refactor order and tenant ledger models to use consts for Currency and Type fields; add new UserStatus values; implement comprehensive test cases for content, creator, order, super, and wallet services.
This commit is contained in:
@@ -27,6 +27,7 @@ field_type:
|
||||
orders:
|
||||
status: consts.OrderStatus
|
||||
type: consts.OrderType
|
||||
currency: consts.Currency
|
||||
snapshot: types.JSONType[fields.OrdersSnapshot]
|
||||
order_items:
|
||||
snapshot: types.JSONType[fields.OrderItemsSnapshot]
|
||||
@@ -35,9 +36,49 @@ field_type:
|
||||
config: types.JSONType[fields.TenantConfig]
|
||||
tenant_users:
|
||||
role: types.Array[consts.TenantUserRole]
|
||||
status: consts.UserStatus
|
||||
content_assets:
|
||||
role: consts.ContentAssetRole
|
||||
media_assets:
|
||||
meta: types.JSONType[fields.MediaAssetMeta]
|
||||
type: consts.MediaAssetType
|
||||
status: consts.MediaAssetStatus
|
||||
variant: consts.MediaAssetVariant
|
||||
content_access:
|
||||
status: consts.ContentAccessStatus
|
||||
tenant_ledgers:
|
||||
type: consts.TenantLedgerType
|
||||
field_relate:
|
||||
contents:
|
||||
Author:
|
||||
relation: belongs_to
|
||||
table: users
|
||||
foreign_key: user_id
|
||||
references: id
|
||||
json: author
|
||||
ContentAssets:
|
||||
relation: has_many
|
||||
table: content_assets
|
||||
foreign_key: content_id
|
||||
references: id
|
||||
json: content_assets
|
||||
Comments:
|
||||
relation: has_many
|
||||
table: comments
|
||||
foreign_key: content_id
|
||||
references: id
|
||||
json: comments
|
||||
comments:
|
||||
User:
|
||||
relation: belongs_to
|
||||
table: users
|
||||
foreign_key: user_id
|
||||
references: id
|
||||
json: user
|
||||
content_assets:
|
||||
Asset:
|
||||
relation: belongs_to
|
||||
table: media_assets
|
||||
foreign_key: asset_id
|
||||
references: id
|
||||
json: asset
|
||||
|
||||
Reference in New Issue
Block a user