sageapi/models/customer_balance.json
Hermes Agent 5c65c78752 feat: sageapi initial scaffold
- 36 files: module structure following module-development-spec
- 7 table definitions: users_cache, pricing_cache, llmage_cache, uapi_cache, sync_state, customer_balance, accounting_records
- Auth: dapi_auth + uapi_sign
- Sync: base_sync + entity-specific sync modules (users/pricing/uapi/llmage)
- Cache: LRU cache manager with TTL
- API: balance, accounting, users, pricing, health handlers
- Config: YAML config loader with env overrides
- Utils: HTTP client, crypto helpers
2026-05-20 17:53:53 +08:00

92 lines
1.8 KiB
JSON

{
"summary": [
{
"name": "customer_balance",
"title": "客户余额缓存",
"primary": "id",
"classification": "cache"
}
],
"fields": [
{
"name": "id",
"type": "VARCHAR(32)",
"nullable": false,
"default": "",
"comment": "主键,即 customer_id"
},
{
"name": "balance",
"type": "DECIMAL(15,4)",
"nullable": false,
"default": 0.0,
"comment": "当前余额"
},
{
"name": "currency",
"type": "VARCHAR(8)",
"nullable": false,
"default": "CNY",
"comment": "货币单位"
},
{
"name": "credit_limit",
"type": "DECIMAL(15,4)",
"nullable": true,
"default": null,
"comment": "信用额度"
},
{
"name": "last_recharge",
"type": "DATETIME",
"nullable": true,
"default": null,
"comment": "最后充值时间"
},
{
"name": "last_consumption",
"type": "DATETIME",
"nullable": true,
"default": null,
"comment": "最后消费时间"
},
{
"name": "status",
"type": "VARCHAR(16)",
"nullable": false,
"default": "active",
"comment": "状态: active/suspended/arrears"
},
{
"name": "sync_version",
"type": "VARCHAR(32)",
"nullable": true,
"default": "",
"comment": "同步版本号"
},
{
"name": "cached_at",
"type": "DATETIME",
"nullable": false,
"default": "CURRENT_TIMESTAMP",
"comment": "缓存更新时间"
}
],
"idxfields": [
{
"name": "idx_status",
"fields": [
"status"
],
"unique": false
},
{
"name": "idx_balance",
"fields": [
"balance"
],
"unique": false
}
],
"codes": []
}