Life ConnectLife Connect
Wiki index
Architecture
Services
Concepts
Runbooks
Infra
Swagger Docs
GitHub
Wiki index
Architecture
Services
Concepts
Runbooks
Infra
Swagger Docs
GitHub
  • Archive
  • Data Dictionary
  • Functional Epics

    • DICTIONARY OF ATTRIBUTES
    • Search Condos
    • Display

      • DisplayAll

        • Display all - Contracts
        • Display all - invoices
        • Display all - parts
        • Display all - Persons Relationships
        • Display all - Persons
        • Display tickets
      • DisplayContract

        • Display bank account Contract
        • Display Condo Member Contract
        • Display contact contract
        • Display Employee Contract
        • Display Generic Contract
        • Display Insurance Contract
        • Display Legal Represent Contract
        • Display Oral Contract
        • Display Owner Contract
        • Display Condo Regulation Contract
        • Display rental Contract
        • Display Supplier Contract
        • Display Trustee Contract
      • DisplayDelegate

        • Display Delegate
      • DisplayHistory

        • Display history
      • DisplayPerson

        • Display Company Person
        • Display Condo Person
        • Display Division Person
        • Display Group Person
        • Display Indivision Person
        • Display Natural Person
        • Display Union Person
        • Display Unknown Person
      • DisplayPersonsContracts

        • Display all Interventions
      • DisplayProperty

        • Display part
        • Display part
      • UiPerson

        • Display "mini" Persons
    • Process

      • Create

        • Create property & condo
      • Delete

        • Delete objects according to state machine
      • RC Renewal

        • RC RESIDENTIAL - automatic renewal
      • Review

        • rent amount review - RC residential - creation
        • rent amount review - RC residential - take-over
      • Sell

        • Sell a unit
    • Reporting

      • GRR

        • GLOBAL RENT REPORT
    • Search

      • Search
    • StateMachine

      • CreatingContract

        • State machine - creating a rental contract
        • State machine - creating a rental delegate contract
        • State machine - Referencing a abstract part contract
        • State machine - Referencing a bank contract
        • State machine - Referencing a condo regulation contract
        • State machine - Referencing a contact contract
        • State machine - Referencing an employee contract
        • State machine - Referencing a generic contract
        • State machine - Referencing a legal represent contract
        • State machine - Referencing a owner contract
        • State machine - Referencing a rental contract
        • State machine - Referencing a supplier contract
        • State machine - Referencing a trustee contract
      • CreatingIntervention

        • State machine - creating a ticket
        • State machine - Referencing a message
      • CreatingInvoice

        • State machine - creating a incoming (supplier) invoice
      • CreatingPayments

        • State machine - creating an incoming payment
      • EncodingPart

        • CreatingPart

          • State machine - Referencing part relationships
          • State machine - Referencing a part
      • EncodingPerson

        • CreatingAddresses

          • State machine - Creating email address
          • State machine - Creating phone address
          • State machine - Creating postal address
          • State machine - Creating web address
        • CreatingPerson

          • State machine - Referencing a company person
          • State machine - Referencing a condo person
          • State machine - Referencing a division person
          • State machine - Referencing an group person
          • State machine - Referencing an indivision person
          • State machine - Referencing a natural person
          • State machine - Referencing a union person
        • CreatingShareHolders

          • State machine - valuing a shareholder
      • Scanning

        • State machine scanning - analyze a document
        • State machine scanning - matching a document
        • State machine scanning - encoding a document : related information
    • Utility

      • Allocation keys
      • Company settings
      • Document data & file
      • Revision Index
    • Validations

      • Shareholders validation
  • Implicit

    • Callback

      • Logging In
  • ProductBoard

    • Rental Process

      • Rental delegate process
    • Ticketing

      • Create a ticket - link a ticket in Outlook add-in - add a call - display a ticket
      • Display Person Info in Outlook add-in
  • Technical Epics

    • Indexation Feature Documentation
    • Rent Amount Management Feature Documentation
    • I have an API
    • I can store the balance of an account
    • I Have Person Notifications
    • 🧩 System Process Diagrams
    • The Team has a DEV environment
    • The Team is organized
    • Accounting

      • Re-generation of Invoices
      • I can call the rent for my Rental Contract
      • Payment Creation Strategy Feature Documentation
      • I Can Revese

        • Payment Reversal
      • I Have Invoices

        • I have direction on invoice's item level
      • I Have Subsidies

        • I Can Receive Family Allowance Payments - Technical Documentation
        • Subsidies + Direct Debit Documentation
    • Communication Module

      • Communication module
    • Contracts

      • I can have contract guarantors
      • API Models
      • I Have Call For Rent Process

        • Call For Rent (CFR) Process Documentation
      • Occupancy Compensation

        • **OCCUPANCY COMPENSATION Documentation**
      • State Machine

        • I can have the Rental Contract state machine
    • Database

      • Database Indexes
    • E2e Testing

      • I can create an E2E dataset
    • Env Setup

      • Adapt env to stateless UI build
      • Blockhound
      • Table of Environments and Their Specifications
      • Environment How-To
      • Java Flight Recorder Management Documentation
      • Local Environment Setup
      • Kubernetes Logs Retrieval Documentation
      • Monitoring
      • I can create a new organisation
      • Production Environment Configuration
      • Remote Environment Setup
      • Set up of separate DB for env
      • Terraform Aws S3 Buckets
      • adb-ui Service Version Update
    • Files

      • I can have tags for files
    • Globals

      • boundaries
      • boundaries
      • boundaries
      • boundaries
    • Messaging

      • MongoDB Trigger Model Documentation
    • Open Api

      • Swagger Documentation Guide
      • Swagger
    • Parts

      • I Have A Forecast And Actuals Module
      • I can have part equipments
    • Process

      • Pre-Meeting Questionnaire
      • I Can Release My Feature
    • Security

      • I can create and provision an organisation
      • a user is granted access to the application
    • Stress Test

      • Introduction
      • Reports

        • Introduction
        • Introduction
        • Introduction
        • Introduction
        • Introduction
        • Table of contents
    • Tickets

      • Ticket Details Functionality
    • Troubleshooting

      • Prometheus Memory Issue Handling
Last updated 2024-07-11⚠️ 1 year 11 months old — verify against current code before relying on details.

Indexation Feature Documentation

Overview

The indexation feature allows for the dynamic adjustment of rental prices based on changes in the Insee Index. This process involves updating rental contracts with new rent values as the index changes. Below is a detailed breakdown of the components involved and the flow of data.

Components

Database

  • Indexes Collection: Stores the Insee Indexes values.
  • Contracts Collection: Contains contracts with fields such as rentAmounts and nextExpectedIndexKey.

Messaging

  • MongoDB Trigger: Listens for changes in the Indexes collection and sends a message to the AWS SQS queue when a new index is published.

Services

  • adb-contracts: Processes messages from the SQS queue and updates rental contracts based on the new index values.

Process Flow

  1. Index Publication: A new index is published to the Indexes collection in the adb-utilities database.
  2. Trigger Activation: A MongoDB trigger detects the new index and sends a message to an AWS SQS queue.
  3. Message Processing: The adb-contracts service processes the message, finds rental contracts that need updating, and calculates the new rent values.
  4. Contract Update: The adb-contracts service updates the rentAmounts, indexes, nextExpectedIndexKey, nextExpectedRentReviewDate field in the relevant rental contracts.

Detailed Description

Database Level

  1. Indexes Collection

    • New indexes are added to this collection. The effectiveDate determines when the index becomes active.
  2. Contracts Collection

    • Fields: rentAmounts, nextExpectedIndexKey,
    • rentAmounts is an array that stores the base rental value and additional fees.
    • nextExpectedIndexKey indicates which index the contract is expecting next.

Messaging (Trigger and Queue)

  1. MongoDB Trigger

    • Monitors the Indexes collection for new entries.
    • On detecting a new index, the trigger sends a notification to an AWS SQS queue.
  2. AWS SQS Queue

    • Receives messages from the MongoDB trigger.
    • Messages contain details about the new index (e.g., indexValue, effectiveDate).

Services (adb-contracts)

  1. Index Processing

    • The adb-contracts service listens to the AWS SQS queue for new messages.
    • On receiving a message, it identifies rental contracts with nextExpectedIndexKey matching the new index.
  2. Rent Calculation

    • For each identified contract, the service determines the qualifier of the new Index (CURRENT or FUTURE).
    • The service calculates the new rent value based on the difference between the current and new index values.
    • The new rent value is appended to the rentAmounts array in the contract.

Gherkin Features

Feature: Indexation of Rental Contracts

  Scenario: Publish a new index
    Given a new index is published to the "Indexes Collection" in the "adb-utilities" database
    When the MongoDB trigger detects the new index
    Then a message is sent to the AWS SQS queue with details about the new index

  Scenario: Process new index message
    Given the "adb-contracts" service listens to the AWS SQS queue for new messages
    When a message about the new index is received
    Then the "adb-contracts" service identifies rental contracts with "nextExpectedIndexKey" matching the new index

  Scenario: Determine index qualifier
    Given the "adb-contracts" service identifies rental contracts with "nextExpectedIndexKey" matching the new index
    When the new index is processed
    Then the qualifier of the new index is determined for the identified contracts
    And the qualifier can be either "CURRENT" or "FUTURE"

  Scenario: Calculate new rent value
    Given the qualifier of the new index is "CURRENT"
    When the "adb-contracts" service calculates the new rent value based on the difference between the current and new index values
    Then the new rent value is appended to the "rentAmounts" array in the relevant rental contracts

  Scenario: Update rental contracts
    Given the "adb-contracts" service has calculated the new rent value
    When the new rent value is appended to the "rentAmounts" array in the relevant rental contracts
    Then the rental contracts are updated with the new rent values

PlantUML Diagrams

Sequence Diagram

sequence_diagram

Edit this page
Last Updated:
Contributors: Yevhenii Khudolii
Next
Rent Amount Management Feature Documentation