-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Licence entity role to Has Many Relation (#1669)
https://eaflood.atlassian.net/browse/WATER-4879 As part of the work to show the "Primary user" and "Returns agent" in the licence contact details page. We noticed our previous assumption of a licence entity role having one relation was incorrect. A licence entity role can have many relations. This is commonly found when a licence entity role with a 'Primary user' also has a 'Returns agent' (know as a 'user'agent' in the db) This change updates the `licenceEntityRole` to `licenceEntityRoles` and updates any necessary code / tests that fail.
- Loading branch information
1 parent
82a3c82
commit 6c8f297
Showing
5 changed files
with
45 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,7 +71,7 @@ describe('View Licence presenter', () => { | |
|
||
describe('when the licence does not have a primary user (registered user)', () => { | ||
beforeEach(() => { | ||
licence.licenceDocumentHeader.licenceEntityRole = null | ||
licence.licenceDocumentHeader.licenceEntityRoles = [] | ||
}) | ||
|
||
it('returns "Unregistered licence"', () => { | ||
|
@@ -347,16 +347,18 @@ function _licence() { | |
licenceDocumentHeader: { | ||
id: 'e8f491f0-0c60-4083-9d41-d2be69f17a1e', | ||
licenceName: 'Between two ferns', | ||
licenceEntityRole: { | ||
id: 'd7eecfc1-7afa-49f7-8bef-5dc477696a2d', | ||
licenceEntity: { | ||
id: 'ba7702cf-cd87-4419-a04c-8cea4e0cfdc2', | ||
user: { | ||
id: 10036, | ||
username: '[email protected]' | ||
licenceEntityRoles: [ | ||
{ | ||
id: 'd7eecfc1-7afa-49f7-8bef-5dc477696a2d', | ||
licenceEntity: { | ||
id: 'ba7702cf-cd87-4419-a04c-8cea4e0cfdc2', | ||
user: { | ||
id: 10036, | ||
username: '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
licenceSupplementaryYears: [], | ||
workflows: [{ id: 'b6f44c94-25e4-4ca8-a7db-364534157ba7', status: 'to_setup' }] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,16 +101,18 @@ function _licence() { | |
licenceDocumentHeader: { | ||
id: 'e8f491f0-0c60-4083-9d41-d2be69f17a1e', | ||
licenceName: 'Between two ferns', | ||
licenceEntityRole: { | ||
id: 'd7eecfc1-7afa-49f7-8bef-5dc477696a2d', | ||
licenceEntity: { | ||
id: 'ba7702cf-cd87-4419-a04c-8cea4e0cfdc2', | ||
user: { | ||
id: 10036, | ||
username: '[email protected]' | ||
licenceEntityRoles: [ | ||
{ | ||
id: 'd7eecfc1-7afa-49f7-8bef-5dc477696a2d', | ||
licenceEntity: { | ||
id: 'ba7702cf-cd87-4419-a04c-8cea4e0cfdc2', | ||
user: { | ||
id: 10036, | ||
username: '[email protected]' | ||
} | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
licenceSupplementaryYears: [], | ||
workflows: [{ id: 'b6f44c94-25e4-4ca8-a7db-364534157ba7', status: 'to_setup' }] | ||
|