MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / countSeatsUsed

Function countSeatsUsed

apps/cloud/src/extensions/billing/plans.ts:97–104  ·  view source on GitHub ↗
(
  memberships: ReadonlyArray<SeatMembership>,
  pendingInvitationCount: number,
)

Source from the content-addressed store, hash-verified

95 * both lists, so take the larger of the two rather than adding them.
96 */
97export const countSeatsUsed = (
98 memberships: ReadonlyArray<SeatMembership>,
99 pendingInvitationCount: number,
100): number => {
101 const active = memberships.filter((m) => m.status === "active").length;
102 const pendingMembers = memberships.filter((m) => m.status === "pending").length;
103 return active + Math.max(pendingMembers, pendingInvitationCount);
104};

Callers 2

plans.test.tsFile · 0.90
getMemberSeatsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected