docs(auth): record vehicle grant interval release

This commit is contained in:
lingniu
2026-07-16 18:03:22 +08:00
parent ddc1bb2d96
commit 85de053962
3 changed files with 19 additions and 5 deletions

View File

@@ -30,6 +30,8 @@ Track, location-history and RAW queries are clamped to the exact active `valid_f
Saving an unchanged vehicle assignment preserves its original start time. Removing a vehicle closes the active history interval, and assigning it again creates a new interval. The current projection is deleted on removal so existing sessions fail closed after their short cache window.
Administrators manage `validFrom` and optional `validTo` per vehicle in account management. The API updates the active projection and its latest history interval in one transaction, validates `validTo > validFrom`, and repairs any pre-existing projection/history drift on save. The admin list reads the complete projection, including future or scheduled-to-end grants; customer principals still contain only grants active at the current database time. Each update audit stores the actor and per-VIN before/after interval.
## Sessions and password policy
- Passwords are stored with bcrypt cost 12.
@@ -68,7 +70,7 @@ POST /api/v2/admin/users
PUT /api/v2/admin/users/{id}
```
Customer creation/update accepts display name, optional external customer/tenant references, account status, menu keys and VINs. Username is immutable after creation. Password reset and account disable invalidate previous sessions.
Customer creation/update accepts display name, optional external customer/tenant references, account status, menu keys and `vehicleGrants[]` containing VIN, required enable time and optional disable time. The legacy `vehicleVins[]` field remains accepted for compatibility and preserves existing intervals. Username is immutable after creation. Password reset and account disable invalidate previous sessions.
## External identity migration