Skip to content
Astera Technology

Compare pooled and per-workspace billing blocks

Apply block rounding at the quoted aggregation scope.

Download complete case notes and answer keys ↓

Set the decision and its input

In this fictional offer, a block covers ten units. Two workspaces consume six and four. Pooling gives ten units and one block; rounding each workspace separately gives one plus one, two blocks. The same usage records do not imply the same billed quantity.

Filled local test worksheet
CaseInput JSON
Base test{"scope":"per-workspace","workspaceUnits":[6,4]}
Download editable CSV ↓

Run the supplied comparison

The comparison is about the external billing function before any internal allocation. Keep the quotation scope, workspace amounts and computed blocks together; dividing two billed blocks among departments does not turn them into one.

Faulty and required outputs
PathOutput JSON
Faulty path{"scope":"per-workspace","blocks":1}
Required path{"scope":"per-workspace","blocks":2}
Download editable CSV ↓
Complete local Node24.14.1 programme
import assert from 'node:assert/strict';
const smallWhole=(x,max)=>Number.isSafeInteger(x)&&x>=0&&x<=max;

const run=function run(i,corrected=true){
    if(!['pooled','per-workspace'].includes(i.scope)||!i.workspaceUnits.every(x=>smallWhole(x,1000000)))return {held:true};
    const pooled=Math.ceil(i.workspaceUnits.reduce((a,b)=>a+b,0)/10);
    const separate=i.workspaceUnits.reduce((a,b)=>a+Math.ceil(b/10),0);
    return {scope:i.scope,blocks:corrected?(i.scope==='pooled'?pooled:separate):pooled};
  };
const cases=[{"input":{"scope":"per-workspace","workspaceUnits":[6,4]},"corrected":false,"expected":{"scope":"per-workspace","blocks":1}},{"input":{"scope":"per-workspace","workspaceUnits":[6,4]},"corrected":true,"expected":{"scope":"per-workspace","blocks":2}},{"input":{"scope":"pooled","workspaceUnits":[6,4]},"corrected":true,"expected":{"scope":"pooled","blocks":1}},{"input":{"scope":"per-workspace","workspaceUnits":[0,0]},"corrected":true,"expected":{"scope":"per-workspace","blocks":0}},{"input":{"scope":null,"workspaceUnits":[6,4]},"corrected":true,"expected":{"held":true}}];
for(const test of cases){const actual=await run(test.input,test.corrected);assert.deepEqual(actual,test.expected);console.log(actual);}
Download runnable example ↓

Choose from the boundary evidence

Explicit pooling accepts one block. Two unused workspaces consume zero under the supplied zero-use rule. Unknown aggregation scope is held.

  1. Identify aggregation scope
  2. Round at that scope
  3. Retain billed blocks separately

Hold a missing pooling rule instead of averaging workspace usage.

Editable boundary inputs and outputs
ConditionInput JSONExpected output JSON
declared pooling{"scope":"pooled","workspaceUnits":[6,4]}{"scope":"pooled","blocks":1}
empty usage{"scope":"per-workspace","workspaceUnits":[0,0]}{"scope":"per-workspace","blocks":0}
scope unspecified{"scope":null,"workspaceUnits":[6,4]}{"held":true}
Download editable CSV ↓

What count belongs to the base per-workspace offer?

Show the worked answer

Two. Six rounds to one block and four rounds to another. The one-block pooled result belongs to a different stated contract.

Related resources