@defra-fish/connectors-lib 1.77.0-rc.2 → 1.77.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra-fish/connectors-lib",
3
- "version": "1.77.0-rc.2",
3
+ "version": "1.77.0-rc.3",
4
4
  "description": "Shared connectors",
5
5
  "type": "module",
6
6
  "engines": {
@@ -47,5 +47,5 @@
47
47
  "node-fetch": "2.7.0",
48
48
  "redlock": "4.2.0"
49
49
  },
50
- "gitHead": "d473c2103570546d9096bffc5bf3ba13909e6a3e"
50
+ "gitHead": "fa97e97564ae1c2a49ffb2671f690f4328205942"
51
51
  }
@@ -872,8 +872,8 @@ describe('rcp authentication', () => {
872
872
 
873
873
  describe('getLicenceDetails', () => {
874
874
  it.each([
875
- { firstName: 'Gandalf', lastName: 'Grey', birthDate: '2000-10-03', postcode: 'AB123CD' },
876
- { firstName: 'Bilbo', lastName: 'Baggins', birthDate: '1995-04-15', postcode: 'BS9 4PT' }
875
+ { firstName: 'Gandalf', lastName: 'Grey', birthDate: '2000-10-03', premises: '59', postcode: 'AB123CD' },
876
+ { firstName: 'Bilbo', lastName: 'Baggins', birthDate: '1995-04-15', premises: 'Bag End', postcode: 'BS9 4PT' }
877
877
  ])('retrieves the licence details payload returned by the Sales API for %p', async licensee => {
878
878
  const expectedResponse = { licences: [{ some: 'data' }] }
879
879
  fetch.mockReturnValueOnce({ ok: true, status: 200, statusText: 'OK', text: async () => JSON.stringify(expectedResponse) })
@@ -882,14 +882,14 @@ describe('getLicenceDetails', () => {
882
882
 
883
883
  it.each([
884
884
  {
885
- input: { firstName: 'Gandalf', lastName: 'Grey', birthDate: '2000-10-03', postcode: 'AB123CD' },
885
+ input: { firstName: 'Gandalf', lastName: 'Grey', birthDate: '2000-10-03', premises: '59', postcode: 'AB123CD' },
886
886
  expectedUrl:
887
- 'http://0.0.0.0:4000/licenceDetails?licenseeFirstName=Gandalf&licenseeLastName=Grey&licenseePostcode=AB123CD&licenseeBirthDate=2000-10-03'
887
+ 'http://0.0.0.0:4000/licenceDetails?licenseeFirstName=Gandalf&licenseeLastName=Grey&licenseePremises=59&licenseePostcode=AB123CD&licenseeBirthDate=2000-10-03'
888
888
  },
889
889
  {
890
- input: { firstName: 'Bilbo', lastName: 'Baggins', birthDate: '1995-04-15', postcode: 'BS9 4PT' },
890
+ input: { firstName: 'Bilbo', lastName: 'Baggins', birthDate: '1995-04-15', premises: 'Bag End', postcode: 'BS9 4PT' },
891
891
  expectedUrl:
892
- 'http://0.0.0.0:4000/licenceDetails?licenseeFirstName=Bilbo&licenseeLastName=Baggins&licenseePostcode=BS9%204PT&licenseeBirthDate=1995-04-15'
892
+ 'http://0.0.0.0:4000/licenceDetails?licenseeFirstName=Bilbo&licenseeLastName=Baggins&licenseePremises=Bag%20End&licenseePostcode=BS9%204PT&licenseeBirthDate=1995-04-15'
893
893
  }
894
894
  ])('calls fetch with the name, postcode and date of birth as query parameters for %p', async ({ input, expectedUrl }) => {
895
895
  fetch.mockReturnValueOnce({
@@ -910,7 +910,7 @@ describe('getLicenceDetails', () => {
910
910
  text: async () => JSON.stringify({ error: 'Description' })
911
911
  })
912
912
  await expect(
913
- salesApi.getLicenceDetails({ firstName: 'Gandalf', lastName: 'Grey', birthDate: '2000-10-03', postcode: 'AB123CD' })
913
+ salesApi.getLicenceDetails({ firstName: 'Gandalf', lastName: 'Grey', birthDate: '2000-10-03', premises: '59', postcode: 'AB123CD' })
914
914
  ).resolves.toBeNull()
915
915
  })
916
916
  })
@@ -358,16 +358,18 @@ export const retrieveStagedTransaction = async id => {
358
358
  * @param {string} firstName
359
359
  * @param {string} lastName
360
360
  * @param {string} birthDate
361
+ * @param {string} premises
361
362
  * @param {string} postcode
362
363
  * @returns {Promise<*>}
363
364
  */
364
- export const getLicenceDetails = async ({ firstName, lastName, birthDate, postcode }) =>
365
+ export const getLicenceDetails = async ({ firstName, lastName, birthDate, premises, postcode }) =>
365
366
  exec2xxOrNull(
366
367
  call(
367
368
  new URL(
368
369
  `/licenceDetails?${querystring.stringify({
369
370
  licenseeFirstName: firstName,
370
371
  licenseeLastName: lastName,
372
+ licenseePremises: premises,
371
373
  licenseePostcode: postcode,
372
374
  licenseeBirthDate: birthDate
373
375
  })}`,