<commit_before>import { Map, Set } from 'immutable';
import State from './index';

const state = new State();

state.input({
  name: 'filters',
  initial: Map()
});

state.map({
  name: 'datelessFilters',
  deps: ['filters'],
  mapper: filters => filters.delete('years').delete('months')
});

state.input({
  name: 'supplierId'
});

state.map({
  name: 'supplierFilters',
  deps: ['filters', 'supplierId'],
  mapper: (filters, supplierId) => 
    filters.update('supplierId', Set(), supplierIds => supplierIds.add(supplierId))
})

export default state;<commit_msg>OCE-478 Added supplier details EP<commit_after>import { Map, Set } from 'immutable';
import State from './index';
const API_ROOT = '/api';

const state = new State();

state.input({
  name: 'filters',
  initial: Map()
});

state.map({
  name: 'datelessFilters',
  deps: ['filters'],
  mapper: filters => filters.delete('years').delete('months')
});

state.input({
  name: 'supplierId'
});

state.map({
  name: 'supplierFilters',
  deps: ['filters', 'supplierId'],
  mapper: (filters, supplierId) => 
    filters.update('supplierId', Set(), supplierIds => supplierIds.add(supplierId))
});

state.map({
  name: 'supplierDetailsURL',
  deps: ['supplierId'],
  mapper: id => `${API_ROOT}/ocds/organization/supplier/id/${id}`
});

state.endpoint({
  name: 'supplierDetails',
  url: 'supplierDetailsURL'
})

export default state;
{'fraction_non_alphanumeric': 0.1925018024513338, 'fraction_numerical': 0.0021629416005767843, 'mean_word_length': 4.982758620689655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 0, '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': '4302944', 'n_tokens_mistral': 478, 'n_tokens_neox': 475, 'n_words': 109}