Background
The public_info endpoints still contain runtime guards for token_template and product_type combinations because the database schema and ORM typing do not encode those invariants. Public account responses also assume modified is present, but the shared base model still exposes it as nullable.
Description
Formalize the valid token_template and product_type combinations in the schema layer and reflect the same rules in ORM typing and response models. In parallel, decide whether public_account_list.modified should be guaranteed as non-null or explicitly allowed in the response contract, then align the router code so it no longer relies on ad hoc runtime guards.
Scope
- Add or update constraints for valid token_template and product_type combinations.
- Update TokenList and related public_info typing.
- Resolve the nullability contract for PublicAccountList.modified.
- Remove the runtime guard in public token listing once the schema guarantee exists.
- Add or update tests for share product types and public account serialization.
Background
The public_info endpoints still contain runtime guards for token_template and product_type combinations because the database schema and ORM typing do not encode those invariants. Public account responses also assume modified is present, but the shared base model still exposes it as nullable.
Description
Formalize the valid token_template and product_type combinations in the schema layer and reflect the same rules in ORM typing and response models. In parallel, decide whether public_account_list.modified should be guaranteed as non-null or explicitly allowed in the response contract, then align the router code so it no longer relies on ad hoc runtime guards.
Scope