factories

package
v0.0.0-...-ef1d3fc Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticationFactory

type AuthenticationFactory struct {
	*Factory

	Fields AuthenticationFields
	// contains filtered or unexported fields
}

Authentication factory

func (*AuthenticationFactory) Create

func (*AuthenticationFactory) With

type AuthenticationFields

type AuthenticationFields struct {
	PersonID   uuid.UUID `json:"person_id,omitempty"`
	Token      []byte    `json:"token,omitempty" fakesize:"64"`
	CreatedIP  string    `json:"created_ip,omitempty" fake:"{ipv6address}"`
	LastUsedIP string    `json:"last_used_ip,omitempty" fake:"{ipv6address}"`
	CreatedAt  time.Time `json:"created_at,omitempty"`
	LastUsedAt time.Time `json:"last_used_at,omitempty"`
}

type AuthorizationFactory

type AuthorizationFactory struct {
	*Factory

	Fields AuthorizationFields
	// contains filtered or unexported fields
}

Authorization factory

func (*AuthorizationFactory) Create

func (*AuthorizationFactory) With

type AuthorizationFields

type AuthorizationFields struct {
	PersonID  uuid.UUID          `json:"person_id,omitempty"`
	Token     []byte             `json:"token,omitempty" fakesize:"64"`
	Kind      authorization.Kind `json:"kind,omitempty" fake:"{randomstring:[email,password]}"`
	CreatedAt time.Time          `json:"created_at,omitempty"`
}

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Base factory

func New

func New(data *data.Client) *Factory

func (*Factory) Authentication

func (bf *Factory) Authentication() *AuthenticationFactory

func (*Factory) Authorization

func (bf *Factory) Authorization() *AuthorizationFactory

func (*Factory) Person

func (bf *Factory) Person() *PersonFactory

type PersonFactory

type PersonFactory struct {
	*Factory

	Fields PersonFields
	// contains filtered or unexported fields
}

Person factory

func (*PersonFactory) Create

func (f *PersonFactory) Create(ctx context.Context) *data.Person

func (*PersonFactory) With

func (f *PersonFactory) With(cb func(*data.PersonCreate)) *PersonFactory

type PersonFields

type PersonFields struct {
	StripeID        *string        `json:"stripe_id,omitempty"`
	Email           string         `json:"email,omitempty" fake:"{email}"`
	EmailVerifiedAt *time.Time     `json:"email_verified_at,omitempty"`
	Phone           *string        `json:"phone,omitempty" fake:"{phone_e164}"`
	Password        string         `json:"password,omitempty"`
	TaxID           string         `json:"tax_id,omitempty" fake:"{tax_id}"`
	FirstName       string         `json:"first_name,omitempty" fake:"{firstname}"`
	LastName        *string        `json:"last_name,omitempty" fake:"{lastname}"`
	Language        string         `json:"language,omitempty" fake:"{randomstring:[ca,es,en]}"`
	Birthdate       *time.Time     `json:"birthdate,omitempty" fake:"{date}"`
	Gender          *person.Gender `json:"gender,omitempty" fake:"{randomstring:[woman,man,nonbinary]}"`
	Address         *string        `json:"address,omitempty" fake:"{street}"`
	PostalCode      *string        `json:"postal_code,omitempty" fake:"{zip}"`
	City            *string        `json:"city,omitempty" fake:"{city}"`
	Country         *string        `json:"country,omitempty" fake:"{countryabr}"`
	Subscribed      bool           `json:"subscribed,omitempty"`
	CreatedAt       time.Time      `json:"created_at,omitempty"`
	UpdatedAt       time.Time      `json:"updated_at,omitempty"`
}

Jump to

Keyboard shortcuts

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