# V1 / V2 Operating Notes

## Current operating model
RBE is delivered with both V1 and V2 because the current working environment uses both versions side by side.

V1 remains the normal/legacy entry application and contains dashboards and functionality still used in the current environment. From V1, the dashboard banner/button links users into V2.

The bridge target is controlled by `RBE_V2_BASE_URL` rather than a hard-coded MY.TOWN hostname.

## Shared authentication/session model
Both V1 and V2 use the same standalone RBE database identity data:

- `rbe_users` contains the RBE user/profile and password hash fields.
- `rbe_roles` contains the user's RBE role.
- the same user ID is used by both applications.

V1 and V2 are designed to share the same PHP session when they are hosted below a common parent domain. The `.user.ini` files contain a placeholder shared session cookie domain that must be replaced by RBE's developer.

Example production-style arrangement:

- V1: `https://legacy.example-rbe-domain.tld`
- V2: `https://app.example-rbe-domain.tld`
- shared session cookie domain: `.example-rbe-domain.tld`

The exact hostnames are RBE's choice. They must share a parent cookie domain if the existing seamless V1-to-V2 session behaviour is required.

## V1 to V2 bridge
The bridge URL is read from `RBE_V2_BASE_URL` in the central configuration. The V1 dashboards use this value to build the new-app link.

Do not hard-code the old MY.TOWN hostnames back into the application.

## Roles
The existing RBE roles are:

- `admin`
- `landlord`
- `tenant`
- `agent`

The current application uses `admin` as the highest administrative application role. There is no separate `super_admin` role in the delivered schema.
