[по-русски] [developer instructions]
Generation of specific russian values
- BIK (Faker::Russian.bik) Russian bank identification number
- INN (Faker::Russian.inn) Russian analogue of VAT identification number
- OKPO (Faker::Russian.okpo) Legal code
- KPP (Faker::Russian.kpp) Code of reason for registration
- (TODO) OGRN (Faker::Russian.ogrn) Main state registration number
- (TODO) [Correspondent Account Value] (http://ru.wikipedia.org/wiki/Корреспондентский_счёт) (Faker::Russian.ks)
- (TODO) [Bank account value] (http://ru.wikipedia.org/wiki/Расчётный_счёт) (Faker::Russian.rs)
- OKATO (Faker::Russian.okato)
- (TODO) SNILS (Faker::Russian.snils)
- (TODO) Passport value (Faker::Russian.passport)
You can use gem 'validates_russian' for validates generated values
Add to Gemfile
gem 'validates_russian'
Generates bank identification number with random okato region number
Faker::Russian.bik # => '0454954616'
You can pass okato region number
Faker::Russian.bik(okato_region_number: '40') # => '0440754281'
Also you can use sequences for pseudo-random Bik's
Faker::Russian.bik(sequence_number: 1) # => '0451491755'
Faker::Russian.bik(sequence_number: 1) # => '0451491755'
Generate INN with random region number and type (:individual or :legal)
Faker::Russian.inn # => '183501166447'
You can set region_number
and type
Faker::Russian.inn(region_number: '78') # => '7857296996'
Faker::Russian.inn(kind: :individual) # => '0229191612'
Faker::Russian.inn(kind: :legal) # => '366582211439'
Also you can use sequences
Faker::Russian.inn(sequence_number: 1) # => '0956860593'
Faker::Russian.inn(sequence_number: 1) # => '0956860593'
Faker::Russian.okpo # => '57972160'
Also pseudo-random sequences available
Faker::Russian.okpo(sequence_number: 1) # => '13410254'
Faker::Russian.okpo(sequence_number: 1) # => '13410254'
Generate KPP with random region_number
Faker::Russian.kpp # => '525601001'
You can choose region
Faker::Russian.kpp(region_number: 78) # => '784101001'
Also, you can use pseudo random sequence numbers (not much 1000, there is limited count of kpps)
Faker::Russian.kpp(sequence_number: 1) # => '381201001'
Faker::Russian.inn(sequence_number: 1) # => '381201001'
Generates okato with random okato region number and random length
Faker::Russian.okato # => '849012471'
You can select okato region number
Faker::Russian.okato(okato_region_number: 25) # => '251'
You can select okato region length:
Faker::Russian.okato(length: 3) # => '251'
Faker::Russian.okato(length: 6) # => '443758'
Faker::Russian.okato(length: 9) # => '849012471'
You can use sequences
Faker::Russian.okato(sequence_number: 1) # => '517'
Faker::Russian.okato(sequence_number: 1) # => '517'
Please read CONTRIBUTING.md in Russian