Skip to content

[Do NOT Merge] For review only: Lease Extension#63

Open
hkir-dev wants to merge 1 commit intomainfrom
lease_phase2_ext
Open

[Do NOT Merge] For review only: Lease Extension#63
hkir-dev wants to merge 1 commit intomainfrom
lease_phase2_ext

Conversation

@hkir-dev
Copy link

This pull request uses leasesext collection that contains pre-calculated lease terms and location information.

Backend Integration of Lease Extension Data:

  • Added a new Mongoose model LeaseExt (models/LeaseExt.js) to store extension data for leases, including fields for start_date, expiry_date, and tenure_years, along with virtuals for formatted display and a static method for remapping data.
  • Updated the show controller in Lease.js to fetch related LeaseExt data for each lease, merge it into the main lease objects, and expose the additional fields (Start Date, Expiry Date, Tenure Years) for use in the frontend.

Frontend Improvements for Lease Details:

  • Modified the lease details view (lease-details.ejs) to include the Expiry Date as a data attribute in the lease accordion, enabling direct access to pre-calculated expiry information in the DOM.
  • Enhanced the client-side script in lease-details.ejs to use the pre-calculated expiry date (when available) for displaying the remaining lease term, falling back to the old calculation method only if extension data is not present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant