DrivingLicenceNumber
A driving licence's number with the country that issued it: the number upper case with no spaces, in that country's form where it publishes one, MCADI801206HZ9HM for Great Britain. Shown masked to its last four. Personal data.
Tax and identity numbers; not ordered; since Jadpo 0.1.0.
Make one
Build one from its fields, DrivingLicenceNumber { country: ... number: ... }.
Its parts keep these rules; a value that breaks one fails with the rule's name:
number_of_country:number is in the form of its country's numbers
Fields
| Field | Type |
|---|---|
country |
Country |
number |
Text |
Text, JSON and storage
It has no single text form, so text.from and text.parse don't take it. JSON sends an object of its parts.
| JSON |
|---|
{"country":"GB","number":"MCADI801206HZ9HM"} |
{"country":"US","number":"D1234567"} |
It is stored in 2 columns, each named for the field, _ and its suffix. This is {"country":"US","number":"D1234567"}:
| Column | Type | Holds |
|---|---|---|
<field>_country |
text |
'US' |
<field>_number |
text |
'D1234567' |
Shown to people
text.format(value, locale:) shows it to people in their locale.
With locale: Locale.en_gb:
| Value | Shown |
|---|---|
{"country":"GB","number":"MCADI801206HZ9HM"} |
•••• Z9HM |
{"country":"US","number":"D1234567"} |
•••• 4567 |
Operations
It has the contract's own operations: text.format, json.read, json.write and ==. It isn't ordered, so < and sorting don't take it. Every standard type meets one contract says how they work.
Markdown for agents: /docs/types/type-driving-licence-number.md.Built from Jadpo main at e00e61f.