feat(go): referral support (#28345)

Co-authored-by: Jack <jack@anoma.ly>
This commit is contained in:
Victor Navarro
2026-05-19 17:51:39 +02:00
committed by GitHub
co-authored by Jack
parent 512e34af83
commit b32f071502
54 changed files with 20809 additions and 206 deletions
@@ -9,7 +9,7 @@ import { Actor } from "@opencode-ai/console-core/actor.js"
import { Resource } from "@opencode-ai/console-resource"
import { LiteData } from "@opencode-ai/console-core/lite.js"
import { BlackData } from "@opencode-ai/console-core/black.js"
import { User } from "@opencode-ai/console-core/user.js"
import { Referral } from "@opencode-ai/console-core/referral.js"
export async function POST(input: APIEvent) {
const body = await Billing.stripe().webhooks.constructEventAsync(
@@ -174,6 +174,13 @@ export async function POST(input: APIEvent) {
}
}
})
await Referral.completeFromLiteSubscription({
workspaceID,
userID,
}).catch((error) => {
console.error("Referral sync failed", error)
})
})
}
}