Skip to content

Commit d437f70

Browse files
committed
fixup
1 parent e0a31ba commit d437f70

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

components/dashboard/src/start/CreateWorkspace.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ function SpendingLimitReachedModal(p: { hints: any }) {
372372
const [attributedTeam, setAttributedTeam] = useState<Team | undefined>();
373373

374374
useEffect(() => {
375-
const attributionId: AttributionId | undefined = p.hints && p.hints.attributionId && p.hints.attributionId;
375+
const attributionId: AttributionId | undefined = p.hints && p.hints.attributionId;
376376
if (attributionId) {
377377
// setAttributionId(attributionId);
378378
if (attributionId.kind === "team") {

components/server/ee/src/billing/entitlement-service-chargebee.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ export class EntitlementServiceChargebee implements EntitlementService {
5959

6060
const result = enoughCredits && !hitParallelWorkspaceLimit;
6161

62+
console.log("mayStartWorkspace > hitParallelWorkspaceLimit " + hitParallelWorkspaceLimit);
63+
6264
return {
6365
mayStart: result,
6466
oufOfCredits: !enoughCredits,
@@ -85,6 +87,7 @@ export class EntitlementServiceChargebee implements EntitlementService {
8587
const cachedAccountStatement = this.accountStatementProvider.getCachedStatement();
8688
const lowerBound = this.getRemainingUsageHoursLowerBound(cachedAccountStatement, date.toISOString());
8789
if (lowerBound && (lowerBound === "unlimited" || lowerBound > Accounting.MINIMUM_CREDIT_FOR_OPEN_IN_HOURS)) {
90+
console.log("checkEnoughCreditForWorkspaceStart > unlimited");
8891
return true;
8992
}
9093

@@ -93,6 +96,7 @@ export class EntitlementServiceChargebee implements EntitlementService {
9396
date.toISOString(),
9497
runningInstances,
9598
);
99+
console.log("checkEnoughCreditForWorkspaceStart > remainingUsageHours " + remainingUsageHours);
96100
return remainingUsageHours > Accounting.MINIMUM_CREDIT_FOR_OPEN_IN_HOURS;
97101
}
98102

components/server/ee/src/billing/entitlement-service.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ export class EntitlementServiceImpl implements EntitlementService {
5050
case "usage-based":
5151
result = await this.ubp.mayStartWorkspace(user, date, runningInstances);
5252
break;
53+
default:
54+
throw new Error("Unsupported billing mode: " + (billingMode as any).mode); // safety net
5355
}
5456
return result;
5557
} catch (err) {

0 commit comments

Comments
 (0)