Files
netris-nestri/apps/api/app
Wanjohi 228df15528 feat(machine): a team may own at most ten machines
Adding a host is a command anyone signed in can run, so one account
could register as many hosts as it could script. A team now owns at
most ten machines that are not deleted; hardware an organisation owns
outright is not counted.

The limit is held in Machine.register, under a lock on the team's row,
so it covers registering directly and spending an install token alike,
including one minted while there was still room; a refused spend
leaves the token unspent. Minting an install token for a full team is
refused too, so nobody is handed a command that cannot work. Both
answer 429 `rate_limit` / `quota_exceeded`, "Your team already has 10
machines. Remove one to add another."
2026-10-16 01:01:55 +03:00
..