A scalar document file is optional. Add it when a scalar value needs a small method that reads its own fields and returns a useful result.
If the scalar only needs fields and labels, the constant and dictionary files may be enough.
Basic Wrapper
Import the constant file as `cnst`, then wrap the constant class with `by(cnst.Price)`. This gives the document class the same fields as the constant class.
price.document.ts
Small Helper Example
A useful scalar document method is usually short. It reads the scalar fields and returns a display value, boolean, or small calculated result.
price.document.ts
When To Use It
Use a scalar document method when the same display or calculation appears in multiple places. For example, `Price.getLabel()` can be reused in product cards, order summaries, and invoices.
Good: formatting a price label from `amount` and `currency`.
Good: summarizing an address from `city` and `street`.
Avoid: loading other records or calling a backend service from the scalar method.