Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LicenceEntityModel #690

Merged
merged 7 commits into from
Jan 27, 2024
Merged

Add LicenceEntityModel #690

merged 7 commits into from
Jan 27, 2024

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-4324

This is part of a series of changes to allow us to replace the legacy view licence page

When viewing a licence using the legacy water-abstraction-ui the page will display information on who the registered user is.

The registered is an external user who has declared that they manage the licence via the external UI. They are not the licence holder, just the person declared to be responsible for managing it.

Unfortunately, this functionality dates from the very start of the service and the data is in one of the oldest legacy schemas; crm. It seems this was one of the things which the previous team never managed to migrate to crm_v2, their intended better CRM structure.

We are expected to show this information in the licence view so we need to create some new models. The first of these is LicenceEntityModel, which is based on crm.entity and just holds a name and type.

https://eaflood.atlassian.net/browse/WATER-4324

> This is part of a series of changes to allow us to replace the legacy view licence page

When viewing a licence using the [legacy water-abstraction-ui](https://github.com/DEFRA/water-abstraction-ui) the page will display information on who the registered user is.

The registered is an external user who has declared that they manage the licence via the external UI. They are not the licence holder, just the person declared to be responsible for managing it.

Unfortunately, this functionality dates from the very start of the service and the data is in one of the oldest legacy schemas; `crm`. It seems this was one of the things which the previous team never managed to migrate to `crm_v2`, their intended better CRM structure.

We are expected to show this information in the licence view so we need to create some new models. The first of these is `LicenceEntityModel`, which is based on `crm.entity` and just holds a name and type.
@Cruikshanks Cruikshanks added the enhancement New feature or request label Jan 27, 2024
@Cruikshanks Cruikshanks self-assigned this Jan 27, 2024
@Cruikshanks Cruikshanks marked this pull request as ready for review January 27, 2024 13:15
@Cruikshanks Cruikshanks merged commit 0e445c6 into main Jan 27, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the add-crm-entity-model branch January 27, 2024 13:15
Cruikshanks added a commit that referenced this pull request Jan 27, 2024
> This is part of a series of changes to allow us to replace the legacy view licence page

When viewing a licence using the [legacy water-abstraction-ui](https://github.com/DEFRA/water-abstraction-ui) the page will display information on who the registered user is.

The registered is an external user who has declared that they manage the licence via the external UI. They are not the licence holder, just the person declared to be responsible for managing it.

Unfortunately, this functionality dates from the very start of the service and the data is in one of the oldest legacy schemas; `crm`. It seems this was one of the things which the previous team never managed to migrate to `crm_v2`, their intended better CRM structure.

We are expected to show this information in the licence view so we need to create some new models. The first of these was  [LicenceEntityModel](#690), which is based on `crm.entity` and just holds a name and type.

The second is `LicenceEntityRoleModel`, which is based on `crm.entity_roles`. It appears to just be a joining table between `crm.entity` and `crm.roles`. But we need it because it identifies which `crm.entity` has the role of 'primary_user'.
Cruikshanks added a commit that referenced this pull request Jan 27, 2024
In creating `LicenceEntityRole` we spotted that the ID is not automatically generated. When we checked back on `LegacyEntity` we found the same. So, this change corrects what we've just done in [Add LicenceEntityModel](#690).
Cruikshanks added a commit that referenced this pull request Jan 27, 2024
In creating `LicenceEntityRole` we spotted that the ID is not automatically generated. When we checked back on `LegacyEntity` we found the same.

We also spotted that though we can see UUID's have been used for both tables ID columns the type is just 'string'.

So, this change corrects what we've just done in [Add LicenceEntityModel](#690).
Cruikshanks added a commit that referenced this pull request Jan 27, 2024
https://eaflood.atlassian.net/browse/WATER-4324

> This is part of a series of changes to allow us to replace the legacy view licence page

When viewing a licence using the [legacy water-abstraction-ui](https://github.com/DEFRA/water-abstraction-ui) the page will display information on who the registered user is.

The registered is an external user who has declared that they manage the licence via the external UI. They are not the licence holder, just the person declared to be responsible for managing it.

Unfortunately, this functionality dates from the very start of the service and the data is in one of the oldest legacy schemas; `crm`. It seems this was one of the things which the previous team never managed to migrate to `crm_v2`, their intended better CRM structure.

We are expected to show this information in the licence view so we need to create some new models. The first of these was  [LicenceEntityModel](#690), which is based on `crm.entity` and just holds a name and type.

The second is `LicenceEntityRoleModel`, which is based on `crm.entity_roles`. It appears to just be a joining table between `crm.entity` and `crm.roles`. But we need it because it identifies which `crm.entity` has the role of 'primary_user'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant