Skip to content
Astera Technology

Allocate a session from the earliest eligible package

Compare service scope, session start and available quantity before choosing a package.

Filter eligibility before sorting expiry

Synthetic rule: use the eligible package with the earliest unusable timestamp; ties use package ID. Eligibility requires the selected service, positive available sessions and a session start before expiry. A package that expires sooner but excludes the service must not win.

Synthetic allocation candidates for service A on 15 Oct
PackageScope / availableUnusable fromSelection
P-E1Service B / 316 Oct 00:00Exclude: wrong service
P-E2Service A / 218 Oct 00:00Select one session
P-E3Service A / 522 Oct 00:00Keep available
Download editable CSV ↓

Record the source of the held session

  1. Filter by member, service, positive available balance and start-time validity.
  2. Order eligible packages by expiry and the documented tie rule.
  3. Hold one session from P-E2 and record its package ID on the booking.

If the chosen package changes before allocation, recalculate the eligible set; do not create a negative balance.

How many available sessions remain in P-E2 after one booking?

Show the worked answer

One is available and one is held. P-E1 keeps three because it cannot fund service A.

Returning a cancelled session should reference P-E2, rather than choosing the earliest package again.

Related resources