<commit_before>/*
// This konnector retrieves invoices from french motorway company APRR
// website https://espaceclient.aprr.fr
// creation : 11/06/2016
// creator : https://github.com/SomeAverageDev
// this konnector works for customers having an automatic toll payment system
// also called "badge telepeage"
*/
'use strict';

const request = require('request').defaults({
  jar: true,
  rejectUnauthorized: false,
  followAllRedirects: true,
});
const moment = require('moment');
const cheerio = require('cheerio');
const baseKonnector = require('../lib/base_konnector');

const filterExisting = require('../lib/filter_existing');
const localization = require('../lib/localization_manager');
const saveDataAndFile = require('../lib/save_data_and_file');
const linkBankOperation = require('../lib/link_bank_operation');

const log = require('printit')({
  prefix: 'APRR',
  date: true,
});

const fileOptions = {
  vendor: 'APRR',
  dateFormat: 'YYYYMMDD',
};

const Bill = require('../models/bill');
const baseUrl = 'https://espaceclient.aprr.fr/aprr/Pages';

// Konnector
const connector = module.exports = baseKonnector.createNew({
  name: 'APRR',
  slug: 'APRR',
  description: 'konnector description aprr',
  vendorLink: `${baseUrl}/connexion.aspx`,
  fields: {
    login: 'text',
    password: 'password',
    folderPath: 'folder',
  },
  models: [Bill],
  fetchOperations: [
    getHiddenInputs,
    logIn,
    fetchBillingInfo,
    parsePage,
    customFilterExisting,
    customSaveDataAndFile,
    linkBankOperation({
      log,
      model: Bill,
      identifier: 'APRR',
      minDateDelta: 4,
      maxDateDelta: 20,
      amountDelta: 0.1,
    }),
    buildNotifContent,
  ],
});

// Procedure to get hidden inputs
function getHiddenInputs(requiredFields, bills, data, next) {
  const url = `${baseUrl}/connexion.aspx`;
  const options = {
    url,
    method: 'GET',
  };

  connector.logger.info('Getting the hidden inputs...');
<commit_msg>update aprr's bank identifier<commit_after>/*
// This konnector retrieves invoices from french motorway company APRR
// website https://espaceclient.aprr.fr
// creation : 11/06/2016
// creator : https://github.com/SomeAverageDev
// this konnector works for customers having an automatic toll payment system
// also called "badge telepeage"
*/
'use strict';

const request = require('request').defaults({
  jar: true,
  rejectUnauthorized: false,
  followAllRedirects: true,
});
const moment = require('moment');
const cheerio = require('cheerio');
const baseKonnector = require('../lib/base_konnector');

const filterExisting = require('../lib/filter_existing');
const localization = require('../lib/localization_manager');
const saveDataAndFile = require('../lib/save_data_and_file');
const linkBankOperation = require('../lib/link_bank_operation');

const log = require('printit')({
  prefix: 'APRR',
  date: true,
});

const fileOptions = {
  vendor: 'APRR',
  dateFormat: 'YYYYMMDD',
};

const Bill = require('../models/bill');
const baseUrl = 'https://espaceclient.aprr.fr/aprr/Pages';

// Konnector
const connector = module.exports = baseKonnector.createNew({
  name: 'APRR',
  slug: 'APRR',
  description: 'konnector description aprr',
  vendorLink: `${baseUrl}/connexion.aspx`,
  fields: {
    login: 'text',
    password: 'password',
    folderPath: 'folder',
  },
  models: [Bill],
  fetchOperations: [
    getHiddenInputs,
    logIn,
    fetchBillingInfo,
    parsePage,
    customFilterExisting,
    customSaveDataAndFile,
    linkBankOperation({
      log,
      model: Bill,
      identifier: 'APRR AUTOROUTE',
      minDateDelta: 4,
      maxDateDelta: 20,
      amountDelta: 0.1,
    }),
    buildNotifContent,
  ],
});

// Procedure to get hidden inputs
function getHiddenInputs(requiredFields, bills, data, next) {
  const url = `${baseUrl}/connexion.aspx`;
  const options = {
    url,
    method: 'GET',
  };

  connector.logger.info('Getting the hidden inputs...');

{'fraction_non_alphanumeric': 0.14412360688956433, 'fraction_numerical': 0.006585612968591692, 'mean_word_length': 3.9178082191780823, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4521539', 'n_tokens_mistral': 1277, 'n_tokens_neox': 1243, 'n_words': 300}