@xpcoffee/bank-schema
v2.0.0
Published
Schema for representing monetary data
Downloads
8
Readme
bank schema
This is intended to be a standard for representing bank data. It is ZAR-centric.
The schemas are defined using json-schema.
Usage
Use the provided validators if you don't need any extra functionality:
import {validateStatement, validateTransaction} from "bank-schema";
const statement = { /* ... */ };
const statementValidationResult = validateStatement(statement);
console.log(statementValidationResult);
const transaction = { /* ... */ };
const transactionValidationResult = validateTransaction(transaction);
console.log(transactionValidationResult);
Pull in the schema(s) directly if you need to build a custom schema validator:
import {transactionSchema} from "bank-schema";
/* use transactionSchema in your own validator */
Development
Run tests using
npm t