Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import BalanceLower from './BalanceLower'
import TransactionGreater from './TransactionGreater'
import HealthBillLinked from './HealthBillLinked'
import LateHealthReimbursement from './LateHealthReimbursement'
import DelayedDebit from './DelayedDebit'
import { BankAccount } from 'models'
import { sendNotification } from 'cozy-notifications'
import { GROUP_DOCTYPE } from 'doctypes'
import get from 'lodash/get'
const log = logger.namespace('notification-service')
const lang = process.env.COZY_LOCALE || 'en'
const dictRequire = lang => require(`../../locales/${lang}`)
const translation = initTranslation(lang, dictRequire)
const t = translation.t.bind(translation)
const notificationClasses = [
BalanceLower,
TransactionGreater,
HealthBillLinked,
LateHealthReimbursement,
DelayedDebit
]
const setDifference = (a, b) => {
return new Set([...a].filter(x => !b.has(x)))
}
export const fetchTransactionAccounts = async transactions => {
const accountsIds = new Set(transactions.map(x => x.account))
const setup = ({ lang }) => {
const localeStrings = require(`locales/${lang}.json`)
const {
initTranslation
} = require('cozy-ui/transpiled/react/I18n/translation')
const translation = initTranslation(lang, () => localeStrings)
const t = translation.t.bind(translation)
const notification = new LateHealthReimbursement({
t,
data: {},
lang: 'en',
locales: {
en: localeStrings
},
client: { stackClient: { uri: 'http://cozy.tools:8080' } },
value: 20
})
return { notification }
}
;['fr', 'en'].forEach(lang => {