This commit is contained in:
Kenneth Jannette
2024-02-15 21:35:56 -06:00
parent d955128bbf
commit 193d642f29

View File

@@ -73,6 +73,7 @@ const SignupPage = () => {
const handleConfirmPromoCode = () => {
if (issueText === marchEmailPrm) {
setIsPromoMembership(true);
handlePromoSignup();
}
};
@@ -179,7 +180,13 @@ const SignupPage = () => {
const firmId = uuidv4();
const fbAuthUid = authId;
const plan = selectedPlan;
const docsAllowedPerMonth = selectedPlan[0].docsAllowedPerMonth;
let docsAllowedPerMonth;
if (isPromoMembership) {
docsAllowedPerMonth = 1;
} else {
docsAllowedPerMonth = selectedPlan[0].docsAllowedPerMonth;
}
const docsGenerated = 0;
@@ -417,19 +424,17 @@ const SignupPage = () => {
return;
}
//const planType = determinePlan(isAnnual, activeRadioOption);
if (dataValues) {
window.scrollTo({ top: 0, behavior: "smooth" });
setIsBusy(true);
try {
//const customerId = data.data.customerId;
const subscriptionCreated = new Date();
const subscriptionPeriodStart = subscriptionCreated;
//const subscriptionPeriodEnd = 30 days from date created
const subscriptionId = uuidv4();
const today = new Date();
const subscriptionCreated = today;
const subscriptionPeriodStart = today;
const subscriptionPeriodEnd = today.setDate(today.getDate() + 30);
const subscriptionId = `promo-${uuidv4()}`;
const isPromotionalMebership = true;
const userCredential = await createUserWithEmailAndPassword(
@@ -443,7 +448,6 @@ const SignupPage = () => {
const res = await saveUserData(
user.uid,
dataValues,
subscriptionCreated,
subscriptionPeriodStart,
subscriptionPeriodEnd,