org

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Faker

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

Faker for generating requisites of organizations

func NewFaker

func NewFaker(opts ...Option) *Faker

NewFaker creates a new OrgFaker

func (*Faker) INN

func (faker *Faker) INN() INN

INN generates INN of private person

func (*Faker) INNLE

func (faker *Faker) INNLE() INN

INNLE generates INN of legal entity

func (*Faker) OGRN

func (faker *Faker) OGRN() OGRN

OGRN generates OGRN of legal entity

func (*Faker) OGRNIP

func (faker *Faker) OGRNIP() OGRN

OGRNIP generates OGRN of individual entrepreneur

func (*Faker) SNILS

func (faker *Faker) SNILS() SNILS

SNILS generates SNILS

type INN

type INN struct {

	// Region code (2 digits)
	RegionCode uint

	// Inspection code of tax authority that assigned INN (4 digits)
	Inspection uint

	// Serial number of entry about the person in
	// the territorial section of the Unified State Register of Taxpayers
	// of the tax authority that assigned the INN
	// (5 digits - for legal entities)
	// (6 digits - for private persons)
	SerialNumber uint

	// Checksum number
	// (1 digits - for legal entities)
	// (2 digits - for private persons)
	// calculated according to a special algorithm established by the Federal Tax Service
	Checksum uint

	// Type indicates type of organization
	Type OrgType

	// Value of INN
	Value uint64
}

INN represents individual taxpayer number

func (*INN) String

func (inn *INN) String() string

String returns INN value as string

type OGRN

type OGRN struct {

	// Sign of attribution of state registration number (1 digit)
	// (is equal to 1 or 5 for legal entities)
	// (is equal to 3 for individual entrepreneurs)
	Sign uint

	// YearEnd is last two digits of year of entry in state register (2 digits)
	YearEnd uint

	// Region code (2 digits)
	RegionCode uint

	// EntryNumber in the Unified State Register of Legal Entities during the year
	// (7 digits - for legal entities)
	// (9 digits - for individual entrepreneurs)
	EntryNumber uint

	// Checksum number (1 digit)
	Checksum uint

	// Type indicates type of organization
	Type OrgType

	// Value of OGRN
	Value uint64
}

OGRN represents main state registration number

func (*OGRN) String

func (ogrn *OGRN) String() string

String returns OGRN value as string

type Option

type Option func(*Faker)

Option is a function that configures a Faker instance

func WithRandSource

func WithRandSource(src rand.Source) Option

WithRandSource sets the custome random source for the Faker

type OrgType

type OrgType uint

OrgType represents type of organization 1 - legal entity 2 - individual entrepreneur

const (
	LegalEntity OrgType = iota + 1
	IndividualEntrepreneur
)

func (OrgType) String

func (t OrgType) String() string

String returns string representation of OrgType

type SNILS

type SNILS struct {
	SerialNumber uint
	Checksum     uint
	Value        uint64
}

SNILS represents insurance number of individual personal account

func (*SNILS) String

func (snils *SNILS) String() string

String returns SNILS value as string

func (*SNILS) Stringf

func (snils *SNILS) Stringf() string

Stringf returns SNILS value as formatted string (XXX-XXX-XXX XX)

Jump to

Keyboard shortcuts

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