3.2.3 • Published 5 years ago

@paycar-cli/transfer-eta-module v3.2.3

Weekly downloads
12
License
ISC
Repository
github
Last release
5 years ago

Wire transfer timeline simulator

setUp

node >= 12.1.0

/!\ lib use es6 import /!\

install

npm i

run example

npm run example or node --experimental-modules --experimental-json-modules example/node-esm-example.js

build to browser

npm run build

browser

<script src="dist/main.d2d647ef096f9410f236.js"><script>

example with a transfert eta in express mode

    import { transferEta } from '@paycar-cli/wire-transfer-timeline-simulator/src/index.js'
    
    const result = transferEta('15/04/2019 8:00:00', true, 'fr')

result :

    {
      isExpress: true,
      transferCreationDateString: '15/04/2019 8:00:00',
      transferCreatedAt: 2019-04-15T08:00:00.001Z,
      transferExecutedAt: { 
          date: 2019-04-15T08:00:00.001Z 
      },
      transferEarliestEta: { 
          date: 2019-04-15T20:00:00.001Z
      }
    }

example with a transfert eta

    import { transferEta } from '@paycar-cli/wire-transfer-timeline-simulator/src/index.js'
    
    const result = transferEta('18/04/2019 8:00:00', false, 'fr')

result :

{
  isExpress: false,
  transferCreationDateString: '18/04/2019 8:00:00',
  transferCreatedAt: 2019-04-18T08:00:00.001Z,
  transferExecutedAt: {
    date: 2019-04-18T08:00:00.001Z,
    daysOff: { weekend: [], holidays: [] }
  },
  transferEarliestEta: {
    date: 2019-04-23T08:00:00.001Z,
    daysOff: { 
        weekend: [
            2019-04-20T08:00:00.001Z, 
            2019-04-21T08:00:00.001Z
        ],
        holidays: [
            2019-04-19T08:00:00.001Z,
            2019-04-22T08:00:00.001Z
        ] 
    }
  },
  transferLatestEta: {
    date: 2019-04-24T08:00:00.001Z,
    daysOff: { 
         weekend: [
             2019-04-20T08:00:00.001Z, 
             2019-04-21T08:00:00.001Z
         ],
         holidays: [
             2019-04-19T08:00:00.001Z,
             2019-04-22T08:00:00.001Z
         ] 
     }
  }
}

new method transfer eta request date

import { transferRequestDate } from './../../src/index.js'
import { TransactionMustBeInFuture } from "../../src/helpers/error/transaction-must-be-in-future.js";
import {TransactionDateIsTooShort} from "../../src/helpers/error/transaction-date-is-too-short.js";


    const dateBankHolidaysWorks = '7/07/2019 8:00:00'
    let result
    try {
        result = transferRequestDate(dateBankHolidaysWorks, 'fr')
    } catch (e) {
        console.log(e)
    }
3.2.3

5 years ago

3.2.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.0

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.3

5 years ago

2.0.1

5 years ago