(offsetDays)
| 49 | } |
| 50 | if (!account.stats.cli || typeof account.stats.cli !== 'object') { |
| 51 | account.stats.cli = { calls: 0, input: 0, output: 0 } |
| 52 | } else { |
| 53 | account.stats.cli.calls = Number(account.stats.cli.calls) || 0 |
| 54 | account.stats.cli.input = Number(account.stats.cli.input) || 0 |
| 55 | account.stats.cli.output = Number(account.stats.cli.output) || 0 |
| 56 | } |
| 57 | } |
| 58 | // statsHistory: { 'YYYY-MM-DD': { chat:{input,output}, cli:{calls,input,output} } } |
| 59 | // Backward-compat: legacy records without the field — initialize to {} |
| 60 | if (!account.statsHistory || typeof account.statsHistory !== 'object') { |
| 61 | account.statsHistory = {} |
no outgoing calls
no test coverage detected