max future booking days by payment plan

master
alex 2024-02-11 12:59:53 +01:00
parent 6aa1ceb3a4
commit aa53203c2d
2 changed files with 10 additions and 6 deletions

View File

@ -2,6 +2,7 @@ import { Form, Input, InputNumber, Skeleton } from "antd";
import { Constants, isEmailValid, myFetch } from "../../utils";
import { useRef } from "react";
import { useTranslation } from "react-i18next";
import { useAppContext } from "../../Contexts/AppContext";
export function MyUsernameFormInput({
propsFormItem,
@ -138,12 +139,16 @@ export function MyEmailFormInput() {
export function MyCalendarMaxFutureBookingDaysFormInput({ formItemName }) {
const { t } = useTranslation();
const appContext = useAppContext();
return (
<MyFormInput
formItemName={formItemName}
minLength={Constants.GLOBALS.MIN_CALENDAR_FUTURE_BOOKING_DAYS}
maxLength={Constants.GLOBALS.MAX_CALENDAR_FUTURE_BOOKING_DAYS}
maxLength={
Constants.PAYMENT_PLAN[appContext.paymentPlan]
.calendarMaxFutureBookingDays
}
label={t("common.calendarMaxFutureBookingDays")}
ruleMessageValueRequired={t(
"common.inputRules.calendarMaxFutureBookingDaysRequired"

View File

@ -82,9 +82,8 @@ export const Constants = {
MAX_STORE_SERVICE_ACTIVITY_PRICE: 10000000,
MIN_STORE_SERVICE_ACTIVITY_DURATION_MINUTES: 0,
MAX_STORE_SERVICE_ACTIVITY_DURATION_MINUTES: 60 * 24, // 24 hours in minutes
MIN_CALENDAR_FUTURE_BOOKING_DAYS: 0,
MAX_CALENDAR_FUTURE_BOOKING_DAYS: 365,
MIN_CALENDAR_EARLIEST_BOOKING_TIME: 0,
MIN_CALENDAR_FUTURE_BOOKING_DAYS: 1,
MIN_CALENDAR_EARLIEST_BOOKING_TIME: 15,
MAX_CALENDAR_EARLIEST_BOOKING_TIME: 60 * 24, // 24 hours in minutes
MIN_FEEDBACK_LENGTH: 10,
MAX_FEEDBACK_LENGTH: 1024,
@ -104,12 +103,12 @@ export const Constants = {
SUPPORT_EMAIL: process.env.REACT_APP_SUPPORT_EMAIL,
PAYMENT_PLAN: [
{
id: 0, // free
maxEmployees: 5,
calendarMaxFutureBookingDays: 14,
},
{
id: 1, // basic
maxEmployees: 15,
calendarMaxFutureBookingDays: 60,
},
],
};