Skip to content

[REFACTOR] Encode public info schema invariants in the database and typing #1798

Description

@purplesmoke05

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions