Mounting the App
Tutorial 7 of 12 mounts Leaseline's portal App over the lease Noun, with what each persona may do and one view override.
An App is an Interface over the Nouns, so its screens derive from them. Leaseline declares a Lease Noun, and the portal gives managers and residents their own screens.
What you build
You mount apps/ at /app with two Personas: managers run every Verb, residents read and answer. Then you override one screen, the lease detail.
Steps
To mount the App, write its folder file:
apps/portal/app.mdx --- kind: saas mount: /app nouns: [Lease] personas: manager: { may: [Lease.create, Lease.renew, Lease.notify] } resident: { may: [Lease.get] } ---To open the screens it derived, visit the preview at
/app/, then one lease, thenleases /app/.leases/ lease_4loEed1JG4/ renew To change the lease screen, write a view at its path:
apps/portal/leases/[lease]/view.mdx --- personas: [manager] --- <ThingDetail /> <Timeline /> <VerbSheet verb="Lease.renew" /> <VerbSheet verb="Lease.notify" />In a view,
ThingDetailandTimelineshow the record its route names. EachVerbSheetturns one Verb into fields and a button, with its Mode, its Price and any Approval it needs.
Result
The portal serves a list and a record screen for leases and a form for each Verb, and residents see only what they may read. The view override replaced one screen and left the rest derived. Checkpoint leaseline@ch07 (status planned) adds apps/.
Next steps
- Tutorial 8 sends the notice without anyone clicking.
- Apps and views: the full contracts.