3.0.1 • Published 9 years ago

finciero-account v3.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

Account

This class handles validation and formatting of bank accounts to be used in Yakuza scripts

Requiring

Account = require('./account');
account = new Account() // Instance new account

Seters & getters

Setters and getters are functions with pattern matching, they behave as setters when an argument is given, otherwise they behave as getters.

Balance

Must be an Int or a Float

account.balance(103);

Currency

Is a string, must be one of the following:

  • international
  • national
account.currency('international');

Name

Must be a non-empty string

account.name('Super account');

Type

String, defaults to normal and must be one of the following:

  • checking
  • credit
  • credit_line
  • vista
account.type('credit_line');

Uid and Vanity Uid

Must be a non-empty string

account.vanity('1234'); // This works
account.vanityUid('1234'); // This alias works too

account.uid('432143211234');

Building the account

Once all attributes are set, you can use the build method to get a formatted, ready-to-go account object

account.build(); // Returns {'name': 'Foo', 'balance': 0, ... }
3.0.1

9 years ago

3.0.0

9 years ago

2.0.0

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago