summaryrefslogtreecommitdiffhomepage
path: root/packages/console/core/script
diff options
context:
space:
mode:
authorFrank <[email protected]>2026-01-08 23:44:11 -0500
committerFrank <[email protected]>2026-01-09 01:32:00 -0500
commitdd5ec26c8c09b6374e379ad523e9953ce75a4417 (patch)
tree1532ca1a4c02b894bb4a23bbedffaa7cf5bd8038 /packages/console/core/script
parent8b062ed6214ea83452a453428675a29d84105a79 (diff)
downloadopencode-dd5ec26c8c09b6374e379ad523e9953ce75a4417.tar.gz
opencode-dd5ec26c8c09b6374e379ad523e9953ce75a4417.zip
wip: black
Diffstat (limited to 'packages/console/core/script')
-rw-r--r--packages/console/core/script/onboard-zen-black.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/console/core/script/onboard-zen-black.ts b/packages/console/core/script/onboard-zen-black.ts
index 06e5afe12..6ae4f2a2a 100644
--- a/packages/console/core/script/onboard-zen-black.ts
+++ b/packages/console/core/script/onboard-zen-black.ts
@@ -39,6 +39,9 @@ if (amountInCents !== 20000) {
process.exit(1)
}
+const subscriptionData = await Billing.stripe().subscriptions.retrieve(subscription.id, { expand: ["discounts"] })
+const couponID = subscriptionData.discounts[0]?.coupon?.id
+
// Check if subscription is already tied to another workspace
const existingSubscription = await Database.use((tx) =>
tx
@@ -122,6 +125,7 @@ await Database.transaction(async (tx) => {
.set({
customerID,
subscriptionID,
+ subscriptionCouponID: couponID,
paymentMethodID,
paymentMethodLast4,
paymentMethodType,
@@ -143,6 +147,10 @@ await Database.transaction(async (tx) => {
customerID,
invoiceID,
paymentID,
+ enrichment: {
+ type: "subscription",
+ couponID,
+ },
})
})