173 lines
2.1 KiB
Markdown
173 lines
2.1 KiB
Markdown
|
|
# DOMAIN_MODEL(领域模型)
|
|||
|
|
|
|||
|
|
## 核心实体
|
|||
|
|
|
|||
|
|
### Merchant(商户)
|
|||
|
|
- id
|
|||
|
|
- name
|
|||
|
|
- status(pending / active / inactive)
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
- contact_person
|
|||
|
|
- contact_email
|
|||
|
|
- contact_phone
|
|||
|
|
- address
|
|||
|
|
- business_type(B2B / B2C)
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### User(用户)
|
|||
|
|
- id
|
|||
|
|
- merchant_id
|
|||
|
|
- role(admin / operator / viewer)
|
|||
|
|
- status
|
|||
|
|
- username
|
|||
|
|
- email
|
|||
|
|
- password_hash
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Store(店铺)
|
|||
|
|
- id
|
|||
|
|
- merchant_id
|
|||
|
|
- name
|
|||
|
|
- platform
|
|||
|
|
- platform_shop_id
|
|||
|
|
- description
|
|||
|
|
- status
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Feature(功能)
|
|||
|
|
- code
|
|||
|
|
- name
|
|||
|
|
- price_type(free / paid)
|
|||
|
|
- price_value
|
|||
|
|
- description
|
|||
|
|
- category
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### MerchantFeature(商户功能)
|
|||
|
|
- id
|
|||
|
|
- merchant_id
|
|||
|
|
- feature_code
|
|||
|
|
- status(inactive / pending_payment / active / expired)
|
|||
|
|
- expire_at
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Order(订单)
|
|||
|
|
- id
|
|||
|
|
- user_id
|
|||
|
|
- merchant_id
|
|||
|
|
- total_amount
|
|||
|
|
- status(pending / paid / split / shipped / completed / refunded)
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
- shipping_address
|
|||
|
|
- payment_method
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### SubOrder(子订单)
|
|||
|
|
- id
|
|||
|
|
- order_id
|
|||
|
|
- merchant_id
|
|||
|
|
- store_id
|
|||
|
|
- amount
|
|||
|
|
- status
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Product(商品)
|
|||
|
|
- id
|
|||
|
|
- merchant_id
|
|||
|
|
- store_id
|
|||
|
|
- name
|
|||
|
|
- sku
|
|||
|
|
- price
|
|||
|
|
- stock
|
|||
|
|
- status
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Inventory(库存)
|
|||
|
|
- id
|
|||
|
|
- product_id
|
|||
|
|
- merchant_id
|
|||
|
|
- warehouse_id
|
|||
|
|
- quantity
|
|||
|
|
- status
|
|||
|
|
- last_sync_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Payment(支付)
|
|||
|
|
- id
|
|||
|
|
- merchant_id
|
|||
|
|
- amount
|
|||
|
|
- status(created / paid / failed)
|
|||
|
|
- type(feature / order)
|
|||
|
|
- payment_method
|
|||
|
|
- transaction_id
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Bill(账单)
|
|||
|
|
- id
|
|||
|
|
- merchant_id
|
|||
|
|
- type(income / expense)
|
|||
|
|
- amount
|
|||
|
|
- status(pending / confirmed / settled)
|
|||
|
|
- source_type(order / feature)
|
|||
|
|
- source_id
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Permission(权限)
|
|||
|
|
- id
|
|||
|
|
- role
|
|||
|
|
- resource
|
|||
|
|
- action
|
|||
|
|
- created_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Settlement(结算)
|
|||
|
|
- id
|
|||
|
|
- merchant_id
|
|||
|
|
- total_amount
|
|||
|
|
- platform_fee
|
|||
|
|
- net_amount
|
|||
|
|
- status
|
|||
|
|
- period_start
|
|||
|
|
- period_end
|
|||
|
|
- created_at
|
|||
|
|
- updated_at
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Analytics(数据分析)
|
|||
|
|
- id
|
|||
|
|
- merchant_id
|
|||
|
|
- report_type
|
|||
|
|
- data
|
|||
|
|
- generated_at
|
|||
|
|
- period_start
|
|||
|
|
- period_end
|