2016-11-16 10:15:33 +00:00
|
|
|
import R from 'ramda'
|
|
|
|
|
2017-04-24 18:03:38 +00:00
|
|
|
/*
|
|
|
|
TODO sélection temporaire de dossier, tant que toute la base de règles n'est pas vérifiée
|
2017-03-16 18:30:30 +00:00
|
|
|
*/
|
|
|
|
|
2017-05-07 17:45:44 +00:00
|
|
|
let requireAll = requireContext =>
|
|
|
|
requireContext.keys().map(requireContext)
|
2017-04-24 18:03:38 +00:00
|
|
|
|
2017-05-07 17:45:44 +00:00
|
|
|
let rules= R.pipe(
|
|
|
|
R.chain(
|
|
|
|
requireAll,
|
|
|
|
),
|
2016-11-16 10:15:33 +00:00
|
|
|
R.unnest,
|
2017-05-07 17:45:44 +00:00
|
|
|
R.reject(R.isNil)
|
2017-06-27 10:52:29 +00:00
|
|
|
)( // This array can't be generated, as the arguments to require.context must be literals :-|
|
2017-05-07 17:45:44 +00:00
|
|
|
[
|
|
|
|
require.context(
|
|
|
|
'../../règles/rémunération-travail/cdd',
|
|
|
|
true, /([A-Za-z\u00C0-\u017F]|\.|-|_)+.yaml$/),
|
|
|
|
require.context(
|
|
|
|
'../../règles/rémunération-travail/entités/ok',
|
|
|
|
true, /([A-Za-z\u00C0-\u017F]|\.|-|_)+.yaml$/),
|
|
|
|
require.context(
|
|
|
|
'../../règles/rémunération-travail/cotisations/ok',
|
|
|
|
true, /([A-Za-z\u00C0-\u017F]|\.|-|_)+.yaml$/),
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
export default rules
|