<commit_before>'use strict';

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 requestJson = require('request-json');
const request = require('request');
const moment = require('moment');

const Bill = require('../models/bill');
/* The goal of this connector is to fetch bills from the
service captaintrain.com */

const logger = require('printit')({
  prefix: 'Captaintrain',
  date: true,
});


module.exports = baseKonnector.createNew({
  name: 'Captain Train',
  vendorLink: 'www.captaintrain.com',
  fields: {
    login: 'email',
    password: 'password',
    folderPath: 'folder',
  },

  models: [Bill],

  fetchOperations: [
    login,
    fetchBills,
    customFilterExisting,
    customSaveDataAndFile,
    linkBankOperation({
      log: logger,
      minDateDelta: 1,
      maxDateDelta: 1,
      model: Bill,
      amountDelta: 0.1,
      identifier: ['CAPITAINE TRAIN', 'CAPTAIN TRAIN', 'OUIGO'],
    }),
    buildNotifContent,
  ],

});

const fileOptions = {
  vendor: 'Captaintrain',
  dateFormat: 'YYYYMMDD',<commit_msg>Add "Trainline" label to captain_train connector<commit_after>'use strict';

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 requestJson = require('request-json');
const request = require('request');
const moment = require('moment');

const Bill = require('../models/bill');
/* The goal of this connector is to fetch bills from the
service captaintrain.com */

const logger = require('printit')({
  prefix: 'Captaintrain',
  date: true,
});


module.exports = baseKonnector.createNew({
  name: 'Captain Train',
  vendorLink: 'www.captaintrain.com',
  fields: {
    login: 'email',
    password: 'password',
    folderPath: 'folder',
  },

  models: [Bill],

  fetchOperations: [
    login,
    fetchBills,
    customFilterExisting,
    customSaveDataAndFile,
    linkBankOperation({
      log: logger,
      minDateDelta: 1,
      maxDateDelta: 1,
      model: Bill,
      amountDelta: 0.1,
      identifier: ['CAPITAINE TRAIN', 'CAPTAIN TRAIN', 'OUIGO', 'TRAINLINE'],
    }),
    buildNotifContent,
  ],

});

const fileOptions = {
  vendor: 'Captaintrain',
  dateFormat: 'YYYYMMDD',
{'fraction_non_alphanumeric': 0.14659090909090908, 'fraction_numerical': 0.0030303030303030303, 'mean_word_length': 4.108317214700193, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '5305667', 'n_tokens_mistral': 842, 'n_tokens_neox': 813, 'n_words': 193}