SaaS.Dev

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.

nouns/Lease.mdx
---
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.
nouns/Property.mdx
---
properties:
  name: string
  address?: string
  units: integer
---
A Property is one building a manager rents out, unit by unit.

Projection

PartValueRule
Keyleaseskey
LabelsLease, Leaseslabels
Screenslist, record page, create form, edit formscreens
RepresentationresidentNamerepresentation
List columnsresidentName, residentEmail, listingUrl, startsOn, endsOn, monthlyRent, statuslist-columns
List searchone search box, always shownlist-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

FieldTypeListRecord pageFormRule
residentNamestring, requiredtexttexttext input, requiredcontrol-text, required-input
residentEmailemail——text inputcontrol-text
listingUrlurl——text inputcontrol-text
startsOndate, requireddatedatedate input, requiredcontrol-date, required-input
endsOndate, requireddatedatedate input, requiredcontrol-date, required-input
monthlyRentnumber, requirednumbernumbernumber input, requiredcontrol-number, required-input
statusactive | renewed | terminatedtexttexttext inputcontrol-text
notestextleft outlong text, full widthmulti-line text inputcontrol-long-text, wide-fields, list-columns
termsjsonleft outformatted JSON, full widthno inputcontrol-json, wide-fields, list-columns
documentsstring[]left outtext, values joined by commasleft outcontrol-text, list-columns, form-omits-arrays
propertyPropertyleft out, eighth columnthe linked Property, by its nameautocomplete over Property recordsreference-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

ReferenceDeclared asIn the AdminRule
propertyproperty: PropertyThe 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

VerbButtonWhereRuns withRule
Lease.renewReneweach list row, the record page, the edit formthe record, no inputsverb-action
Lease.terminateTerminateeach list row, the record page, the edit formthe record, no inputsverb-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.

/app-projection/leaseclock.json#Lease
{
  "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

RuleWhat it doesStatus
keyA Noun's key is its name in the plural, in lowercase words joined by hyphens.proven
labelsA label splits a name into capitalized words, singular and plural.proven
screensEach Noun gets a list, a record page, a create form and an edit form.proven
representationThe first field named name, title, label, email or slug represents a record, else the first text field, else the id.proven
list-columnsThe list shows up to 7 fields in declared order, properties first, never long text, JSON or arrays.proven
list-searchThe list has one search box, always shown.proven
control-textA string field, or one whose type has no rule of its own, edits in a one-line text input.proven
control-long-textA text field shows as long text and edits in a multi-line input.proven
control-numberA number field shows as a number and edits in a number input.proven
control-dateA date, datetime or timestamp field shows as a date and edits in a date input.proven
control-jsonA json field shows as formatted JSON and has no input.proven
wide-fieldsLong text and JSON span the full width of the record page.proven
required-inputA required field refuses an empty value in both forms.proven
form-omits-arraysForms leave out every array field.proven
reference-forwardA relationship to another Noun shows that record by its representation and edits with an autocomplete.proven
verb-actionEach custom Verb is a button on each list row, the record page and the edit form.proven
verb-resultA Verb that completes shows a notice, then reloads the record.proven
refusal-messageA 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.

Contents