diff --git a/docs/schemas/2024-10/lpa.json b/docs/schemas/2024-10/lpa.json index 295b30ed..f814e3c5 100644 --- a/docs/schemas/2024-10/lpa.json +++ b/docs/schemas/2024-10/lpa.json @@ -18,7 +18,7 @@ }, "status": { "type": "string", - "enum": ["processing", "registered"] + "enum": ["in-progress", "registered"] }, "registrationDate": { "oneOf": [ diff --git a/internal/shared/lpa.go b/internal/shared/lpa.go index 94cabdc1..5364e4ae 100644 --- a/internal/shared/lpa.go +++ b/internal/shared/lpa.go @@ -49,7 +49,7 @@ func (e LpaType) IsValid() bool { type LpaStatus string const ( - LpaStatusProcessing = LpaStatus("processing") + LpaStatusInProgress = LpaStatus("in-progress") LpaStatusPerfect = LpaStatus("perfect") LpaStatusRegistered = LpaStatus("registered") LpaStatusCannotRegister = LpaStatus("cannot-register") diff --git a/lambda/create/main.go b/lambda/create/main.go index 911bac23..f9967604 100644 --- a/lambda/create/main.go +++ b/lambda/create/main.go @@ -102,7 +102,7 @@ func (l *Lambda) HandleEvent(ctx context.Context, req events.APIGatewayProxyRequ data := shared.Lpa{LpaInit: input} data.Uid = uid - data.Status = shared.LpaStatusProcessing + data.Status = shared.LpaStatusInProgress data.UpdatedAt = time.Now() if data.Channel == shared.ChannelPaper && len(input.RestrictionsAndConditionsImages) > 0 { diff --git a/lambda/update/certificate_provider_opt_out_test.go b/lambda/update/certificate_provider_opt_out_test.go index 979bedf2..9af4fd93 100644 --- a/lambda/update/certificate_provider_opt_out_test.go +++ b/lambda/update/certificate_provider_opt_out_test.go @@ -10,7 +10,7 @@ import ( ) func TestCertificateProviderOptOutApply(t *testing.T) { - lpa := &shared.Lpa{Status: shared.LpaStatusProcessing} + lpa := &shared.Lpa{Status: shared.LpaStatusInProgress} c := CertificateProviderOptOut{} errors := c.Apply(lpa) diff --git a/lambda/update/perfect.go b/lambda/update/perfect.go index f78b3287..193b643c 100644 --- a/lambda/update/perfect.go +++ b/lambda/update/perfect.go @@ -7,8 +7,8 @@ import ( type Perfect struct{} func (r Perfect) Apply(lpa *shared.Lpa) []shared.FieldError { - if lpa.Status != shared.LpaStatusProcessing { - return []shared.FieldError{{Source: "/type", Detail: "status must be processing to make perfect"}} + if lpa.Status != shared.LpaStatusInProgress { + return []shared.FieldError{{Source: "/type", Detail: "status must be in-progress to make perfect"}} } if lpa.SignedAt.IsZero() { diff --git a/lambda/update/perfect_test.go b/lambda/update/perfect_test.go index e6801279..a74004c5 100644 --- a/lambda/update/perfect_test.go +++ b/lambda/update/perfect_test.go @@ -12,7 +12,7 @@ func TestPerfectApply(t *testing.T) { now := time.Now() lpa := &shared.Lpa{ - Status: shared.LpaStatusProcessing, + Status: shared.LpaStatusInProgress, LpaInit: shared.LpaInit{ SignedAt: now, CertificateProvider: shared.CertificateProvider{ @@ -43,7 +43,7 @@ func TestPerfectApplyWhenUnsigned(t *testing.T) { }{ "lpa": { lpa: &shared.Lpa{ - Status: shared.LpaStatusProcessing, + Status: shared.LpaStatusInProgress, LpaInit: shared.LpaInit{ CertificateProvider: shared.CertificateProvider{SignedAt: &now}, Attorneys: []shared.Attorney{{SignedAt: &now}}, @@ -56,7 +56,7 @@ func TestPerfectApplyWhenUnsigned(t *testing.T) { }, "certificate provider": { lpa: &shared.Lpa{ - Status: shared.LpaStatusProcessing, + Status: shared.LpaStatusInProgress, LpaInit: shared.LpaInit{ SignedAt: now, CertificateProvider: shared.CertificateProvider{}, @@ -70,7 +70,7 @@ func TestPerfectApplyWhenUnsigned(t *testing.T) { }, "attorney": { lpa: &shared.Lpa{ - Status: shared.LpaStatusProcessing, + Status: shared.LpaStatusInProgress, LpaInit: shared.LpaInit{ SignedAt: now, CertificateProvider: shared.CertificateProvider{SignedAt: &now}, @@ -84,7 +84,7 @@ func TestPerfectApplyWhenUnsigned(t *testing.T) { }, "trust corporation": { lpa: &shared.Lpa{ - Status: shared.LpaStatusProcessing, + Status: shared.LpaStatusInProgress, LpaInit: shared.LpaInit{ SignedAt: now, CertificateProvider: shared.CertificateProvider{SignedAt: &now}, @@ -106,11 +106,11 @@ func TestPerfectApplyWhenUnsigned(t *testing.T) { } } -func TestRegisterApplyWhenNotProcessing(t *testing.T) { +func TestRegisterApplyWhenNotInProgress(t *testing.T) { for _, status := range []shared.LpaStatus{shared.LpaStatusPerfect, shared.LpaStatusRegistered} { t.Run(string(status), func(t *testing.T) { errors := Perfect{}.Apply(&shared.Lpa{Status: status}) - assert.Equal(t, []shared.FieldError{{Source: "/type", Detail: "status must be processing to make perfect"}}, errors) + assert.Equal(t, []shared.FieldError{{Source: "/type", Detail: "status must be in-progress to make perfect"}}, errors) }) } } diff --git a/lambda/update/register_test.go b/lambda/update/register_test.go index ff0e0f75..9dc78c80 100644 --- a/lambda/update/register_test.go +++ b/lambda/update/register_test.go @@ -22,7 +22,7 @@ func TestRegisterApply(t *testing.T) { } func TestRegisterApplyWhenNotPerfect(t *testing.T) { - for _, status := range []shared.LpaStatus{shared.LpaStatusProcessing, shared.LpaStatusRegistered} { + for _, status := range []shared.LpaStatus{shared.LpaStatusInProgress, shared.LpaStatusRegistered} { t.Run(string(status), func(t *testing.T) { errors := Register{}.Apply(&shared.Lpa{Status: status}) assert.Equal(t, []shared.FieldError{{Source: "/type", Detail: "status must be perfect to register"}}, errors)