Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/newjitsu' into newjitsu
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Dec 18, 2023
2 parents 3de6949 + 4e379cc commit 31ebed7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
10 changes: 10 additions & 0 deletions webapps/console/components/Billing/BillingManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,16 @@ const CurrentSubscription: React.FC<{}> = () => {
<Edit2 className="ml-1 h-3 w-3" />
</Link>
)}
{billing.settings?.futureSubscriptionDate && (
<div className="text-textLight">
Your paid subscription starts on{" "}
{new Intl.DateTimeFormat("en-US", {
month: "long",
year: "numeric",
day: "numeric",
}).format(new Date(billing.settings?.futureSubscriptionDate))}
</div>
)}
</div>
</div>
<div>
Expand Down
2 changes: 2 additions & 0 deletions webapps/console/lib/schema/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ export const BillingSettings = z.object({
destinationEvensPerMonth: z.number().default(200_000),
expiresAt: z.string().optional(),
renewAfterExpiration: z.boolean().default(false).optional(),
//if subscription starts some time in the future, for enterprise plans only
futureSubscriptionDate: z.string().optional(),
});

export type BillingSettings = z.infer<typeof BillingSettings>;
Expand Down
15 changes: 15 additions & 0 deletions webapps/ee-api/lib/stripe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,22 @@ export async function getOrCreateCurrentSubscription(
.log(
`Custom billing is set for workspace ${workspaceId}: ${JSON.stringify(stripeOptions.customBilling, null, 2)}`
);

const startDate = new Date(stripeOptions.customBilling.start + "T00:00:00Z");
getLog().atInfo().log(`Subscription start date for workspace ${workspaceId}: ${startDate.toISOString()}`);
if (startDate.getTime() > new Date().getTime()) {
getLog()
.atInfo()
.log(`Subscription start date for workspace ${workspaceId}: ${startDate.toISOString()} - future`);
return {
stripeCustomerId: stripeOptions.stripeCustomerId,
subscriptionStatus: {
//customBilling: true,
planId: "free",
futureSubscriptionDate: startDate,
},
};
}
const startDay = startDate.getUTCDate();
const currentDay = new Date().getUTCDate();
const expiresAt = new Date();
Expand Down

1 comment on commit 31ebed7

@vercel
Copy link

@vercel vercel bot commented on 31ebed7 Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

new-jitsu – ./webapps/console

ag.ru
logu.au
ozon.ru
sse.ere
erxes.io
baidu.dom
sambla.se
bobsec.com
sambla.com
agro4u.life
bluetick.ai
protontv.eu
t.quenti.io
alicesec.com
d.askloan.tw
dev.aclis.io
docs.dh19.de
docs.dh19.eu
joseviso.com
mydomain.dom
t.democo.dev
t.shoppub.io
t2.jitsu.com
timeplus.com
zoopsign.com
*.d.jitsu.com
beta.mitzu.io
d.versatus.io
data.light.so
data.loudy.co
data.schej.it
dog.jitsu.com
imusician.app
imusician.pro
jitsu.logu.au
jitsu.www1.ru
t.thequack.ai
thinkr.com.br
use.jitsu.com
usepolygon.io
www.sambla.se
ajewellers.com
data.uselog.io
gpt.whatfa.com
sidetrekai.com
t.papermark.io
t.saasmonk.app
use2.jitsu.com
www.kellen.top
*.dataspecc.com
app.bluetick.ai
caddy.jitsu.com
data.askloan.tw
enterticket.com
events.mitzu.io
jitsu.efeer.com
jitsu.ivve.tech
krestomatio.com
sevenbillion.co
xrt.webxr.tools
app.jotverse.com
caddy2.jitsu.com
cname2.jitsu.com
data.mysitee.com
data.toptere.com
dev-t.democo.dev
events.quenti.io
utils.doogma.com
worthsystems.com
data.music2me.com
data.timeplus.com
event-gateway.com
https.bluetick.ai
ji.degulesider.dk
jitsu.ivve.health
metabase.erxes.io
t.clickncruise.hu
cloud.yupaopao.com
data.investing.com
data.mycompany.com
data.usepolygon.io
demosite.jitsu.com
dev.driverdeck.app
n8n.paziresh24.com
new.enterticket.es
t-dev.papermark.io
uniquecafes.com.br
www.sidetrekai.com
colectha.voolu.shop
crm.myguestcare.com
data.sidetrekai.com
data.timeplus.cloud
localhost.jitsu.com
report.improvado.io
trk.myguestcare.com
www.sevenbillion.co
analytics.mtrsvc.com
data.embeddables.com
dataqa.investing.com
mercury.stagehub.com

Please sign in to comment.