Skip to content

Adding Rule and Category Options to Transactions

klequis edited this page Nov 5, 2020 · 1 revision

A transactions currently has these fields:

{
  _id: 'ObjectId'
  acctId: 'someVlaue'
  date: 'someVlaue'
  description: 'someVlaue'
  origDescription: 'someVlaue'
  amount: 'someVlaue'
  category1: 'someVlaue' || ''
  category2: 'someVlaue' || ''
  checkNumber: 'someVlaue'
  type: 'someVlaue'
  omit: true || false
  ruleIds: ['id1', 'id2'] || [] || field does not exist
}

It needs the following fields added:

// {
//   hasRule: 'both' || 'hasRule' || 'doesNotHaveRule',
//   hasCategory: 'all' || 'categorized' || 'uncategorized'
// }
{
  hasRule: true || false,
  hasCategory: true || false
}

The value of ruleRadio is based of of ruleIds:

if ( ruleIds is ['not exist' || null || size=0]) {

}