Skip to content

Commit

Permalink
Change 'processing' status to 'in-progress' vega-2552#minor (#230)
Browse files Browse the repository at this point in the history
  • Loading branch information
mabely authored Jul 29, 2024
1 parent edd1261 commit 5fefd5f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion docs/schemas/2024-10/lpa.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"status": {
"type": "string",
"enum": ["processing", "registered"]
"enum": ["in-progress", "registered"]
},
"registrationDate": {
"oneOf": [
Expand Down
2 changes: 1 addition & 1 deletion internal/shared/lpa.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion lambda/create/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lambda/update/certificate_provider_opt_out_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lambda/update/perfect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
14 changes: 7 additions & 7 deletions lambda/update/perfect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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}},
Expand All @@ -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{},
Expand All @@ -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},
Expand All @@ -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},
Expand All @@ -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)
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion lambda/update/register_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5fefd5f

Please sign in to comment.