Lease in the leaseclock.com Admin
The Admin the platform derives for the Lease Noun of the leaseclock.com sample: columns, controls, related lists and actions, rule by rule.
The Admin is the App a Startup's own team works in. For the Lease Noun of the leaseclock.com sample it derives one list, one record page and two forms, each part by a named rule.
Definition
The Lease Noun of The leaseclock.com sample, and the Property Noun it points at.
---
extends: [Thing]
properties:
residentName: string
residentEmail?: email
listingUrl?: url
startsOn: date
endsOn: date
monthlyRent: number
status: active | renewed | terminated
notes?: text
terms?: json
documents?: string[]
property: Property
verbs:
renew: {}
terminate: {}
---
A Lease is one resident's agreement on one unit of a Property, from signing to renewal.---
properties:
name: string
address?: string
units: integer
---
A Property is one building a manager rents out, unit by unit.Projection
| Part | Value | Rule |
|---|---|---|
| Key | leases | key |
| Labels | Lease, Leases | labels |
| Screens | list, record page, create form, edit form | screens |
| Representation | residentName | representation |
| List columns | residentName, residentEmail, listingUrl, startsOn, endsOn, monthlyRent, status | list-columns |
| List search | one search box, always shown | list-search |
residentName represents a Lease on every screen that points at one. No field is named name, title, label, email or slug, and residentName is the first text field.
The list holds at most 7 columns, with properties before references. property is the eighth, so the list leaves it out.
Fields
| Field | Type | List | Record page | Form | Rule |
|---|---|---|---|---|---|
residentName | string, required | text | text | text input, required | control-text, required-input |
residentEmail | email | — | — | text input | control-text |
listingUrl | url | — | — | text input | control-text |
startsOn | date, required | date | date | date input, required | control-date, required-input |
endsOn | date, required | date | date | date input, required | control-date, required-input |
monthlyRent | number, required | number | number | number input, required | control-number, required-input |
status | active | renewed | terminated | text | text | text input | control-text |
notes | text | left out | long text, full width | multi-line text input | control-long-text, wide-fields, list-columns |
terms | json | left out | formatted JSON, full width | no input | control-json, wide-fields, list-columns |
documents | string[] | left out | text, values joined by commas | left out | control-text, list-columns, form-omits-arrays |
property | Property | left out, eighth column | the linked Property, by its name | autocomplete over Property records | reference-forward, list-columns |
Labels follow labels: monthlyRent reads Monthly Rent, and listingUrl reads Listing Url. A dash marks a part whose rule is not printable.
References
| Reference | Declared as | In the Admin | Rule |
|---|---|---|---|
property | property: Property | The record page links the Property by its name, and both forms pick one with an autocomplete. | reference-forward |
Property has a name property, so its name represents it in the reference cell and in the picker.
Actions
| Verb | Button | Where | Runs with | Rule |
|---|---|---|---|---|
Lease.renew | Renew | each list row, the record page, the edit form | the record, no inputs | verb-action |
Lease.terminate | Terminate | each list row, the record page, the edit form | the record, no inputs | verb-action |
The list gains one Actions column for the two buttons.
After a Verb succeeds, the Admin confirms it and reloads the record (verb-result). When Lease.renew is refused, the Admin shows the refusal's message and leaves the screen as it was (refusal-message).
Renderings
The Admin builds every Lease screen from one projection. Its JSON is the Lease entry of /app-projection/leaseclock.json, and the Markdown and JSON twins of the Lease page are lease.md and lease.json.
{
"noun": "Lease",
"key": "leases",
"label": { "one": "Lease", "many": "Leases" },
"representation": "residentName",
"screens": { "list": true, "record": true, "create": true, "edit": true },
"blocked": [],
"list": {
"columns": ["residentName", "residentEmail", "listingUrl", "startsOn", "endsOn", "monthlyRent", "status"],
"leftOut": ["notes", "terms", "documents", "property"],
"search": "q"
},
"fields": [
{ "name": "residentName", "label": "Resident Name", "kind": "text", "required": true, "form": true },
{ "name": "residentEmail", "label": "Resident Email", "required": false, "form": true },
{ "name": "listingUrl", "label": "Listing Url", "required": false, "form": true },
{ "name": "startsOn", "label": "Starts On", "kind": "date", "required": true, "form": true },
{ "name": "endsOn", "label": "Ends On", "kind": "date", "required": true, "form": true },
{ "name": "monthlyRent", "label": "Monthly Rent", "kind": "number", "required": true, "form": true },
{ "name": "status", "label": "Status", "kind": "text", "required": false, "form": true },
{ "name": "notes", "label": "Notes", "kind": "longText", "wide": true, "required": false, "form": true },
{ "name": "terms", "label": "Terms", "kind": "json", "wide": true, "required": false, "form": false },
{ "name": "documents", "label": "Documents", "kind": "text", "array": true, "required": false, "form": false },
{ "name": "property", "label": "Property", "kind": "reference", "to": "Property", "shows": "name", "required": false, "form": true }
],
"related": [],
"actions": [
{ "verb": "Lease.renew", "label": "Renew", "on": ["list", "record", "edit"], "inputs": {} },
{ "verb": "Lease.terminate", "label": "Terminate", "on": ["list", "record", "edit"], "inputs": {} }
]
}A field carries kind only where a printable rule sets it.
Captures
The capture manifest holds no capture of Lease.
Rules applied
| Rule | What it does | Status |
|---|---|---|
key | A Noun's key is its name in the plural, in lowercase words joined by hyphens. | proven |
labels | A label splits a name into capitalized words, singular and plural. | proven |
screens | Each Noun gets a list, a record page, a create form and an edit form. | proven |
representation | The first field named name, title, label, email or slug represents a record, else the first text field, else the id. | proven |
list-columns | The list shows up to 7 fields in declared order, properties first, never long text, JSON or arrays. | proven |
list-search | The list has one search box, always shown. | proven |
control-text | A string field, or one whose type has no rule of its own, edits in a one-line text input. | proven |
control-long-text | A text field shows as long text and edits in a multi-line input. | proven |
control-number | A number field shows as a number and edits in a number input. | proven |
control-date | A date, datetime or timestamp field shows as a date and edits in a date input. | proven |
control-json | A json field shows as formatted JSON and has no input. | proven |
wide-fields | Long text and JSON span the full width of the record page. | proven |
required-input | A required field refuses an empty value in both forms. | proven |
form-omits-arrays | Forms leave out every array field. | proven |
reference-forward | A relationship to another Noun shows that record by its representation and edits with an autocomplete. | proven |
verb-action | Each custom Verb is a button on each list row, the record page and the edit form. | proven |
verb-result | A Verb that completes shows a notice, then reloads the record. | proven |
refusal-message | A refused Verb shows its message and leaves the screen as it was. | proven |
Seven more rules apply to Lease and are not printable, so they render nothing here. What these pages hold counts them.
The leaseclock.com sample
The one sample definition on SaaS.Dev: leaseclock.com's Property and Lease Nouns, the Verbs renew and terminate, and an example Offer.
What these pages hold
How many records of each kind print on SaaS.Dev today, how many wait for code that serves them, and the gate that decides.