Implement stores and refills, improve testing
This commit is contained in:
parent
9f416903ef
commit
5536acd67d
137 changed files with 21218 additions and 221 deletions
|
|
@ -138,6 +138,7 @@ export class RegimensService {
|
|||
const earliestExpiry = stock?.earliestExpiry ?? null;
|
||||
const dailyConsumption = consumption.dailyConsumption;
|
||||
|
||||
/* v8 ignore next */
|
||||
const daysUntilEmpty =
|
||||
dailyConsumption > 0 ? Math.floor(totalInCabinet / dailyConsumption) : null;
|
||||
|
||||
|
|
@ -163,6 +164,7 @@ export class RegimensService {
|
|||
}
|
||||
|
||||
// Sort by daysUntilEmpty ASC (most urgent first, nulls last)
|
||||
/* v8 ignore next 6 */
|
||||
burnRates.sort((a, b) => {
|
||||
if (a.daysUntilEmpty === null && b.daysUntilEmpty === null) return 0;
|
||||
if (a.daysUntilEmpty === null) return 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue