This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const paranoidDeleteCascade = require('../config/paranoidDeleteCascade'); | |
| const paranoidBulkDeleteCascade = require('../config/paranoidBulkDeleteCascade'); | |
| // Patch the paranoid delete functionality of Sequelize | |
| sequelize.addHook('afterBulkDestroy', paranoidBulkDeleteCascade(db)); | |
| sequelize.addHook('afterDestroy', paranoidDeleteCascade(db)); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | const { google } = require('googleapis'); | |
| const { NODE_ENV } = require('../params'); | |
| class SpreadsheetClient { | |
| constructor(spreadsheetId, keyfile) { | |
| this._spreadsheetId = spreadsheetId; | |
| this._keyfile = keyfile; | |
| this._sheets = google.sheets({ version: 'v4' }); | |
| this._jwtClient = new google.auth.JWT(keyfile.client_email, null, keyfile.private_key, [ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function countIfs(array1, condition1, array2, condition2) { | |
| // const intArray = array1.filter(x => condition1(x)); | |
| let inArr1; | |
| let inArr2; | |
| if (array1.length > array2.length) { | |
| inArr1 = array1.slice(0, array2.length); | |
| inArr2 = array2; | |
| } else if (array2.length > array1.length) { | |
| inArr1 = array1; | |
| inArr2 = array2.slice(0, array1.length); |