mirror of
https://github.com/hanzoai/dataroom.git
synced 2026-11-02 22:22:45 +00:00
hanzo-build-linux-amd64 is the only ARC runner pool installed on hanzo-k8s today (arm64 pool is paused until DigitalOcean ships arm64 droplets, per ~/work/hanzo/.github/RUNNERS.md). The arm64 job was waiting on spark-hanzoai-arm64 — not provisioned in this cluster — so every build sat in queue forever and the amd64 leg got cancelled. Set platforms: linux/amd64 on the reusable build call to skip arm64 entirely. Re-add arm64 if/when DO ships arm64 droplets and the spark runner pool comes back online.
39 lines
887 B
TypeScript
39 lines
887 B
TypeScript
import { PLANS, isOldAccount } from "../utils";
|
|
|
|
export function getPriceIdFromPlan({
|
|
planSlug,
|
|
planName,
|
|
isOld,
|
|
period,
|
|
}: {
|
|
planSlug?: string;
|
|
planName?: string;
|
|
isOld?: boolean;
|
|
period: "monthly" | "yearly";
|
|
}) {
|
|
if (!planSlug && !planName) {
|
|
throw new Error("Either planSlug or planName must be provided");
|
|
}
|
|
const env =
|
|
process.env.NEXT_PUBLIC_VERCEL_ENV === "production" ? "production" : "test";
|
|
|
|
const planIdentifier = planSlug || planName;
|
|
const accountType = isOld
|
|
? "old"
|
|
: isOldAccount(planIdentifier!)
|
|
? "old"
|
|
: "new";
|
|
const cleanPlan = planIdentifier!.split("+")[0];
|
|
|
|
const plan = PLANS.find((p) =>
|
|
planSlug ? p.slug === cleanPlan : p.name === cleanPlan,
|
|
);
|
|
|
|
if (!plan) {
|
|
console.error(`Plan not found: ${cleanPlan}`);
|
|
return undefined;
|
|
}
|
|
|
|
return plan.price[period].priceIds[env][accountType];
|
|
}
|