customer

package
v1.0.0-beta.201 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPostgresHost = "127.0.0.1"
)
View Source
const (
	PostgresURLTemplate = "postgres://postgres:postgres@%s:5432/postgres?sslmode=disable"
)

Variables

View Source
var (
	TestKey                = "test-customer"
	TestName               = "Test Customer"
	TestPrimaryEmail       = "test@openmeter.io"
	TestCurrency           = currencyx.Code("USD")
	TestAddressCountry     = models.CountryCode("US")
	TestAddressCity        = "San Francisco"
	TestAddressState       = "CA"
	TestAddressPostalCode  = "94105"
	TestAddressLine1       = "123 Main St"
	TestAddressLine2       = "Apt 1"
	TestAddressPhoneNumber = "123-456-7890"
	TestAddress            = models.Address{
		Country:     &TestAddressCountry,
		City:        &TestAddressCity,
		Line1:       &TestAddressLine1,
		Line2:       &TestAddressLine2,
		PostalCode:  &TestAddressPostalCode,
		PhoneNumber: &TestAddressPhoneNumber,
	}
	TestSubjectKeys = []string{"subject-0"}
)

Functions

This section is empty.

Types

type CustomerHandlerTestSuite

type CustomerHandlerTestSuite struct {
	Env TestEnv
	// contains filtered or unexported fields
}

func (*CustomerHandlerTestSuite) TestCreate

func (s *CustomerHandlerTestSuite) TestCreate(ctx context.Context, t *testing.T)

TestCreate tests the creation of a customer

func (*CustomerHandlerTestSuite) TestDelete

func (s *CustomerHandlerTestSuite) TestDelete(ctx context.Context, t *testing.T)

TestDelete tests the deletion of a customer

func (*CustomerHandlerTestSuite) TestGet

func (s *CustomerHandlerTestSuite) TestGet(ctx context.Context, t *testing.T)

TestGet tests the getting of a customer by ID

func (*CustomerHandlerTestSuite) TestList

func (s *CustomerHandlerTestSuite) TestList(ctx context.Context, t *testing.T)

TestList tests the listing of customers

func (*CustomerHandlerTestSuite) TestUpdate

func (s *CustomerHandlerTestSuite) TestUpdate(ctx context.Context, t *testing.T)

TestUpdate tests the updating of a customer

func (*CustomerHandlerTestSuite) TestUpdateWithSubscriptionPresent

func (s *CustomerHandlerTestSuite) TestUpdateWithSubscriptionPresent(ctx context.Context, t *testing.T)

If a customer has a subscription, UsageAttributions cannot be updated

type TestEnv

type TestEnv interface {
	Customer() customer.Service
	Subscription() subscription.Service

	Close() error
}

func NewTestEnv

func NewTestEnv(t *testing.T, ctx context.Context) (TestEnv, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL