Skip to content

Commit

Permalink
fix: make customer active status backward compatible (#690)
Browse files Browse the repository at this point in the history
Signed-off-by: Kush Sharma <[email protected]>
  • Loading branch information
kushsharma authored Jul 26, 2024
1 parent a6ac348 commit ba8f873
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions internal/store/postgres/billing_customer_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ func (c Customer) transform() (customer.Customer, error) {
if c.ProviderID != nil {
providerID = *c.ProviderID
}
if c.State == "" {
c.State = customer.ActiveState.String()
}
return customer.Customer{
ID: c.ID,
OrgID: c.OrgID,
Expand Down
4 changes: 2 additions & 2 deletions internal/store/postgres/billing_customer_repository_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (s *BillingCustomerRepositoryTestSuite) TestCreate() {
Name: "customer 1",
ProviderID: sampleID1,
OrgID: s.orgIDs[0],
State: "",
State: customer.ActiveState,
TaxData: []customer.Tax{
{
Type: "t1",
Expand Down Expand Up @@ -148,7 +148,7 @@ func (s *BillingCustomerRepositoryTestSuite) TestCreate() {
ProviderID: "",
OrgID: s.orgIDs[0],
Currency: "usd",
State: "",
State: customer.ActiveState,
Metadata: metadata.Metadata{},
},
},
Expand Down

0 comments on commit ba8f873

Please sign in to comment.