|
|
@@ -113,8 +113,13 @@ async function printWorkspace(workspaceID: string) {
|
|
|
.select({
|
|
|
balance: BillingTable.balance,
|
|
|
customerID: BillingTable.customerID,
|
|
|
- subscriptionID: BillingTable.subscriptionID,
|
|
|
- subscriptionCouponID: BillingTable.subscriptionCouponID,
|
|
|
+ reload: BillingTable.reload,
|
|
|
+ subscription: {
|
|
|
+ id: BillingTable.subscriptionID,
|
|
|
+ couponID: BillingTable.subscriptionCouponID,
|
|
|
+ plan: BillingTable.subscriptionPlan,
|
|
|
+ booked: BillingTable.timeSubscriptionBooked,
|
|
|
+ },
|
|
|
})
|
|
|
.from(BillingTable)
|
|
|
.where(eq(BillingTable.workspaceID, workspace.id))
|
|
|
@@ -123,6 +128,11 @@ async function printWorkspace(workspaceID: string) {
|
|
|
rows.map((row) => ({
|
|
|
...row,
|
|
|
balance: `$${(row.balance / 100000000).toFixed(2)}`,
|
|
|
+ subscription: row.subscription.id
|
|
|
+ ? `Subscribed ${row.subscription.couponID ? `(coupon: ${row.subscription.couponID}) ` : ""}`
|
|
|
+ : row.subscription.booked
|
|
|
+ ? `Waitlist ${row.subscription.plan} plan`
|
|
|
+ : undefined,
|
|
|
}))[0],
|
|
|
),
|
|
|
)
|