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

MLPAB-1406 MLPAB-1407 MLPAB-1412 MLPAB-1409 Previous application changes #808

Merged
merged 2 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions cypress/e2e/donor/application-reason.cy.js

This file was deleted.

2 changes: 1 addition & 1 deletion cypress/e2e/donor/lpa-type.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe('LPA type', () => {
cy.checkA11yApp();

cy.contains('button', 'Continue').click();
cy.url().should('contain', '/application-reason');
cy.url().should('contain', '/task-list');
});

it('errors when unselected', () => {
Expand Down
28 changes: 20 additions & 8 deletions cypress/e2e/donor/previous-application-number.cy.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
describe('Previous application number', () => {
it('can be submitted', () => {
beforeEach(() => {
cy.visit('/fixtures?redirect=/previous-application-number');
});

it('can be submitted', () => {
cy.checkA11yApp();

cy.get('#f-previous-application-number').type('ABC');
cy.get('#f-previous-application-number').type('MABC');
cy.contains('button', 'Save and continue').click();

cy.contains('button', 'Continue').click();
cy.url().should('contain', '/task-list');
cy.url().should('contain', '/what-happens-after-no-fee');
});

it('errors when unselected', () => {
cy.visit('/fixtures?redirect=/previous-application-number');
cy.contains('button', 'Save and continue').click();

cy.contains('button', 'Continue').click();
cy.get('.govuk-error-summary').within(() => {
cy.contains('Enter previous reference number');
});

cy.contains('.govuk-error-message', 'Enter previous reference number');
});

it('errors when not correct format', () => {
cy.get('#f-previous-application-number').type('ABC');
cy.contains('button', 'Save and continue').click();

cy.get('.govuk-error-summary').within(() => {
cy.contains('Enter previousApplicationNumber');
cy.contains('Previous reference number must begin with 7 or M');
});

cy.contains('.govuk-fieldset .govuk-error-message', 'Enter previousApplicationNumber');
cy.contains('.govuk-error-message', 'Previous reference number must begin with 7 or M');
});
});
2 changes: 0 additions & 2 deletions internal/app/donor_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ func (s *donorStore) Put(ctx context.Context, lpa *page.Lpa) error {
if lpa.UID != "" && lpa.PreviousApplicationNumber != "" && !lpa.HasSentPreviousApplicationLinkedEvent {
if err := s.eventClient.Send(ctx, "previous-application-linked", previousApplicationLinkedEvent{
UID: lpa.UID,
ApplicationReason: lpa.ApplicationReason.String(),
PreviousApplicationNumber: lpa.PreviousApplicationNumber,
}); err != nil {
s.logger.Print(err)
Expand Down Expand Up @@ -256,7 +255,6 @@ type applicationUpdatedEventDonor struct {

type previousApplicationLinkedEvent struct {
UID string `json:"uid"`
ApplicationReason string `json:"applicationReason"`
PreviousApplicationNumber string `json:"previousApplicationNumber"`
}

Expand Down
5 changes: 0 additions & 5 deletions internal/app/donor_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,6 @@ func TestDonorStorePutWhenPreviousApplicationLinked(t *testing.T) {
eventClient.
On("Send", ctx, "previous-application-linked", previousApplicationLinkedEvent{
UID: "M-1111",
ApplicationReason: "remake",
PreviousApplicationNumber: "5555",
}).
Return(nil)
Expand All @@ -386,7 +385,6 @@ func TestDonorStorePutWhenPreviousApplicationLinked(t *testing.T) {
ID: "5",
UID: "M-1111",
UpdatedAt: now,
ApplicationReason: page.RemakeOfInvalidApplication,
PreviousApplicationNumber: "5555",
HasSentApplicationUpdatedEvent: true,
HasSentPreviousApplicationLinkedEvent: true,
Expand All @@ -400,7 +398,6 @@ func TestDonorStorePutWhenPreviousApplicationLinked(t *testing.T) {
SK: "#DONOR#an-id",
ID: "5",
UID: "M-1111",
ApplicationReason: page.RemakeOfInvalidApplication,
PreviousApplicationNumber: "5555",
HasSentApplicationUpdatedEvent: true,
})
Expand All @@ -423,7 +420,6 @@ func TestDonorStorePutWhenPreviousApplicationLinkedWontResend(t *testing.T) {
SK: "#DONOR#an-id",
ID: "5",
UID: "M-1111",
ApplicationReason: page.RemakeOfInvalidApplication,
PreviousApplicationNumber: "5555",
HasSentApplicationUpdatedEvent: true,
HasSentPreviousApplicationLinkedEvent: true,
Expand Down Expand Up @@ -456,7 +452,6 @@ func TestDonorStorePutWhenPreviousApplicationLinkedWhenError(t *testing.T) {
SK: "#DONOR#an-id",
ID: "5",
UID: "M-1111",
ApplicationReason: page.RemakeOfInvalidApplication,
PreviousApplicationNumber: "5555",
HasSentApplicationUpdatedEvent: true,
})
Expand Down
11 changes: 0 additions & 11 deletions internal/page/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,6 @@ const (
ReplacementAttorneysStepInAnotherWay // other
)

//go:generate enumerator -type ApplicationReason -linecomment -empty
type ApplicationReason uint8

const (
NewApplication ApplicationReason = iota + 1 // new-application
RemakeOfInvalidApplication // remake
AdditionalApplication // additional-application
)

//go:generate enumerator -type FeeType
type FeeType uint8

Expand Down Expand Up @@ -119,8 +110,6 @@ type Lpa struct {
CertificateProvider actor.CertificateProvider
// Type of LPA being drafted
Type LpaType
// ApplicationReason is why the application is being made
ApplicationReason ApplicationReason
// PreviousApplicationNumber if the application is related to an existing application
PreviousApplicationNumber string
// Whether the applicant wants to add replacement attorneys
Expand Down
75 changes: 0 additions & 75 deletions internal/page/donor/application_reason.go

This file was deleted.

Loading