Skip to content

Commit

Permalink
Revert last 32 commits
Browse files Browse the repository at this point in the history
  • Loading branch information
lailien3 committed Feb 3, 2025
1 parent d216fff commit 36fdd9a
Show file tree
Hide file tree
Showing 65 changed files with 407 additions and 214,104 deletions.
127 changes: 0 additions & 127 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,131 +1,4 @@

## v1.59.0-rc.3 (2025-01-31)

#### :rocket: Enhancement
* `gafl-webapp-service`
* [#2116](https://github.com/DEFRA/rod-licensing/pull/2116) Licence selection new content update ([@lailien3](https://github.com/lailien3))

#### Committers: 1
- laila aleissa ([@lailien3](https://github.com/lailien3))

## v1.59.0-rc.2 (2025-01-31)

#### :rocket: Enhancement
* `gafl-webapp-service`
* [#2108](https://github.com/DEFRA/rod-licensing/pull/2108) Date validation easy renewals ([@ScottDormand96](https://github.com/ScottDormand96))

#### Committers: 1
- Scott Dormand ([@ScottDormand96](https://github.com/ScottDormand96))

## v1.59.0-rc.1 (2025-01-31)

#### :rocket: Enhancement
* `sales-api-service`
* [#2113](https://github.com/DEFRA/rod-licensing/pull/2113) Validate RP Request ([@jaucourt](https://github.com/jaucourt))

#### Committers: 1
- Phil Benson ([@jaucourt](https://github.com/jaucourt))

## v1.59.0-rc.0 (2025-01-31)

#### :rocket: Enhancement
* `dynamics-lib`, `sales-api-service`
* [#2080](https://github.com/DEFRA/rod-licensing/pull/2080) Easy renewal query ([@ScottDormand96](https://github.com/ScottDormand96))

#### Committers: 1
- Scott Dormand ([@ScottDormand96](https://github.com/ScottDormand96))


## v1.58.0-rc.13 (2025-01-22)

#### :rocket: Enhancement
* `recurring-payments-job`
* [#2112](https://github.com/DEFRA/rod-licensing/pull/2112) Get id from payment creation request ([@ScottDormand96](https://github.com/ScottDormand96))

#### Committers: 1
- Scott Dormand ([@ScottDormand96](https://github.com/ScottDormand96))

## v1.58.0-rc.12 (2025-01-20)

#### :rocket: Enhancement
* `gafl-webapp-service`
* [#2111](https://github.com/DEFRA/rod-licensing/pull/2111) Check recurring status based on transaction ([@irisfaraway](https://github.com/irisfaraway))

#### Committers: 1
- Iris Faraway ([@irisfaraway](https://github.com/irisfaraway))

## v1.58.0-rc.11 (2025-01-16)

#### :rocket: Enhancement
* `recurring-payments-job`
* [#2109](https://github.com/DEFRA/rod-licensing/pull/2109) Recurring payment job sends payment requests to GOV.UK Pay ([@irisfaraway](https://github.com/irisfaraway))

#### Committers: 1
- Iris Faraway ([@irisfaraway](https://github.com/irisfaraway))

## v1.58.0-rc.10 (2025-01-16)

#### :rocket: Enhancement
* `gafl-webapp-service`
* [#2090](https://github.com/DEFRA/rod-licensing/pull/2090) Mobile phone links ([@ScottDormand96](https://github.com/ScottDormand96))

#### Committers: 1
- Scott Dormand ([@ScottDormand96](https://github.com/ScottDormand96))

## v1.58.0-rc.9 (2025-01-15)

#### :bug: Bug Fix
* `gafl-webapp-service`
* [#2101](https://github.com/DEFRA/rod-licensing/pull/2101) Move continue button to below the pricing summary ([@lailien3](https://github.com/lailien3))

#### Committers: 1
- laila aleissa ([@lailien3](https://github.com/lailien3))

## v1.58.0-rc.8 (2025-01-14)

#### :bug: Bug Fix
* `gafl-webapp-service`
* [#2106](https://github.com/DEFRA/rod-licensing/pull/2106) Capitalising Date Entry Fields ([@lailien3](https://github.com/lailien3))

#### Committers: 1
- laila aleissa ([@lailien3](https://github.com/lailien3))

## v1.58.0-rc.7 (2025-01-07)

#### :bug: Bug Fix
* `gafl-webapp-service`
* [#2107](https://github.com/DEFRA/rod-licensing/pull/2107) Added Welsh to Missing Address Error ([@lailien3](https://github.com/lailien3))

#### Committers: 1
- laila aleissa ([@lailien3](https://github.com/lailien3))

## v1.58.0-rc.6 (2025-01-07)

#### :bug: Bug Fix
* `gafl-webapp-service`
* [#2105](https://github.com/DEFRA/rod-licensing/pull/2105) Add Welsh to Hidden Date Picker Text ([@lailien3](https://github.com/lailien3))

#### Committers: 1
- laila aleissa ([@lailien3](https://github.com/lailien3))

## v1.58.0-rc.5 (2025-01-07)

#### :bug: Bug Fix
* `gafl-webapp-service`
* [#2104](https://github.com/DEFRA/rod-licensing/pull/2104) Welsh Missing From Payment Errors ([@lailien3](https://github.com/lailien3))

#### Committers: 1
- laila aleissa ([@lailien3](https://github.com/lailien3))

## v1.58.0-rc.4 (2025-01-07)

#### :bug: Bug Fix
* `gafl-webapp-service`
* [#2102](https://github.com/DEFRA/rod-licensing/pull/2102) Add Missing Welsh to Newsletter Page ([@lailien3](https://github.com/lailien3))

#### Committers: 1
- laila aleissa ([@lailien3](https://github.com/lailien3))

## v1.58.0-rc.3 (2025-01-03)

#### :bug: Bug Fix
Expand Down
5 changes: 1 addition & 4 deletions docker/env/recurring_payments_job.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ SALES_API_URL=http://host.docker.internal:4000
SALES_API_TIMEOUT_MS=120000

# Recurring Payments start delay for local
RECURRING_PAYMENTS_LOCAL_DELAY=30

# GOV.UK Pay
GOV_PAY_API_URL=https://publicapi.payments.service.gov.uk/v1/payments
RECURRING_PAYMENTS_LOCAL_DELAY=30
3 changes: 0 additions & 3 deletions docker/env/recurring_payments_job.secrets.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ OAUTH_SCOPE=<insert here>

DYNAMICS_API_PATH=<insert here>
DYNAMICS_API_VERSION=<insert here>

# GOV.UK Pay
GOV_PAY_RECURRING_APIKEY=<insert here>
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "1.59.0-rc.3",
"version": "1.58.0-rc.3",
"npmClient": "npm",
"publishConfig": {
"registry": "http://registry.npmjs.org/"
Expand Down
4 changes: 2 additions & 2 deletions packages/business-rules-lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/business-rules-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@defra-fish/business-rules-lib",
"version": "1.59.0-rc.3",
"version": "1.58.0-rc.3",
"description": "Shared business rules for the rod licensing digital services",
"type": "module",
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/connectors-lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/connectors-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@defra-fish/connectors-lib",
"version": "1.59.0-rc.3",
"version": "1.58.0-rc.3",
"description": "Shared connectors",
"type": "module",
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions packages/dynamics-lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/dynamics-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@defra-fish/dynamics-lib",
"version": "1.59.0-rc.3",
"version": "1.58.0-rc.3",
"description": "Framework to support integration with dynamics",
"type": "module",
"engines": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { contactForLicensee, contactForLicenseeNoReference } from '../contact.queries.js'
import { contactForLicensee } from '../contact.queries.js'
import { dynamicsClient } from '../../client/dynamics-client.js'
import { Contact } from '../../entities/contact.entity.js'
import { PredefinedQuery } from '../predefined-query.js'

jest.mock('dynamics-web-api', () => {
return jest.fn().mockImplementation(() => {
Expand Down Expand Up @@ -99,50 +97,4 @@ describe('Contact Queries', () => {
})
})
})

describe('contactForLicenseeNoReference', () => {
beforeEach(() => {
jest.resetAllMocks()

jest.spyOn(Contact.definition, 'mappings', 'get').mockReturnValue({
postcode: { field: 'mock_postcode' },
birthDate: { field: 'mock_birthdate' }
})

jest.spyOn(Contact.definition, 'defaultFilter', 'get').mockReturnValue('statecode eq 0')
})

it('should return a predefined query', () => {
const result = contactForLicenseeNoReference('03/12/1990', 'AB12 3CD')
expect(result).toBeInstanceOf(PredefinedQuery)
})

it('root should return Contact', () => {
const result = contactForLicenseeNoReference('03/12/1990', 'AB12 3CD')
expect(result._root).toEqual(Contact)
})

it('should use mocked values for mapping postcode and birth date', () => {
const result = contactForLicenseeNoReference('03/12/1990', 'AB12 3CD')
expect(result._retrieveRequest.filter).toEqual(
expect.stringContaining(Contact.definition.mappings.postcode.field),
expect.stringContaining(Contact.definition.mappings.birthDate.field)
)
})

it.each([
['AB12 3CD', '03/12/1990'],
['EF45 6GH', '05/06/1987'],
['IJ78 9KL', '14/11/1975']
])('should return correct retrieve request when postcode is %s and birth date is %s', (postcode, birthDate) => {
const result = contactForLicenseeNoReference(birthDate, postcode)

expect(result._retrieveRequest).toEqual({
collection: 'contacts',
expand: [],
filter: `mock_postcode eq '${postcode}' and mock_birthdate eq ${birthDate} and statecode eq 0`,
select: expect.any(Array)
})
})
})
})
Original file line number Diff line number Diff line change
@@ -1,41 +1,36 @@
import { permissionForFullReferenceNumber, permissionForContacts } from '../permission.queries.js'
import { permissionForLicensee, permissionForFullReferenceNumber } from '../permission.queries.js'

describe('Permission Queries', () => {
describe('permissionForFullReferenceNumber', () => {
it.each([['ABC123'], ['DEF456'], ['GHI789']])(
'builds a filter to run a query for a permission with a full reference number whch is %s',
async referenceNumber => {
const query = permissionForFullReferenceNumber(referenceNumber)
expect(query.toRetrieveRequest()).toEqual({
collection: 'defra_permissions',
expand: expect.arrayContaining([
expect.objectContaining({ property: 'defra_ContactId' }),
expect.objectContaining({ property: 'defra_PermitId' }),
expect.objectContaining({ property: 'defra_defra_permission_defra_concessionproof_PermissionId' })
]),
filter: `defra_name eq '${referenceNumber}' and statecode eq 0`,
select: expect.any(Array)
})
}
)
describe('permissionForLicensee', () => {
it('builds a filter to run a query for a permission with a given licensee date of birth and postcode', async () => {
const query = permissionForLicensee('ABC123', '2000-01-01', 'AB12 3CD')
expect(query.toRetrieveRequest()).toEqual({
collection: 'defra_permissions',
expand: expect.arrayContaining([
expect.objectContaining({ property: 'defra_ContactId' }),
expect.objectContaining({ property: 'defra_PermitId' }),
expect.objectContaining({ property: 'defra_defra_permission_defra_concessionproof_PermissionId' })
]),
filter:
"endswith(defra_name, 'ABC123') and defra_ContactId/defra_postcode eq 'AB12 3CD' and defra_ContactId/birthdate eq 2000-01-01 and statecode eq 0",
select: expect.any(Array)
})
})
})

describe('permissionForContacts', () => {
it.each([['AB12 3CD'], ['EF45 6GH'], ['IJ78 9KL']])(
'builds a filter to run a query for a permission with contact id which is %s',
async contactId => {
const query = permissionForContacts([contactId])
expect(query.toRetrieveRequest()).toEqual({
collection: 'defra_permissions',
expand: expect.arrayContaining([
expect.objectContaining({ property: 'defra_ContactId' }),
expect.objectContaining({ property: 'defra_PermitId' }),
expect.objectContaining({ property: 'defra_defra_permission_defra_concessionproof_PermissionId' })
]),
filter: `(defra_ContactId/contactid eq '${contactId}') and statecode eq 0`,
select: expect.any(Array)
})
}
)
describe('permissionForFullReferenceNumber', () => {
it('builds a filter to run a query for a permission with a full reference number', async () => {
const query = permissionForFullReferenceNumber('ABC123')
expect(query.toRetrieveRequest()).toEqual({
collection: 'defra_permissions',
expand: expect.arrayContaining([
expect.objectContaining({ property: 'defra_ContactId' }),
expect.objectContaining({ property: 'defra_PermitId' }),
expect.objectContaining({ property: 'defra_defra_permission_defra_concessionproof_PermissionId' })
]),
filter: "defra_name eq 'ABC123' and statecode eq 0",
select: expect.any(Array)
})
})
})
})
15 changes: 0 additions & 15 deletions packages/dynamics-lib/src/queries/contact.queries.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import { dynamicsClient } from '../client/dynamics-client.js'
import { Contact } from '../entities/contact.entity.js'
import { escapeODataStringValue } from '../client/util.js'
import { PredefinedQuery } from './predefined-query.js'

/**
* @typedef {Object} ContactByLicenceAndPostcode
Expand Down Expand Up @@ -36,15 +33,3 @@ export const contactForLicensee = (permissionReferenceNumberLast6Characters, lic

return dynamicsClient.executeUnboundAction('defra_GetContactByLicenceAndPostcode', request)
}

export const contactForLicenseeNoReference = (licenseeBirthDate, licenseePostcode) => {
const { postcode, birthDate } = Contact.definition.mappings
const filter = `${postcode.field} eq '${escapeODataStringValue(licenseePostcode)}' and ${birthDate.field} eq ${licenseeBirthDate} and ${
Contact.definition.defaultFilter
}`
return new PredefinedQuery({
root: Contact,
filter,
expand: []
})
}
Loading

0 comments on commit 36fdd9a

Please sign in to comment.