Skip to content

Create lease ​

Create Lease page screenshot

Overview ​

The creation route renders the lease wizard for entering lease data.

  • Route: /leases/create (protected)
  • Source: front/src/pages/CreateLease.tsx
  • Layout: DashboardLayout
  • Main component: front/src/components/forms/LeaseWizard.tsx

User actions and data flow ​

The wizard presents six steps: Basic Information, Lease Terms, Payment Details, Cost Components, Discounting, and Review & Confirm. Inputs are held in wizard component state and step validation is implemented in the wizard. During initialization, it requests user settings. The steps load entities/departments as required by form selection. On the Review & Confirm step, ReviewConfirmStep calls the backend preview when form data changes and renders returned total payments, lease liability, ROU asset, and interest expense.

On submission, the wizard uses the lease service to create the lease. Payment-band validation and schedule preview logic are present in the form/utilities. Exact backend validation and calculated response schema are not available from the frontend source code.

APIs and states ​

  • GET /settings for configured defaults.
  • Entity and department lookups from entityService / departmentService.
  • POST /leases with LeaseFormData on confirmed creation.
  • POST /leases/calculate-preview is invoked by ReviewConfirmStep when its formData effect runs.
  • The wizard tracks its active step and submission loading state. More detailed error presentation should be checked in the current page/component implementation.

Source: front/src/pages/CreateLease.tsx, front/src/components/forms/LeaseWizard.tsx, front/src/utils/paymentBands.ts.

See Lease API and Component overview.