fix: remove kyc and make text messages to attendee org only (#11389)
* add orgs upgrade badge to select * don't allow updating to if no teams or orgs plan * make sure only paying users can request verification codes * add new action helper function * remove kyc code * code clean up * fix verify button UI * fix type errors * add eventTypeRequiresConfirmation everywhere * address feedback --------- Co-authored-by: CarinaWolli <[email protected]>
This commit is contained in:
1 parent
96263b0cf7
commit
3b50fe075d
30 files changed
+89
-542
No files matched your search
@@ -9,7 +9,6 @@ import { deleteMeeting, updateMeeting } from "@calcom/core/videoClient";
|
||||
import dayjs from "@calcom/dayjs";
|
||||
import { sendCancelledEmails, sendCancelledSeatEmails } from "@calcom/emails";
|
||||
import { getCalEventResponses } from "@calcom/features/bookings/lib/getCalEventResponses";
|
||||
import { isEventTypeOwnerKYCVerified } from "@calcom/features/ee/workflows/lib/isEventTypeOwnerKYCVerified";
|
||||
import { deleteScheduledEmailReminder } from "@calcom/features/ee/workflows/lib/reminders/emailReminderManager";
|
||||
import { sendCancelledReminders } from "@calcom/features/ee/workflows/lib/reminders/reminderScheduler";
|
||||
import { deleteScheduledSMSReminder } from "@calcom/features/ee/workflows/lib/reminders/smsReminderManager";
|
||||
@@ -71,17 +70,6 @@ async function getBookingToDelete(id: number | undefined, uid: string | undefine
|
||||
select: {
|
||||
id: true,
|
||||
hideBranding: true,
|
||||
metadata: true,
|
||||
teams: {
|
||||
select: {
|
||||
accepted: true,
|
||||
team: {
|
||||
select: {
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
teamId: true,
|
||||
@@ -299,8 +287,6 @@ async function handler(req: CustomRequest) {
|
||||
);
|
||||
await Promise.all(promises);
|
||||
|
||||
const isKYCVerified = isEventTypeOwnerKYCVerified(bookingToDelete.eventType);
|
||||
|
||||
//Workflows - schedule reminders
|
||||
if (bookingToDelete.eventType?.workflows) {
|
||||
await sendCancelledReminders({
|
||||
@@ -311,7 +297,7 @@ async function handler(req: CustomRequest) {
|
||||
...{ eventType: { slug: bookingToDelete.eventType.slug } },
|
||||
},
|
||||
hideBranding: !!bookingToDelete.eventType.owner?.hideBranding,
|
||||
isKYCVerified,
|
||||
eventTypeRequiresConfirmation: bookingToDelete.eventType.requiresConfirmation,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import type { Prisma, Workflow, WorkflowsOnEventTypes, WorkflowStep } from "@pri
|
||||
import type { EventManagerUser } from "@calcom/core/EventManager";
|
||||
import EventManager from "@calcom/core/EventManager";
|
||||
import { sendScheduledEmails } from "@calcom/emails";
|
||||
import { isEventTypeOwnerKYCVerified } from "@calcom/features/ee/workflows/lib/isEventTypeOwnerKYCVerified";
|
||||
import { scheduleWorkflowReminders } from "@calcom/features/ee/workflows/lib/reminders/reminderScheduler";
|
||||
import getWebhooks from "@calcom/features/webhooks/lib/getWebhooks";
|
||||
import { scheduleTrigger } from "@calcom/features/webhooks/lib/scheduleTrigger";
|
||||
@@ -87,18 +86,8 @@ export async function handleConfirmation(args: {
|
||||
eventType: {
|
||||
bookingFields: Prisma.JsonValue | null;
|
||||
slug: string;
|
||||
team: {
|
||||
metadata: Prisma.JsonValue;
|
||||
} | null;
|
||||
owner: {
|
||||
hideBranding?: boolean | null;
|
||||
metadata: Prisma.JsonValue;
|
||||
teams: {
|
||||
accepted: boolean;
|
||||
team: {
|
||||
metadata: Prisma.JsonValue;
|
||||
};
|
||||
}[];
|
||||
} | null;
|
||||
workflows: (WorkflowsOnEventTypes & {
|
||||
workflow: Workflow & {
|
||||
@@ -135,25 +124,9 @@ export async function handleConfirmation(args: {
|
||||
select: {
|
||||
slug: true,
|
||||
bookingFields: true,
|
||||
team: {
|
||||
select: {
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
owner: {
|
||||
select: {
|
||||
hideBranding: true,
|
||||
metadata: true,
|
||||
teams: {
|
||||
select: {
|
||||
accepted: true,
|
||||
team: {
|
||||
select: {
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
workflows: {
|
||||
@@ -202,25 +175,9 @@ export async function handleConfirmation(args: {
|
||||
select: {
|
||||
slug: true,
|
||||
bookingFields: true,
|
||||
team: {
|
||||
select: {
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
owner: {
|
||||
select: {
|
||||
hideBranding: true,
|
||||
metadata: true,
|
||||
teams: {
|
||||
select: {
|
||||
accepted: true,
|
||||
team: {
|
||||
select: {
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
workflows: {
|
||||
@@ -250,8 +207,6 @@ export async function handleConfirmation(args: {
|
||||
updatedBookings.push(updatedBooking);
|
||||
}
|
||||
|
||||
const isKYCVerified = isEventTypeOwnerKYCVerified(updatedBookings[0].eventType);
|
||||
|
||||
//Workflows - set reminders for confirmed events
|
||||
try {
|
||||
for (let index = 0; index < updatedBookings.length; index++) {
|
||||
@@ -276,7 +231,6 @@ export async function handleConfirmation(args: {
|
||||
isFirstRecurringEvent: isFirstBooking,
|
||||
hideBranding: !!updatedBookings[index].eventType?.owner?.hideBranding,
|
||||
eventTypeRequiresConfirmation: true,
|
||||
isKYCVerified,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,7 +39,6 @@ import {
|
||||
allowDisablingAttendeeConfirmationEmails,
|
||||
allowDisablingHostConfirmationEmails,
|
||||
} from "@calcom/features/ee/workflows/lib/allowDisablingStandardEmails";
|
||||
import { isEventTypeOwnerKYCVerified } from "@calcom/features/ee/workflows/lib/isEventTypeOwnerKYCVerified";
|
||||
import {
|
||||
cancelWorkflowReminders,
|
||||
scheduleWorkflowReminders,
|
||||
@@ -260,7 +259,6 @@ const getEventTypesFromDB = async (eventTypeId: number) => {
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
bookingFields: true,
|
||||
@@ -292,17 +290,6 @@ const getEventTypesFromDB = async (eventTypeId: number) => {
|
||||
owner: {
|
||||
select: {
|
||||
hideBranding: true,
|
||||
metadata: true,
|
||||
teams: {
|
||||
select: {
|
||||
accepted: true,
|
||||
team: {
|
||||
select: {
|
||||
metadata: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
workflows: {
|
||||
@@ -379,7 +366,7 @@ async function ensureAvailableUsers(
|
||||
}
|
||||
) {
|
||||
const availableUsers: IsFixedAwareUser[] = [];
|
||||
const duration = dayjs(input.dateTo).diff(input.dateFrom, 'minute');
|
||||
const duration = dayjs(input.dateTo).diff(input.dateFrom, "minute");
|
||||
|
||||
const originalBookingDuration = input.originalRescheduledBooking
|
||||
? dayjs(input.originalRescheduledBooking.endTime).diff(
|
||||
@@ -1199,8 +1186,6 @@ async function handler(
|
||||
|
||||
const subscribersMeetingEnded = await getWebhooks(subscriberOptionsMeetingEnded);
|
||||
|
||||
const isKYCVerified = isEventTypeOwnerKYCVerified(eventType);
|
||||
|
||||
const handleSeats = async () => {
|
||||
let resultBooking:
|
||||
| (Partial<Booking> & {
|
||||
@@ -1769,7 +1754,7 @@ async function handler(
|
||||
isFirstRecurringEvent: true,
|
||||
emailAttendeeSendToOverride: bookerEmail,
|
||||
seatReferenceUid: evt.attendeeSeatId,
|
||||
isKYCVerified,
|
||||
eventTypeRequiresConfirmation: eventType.requiresConfirmation,
|
||||
});
|
||||
} catch (error) {
|
||||
log.error("Error while scheduling workflow reminders", error);
|
||||
@@ -2416,7 +2401,7 @@ async function handler(
|
||||
isFirstRecurringEvent: true,
|
||||
hideBranding: !!eventType.owner?.hideBranding,
|
||||
seatReferenceUid: evt.attendeeSeatId,
|
||||
isKYCVerified,
|
||||
eventTypeRequiresConfirmation: eventType.requiresConfirmation,
|
||||
});
|
||||
} catch (error) {
|
||||
log.error("Error while scheduling workflow reminders", error);
|
||||
|
||||
@@ -39,7 +39,6 @@ interface IAddActionDialog {
|
||||
senderId?: string,
|
||||
senderName?: string
|
||||
) => void;
|
||||
setKYCVerificationDialogOpen: () => void;
|
||||
}
|
||||
|
||||
interface ISelectActionOption {
|
||||
@@ -57,7 +56,7 @@ type AddActionFormValues = {
|
||||
|
||||
export const AddActionDialog = (props: IAddActionDialog) => {
|
||||
const { t } = useLocale();
|
||||
const { isOpenDialog, setIsOpenDialog, addAction, setKYCVerificationDialogOpen } = props;
|
||||
const { isOpenDialog, setIsOpenDialog, addAction } = props;
|
||||
const [isPhoneNumberNeeded, setIsPhoneNumberNeeded] = useState(false);
|
||||
const [isSenderIdNeeded, setIsSenderIdNeeded] = useState(false);
|
||||
const [isEmailAddressNeeded, setIsEmailAddressNeeded] = useState(false);
|
||||
@@ -171,14 +170,13 @@ export const AddActionDialog = (props: IAddActionDialog) => {
|
||||
onChange={handleSelectAction}
|
||||
options={actionOptions.map((option) => ({
|
||||
...option,
|
||||
verificationAction: () => setKYCVerificationDialogOpen(),
|
||||
}))}
|
||||
isOptionDisabled={(option: {
|
||||
label: string;
|
||||
value: WorkflowActions;
|
||||
needsUpgrade: boolean;
|
||||
needsVerification: boolean;
|
||||
}) => option.needsUpgrade || option.needsVerification}
|
||||
needsTeamsUpgrade: boolean;
|
||||
needsOrgsUpgrade: boolean;
|
||||
}) => option.needsTeamsUpgrade || option.needsOrgsUpgrade}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
import { Trans } from "next-i18next";
|
||||
import type { Dispatch, SetStateAction } from "react";
|
||||
|
||||
import { SUPPORT_MAIL_ADDRESS } from "@calcom/lib/constants";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { Dialog, DialogContent, DialogClose, DialogFooter } from "@calcom/ui";
|
||||
|
||||
export const KYCVerificationDialog = (props: {
|
||||
isOpenDialog: boolean;
|
||||
setIsOpenDialog: Dispatch<SetStateAction<boolean>>;
|
||||
isPartOfTeam: boolean;
|
||||
}) => {
|
||||
const { isOpenDialog, setIsOpenDialog, isPartOfTeam } = props;
|
||||
const { t } = useLocale();
|
||||
|
||||
const isTeamString = isPartOfTeam ? "team" : "";
|
||||
|
||||
return (
|
||||
<Dialog open={isOpenDialog} onOpenChange={setIsOpenDialog}>
|
||||
<DialogContent title={t("verify_team_or_account", { teamOrAccount: isTeamString || "account" })}>
|
||||
<div>
|
||||
<div className="mb-4">
|
||||
<Trans
|
||||
i18nKey="kyc_verification_information"
|
||||
components={{
|
||||
a: (
|
||||
<a
|
||||
href={`mailto:[email protected]?subject=${
|
||||
isPartOfTeam ? "Team%20Verification" : "Account%20Verification"
|
||||
}`}
|
||||
style={{ color: "#3E3E3E" }}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
/>
|
||||
),
|
||||
}}
|
||||
values={{
|
||||
supportEmail:
|
||||
SUPPORT_MAIL_ADDRESS === "[email protected]" ? "[email protected]" : SUPPORT_MAIL_ADDRESS,
|
||||
teamOrAccount: isTeamString || "account",
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<Trans
|
||||
i18nKey="kyc_verification_documents"
|
||||
components={{ li: <li />, ul: <ul className="ml-8 list-disc" /> }}
|
||||
values={{ teamOrUser: isPartOfTeam ? "team URL" : "user name" }}
|
||||
/>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<DialogClose />
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
};
|
||||
@@ -5,7 +5,6 @@ import type { UseFormReturn } from "react-hook-form";
|
||||
import { Controller } from "react-hook-form";
|
||||
|
||||
import { SENDER_ID, SENDER_NAME } from "@calcom/lib/constants";
|
||||
import { useHasTeamPlan } from "@calcom/lib/hooks/useHasPaidPlan";
|
||||
import { useLocale } from "@calcom/lib/hooks/useLocale";
|
||||
import { WorkflowTemplates } from "@calcom/prisma/enums";
|
||||
import type { WorkflowActions } from "@calcom/prisma/enums";
|
||||
@@ -19,7 +18,6 @@ import { isSMSAction, isWhatsappAction } from "../lib/actionHelperFunctions";
|
||||
import type { FormValues } from "../pages/workflow";
|
||||
import { AddActionDialog } from "./AddActionDialog";
|
||||
import { DeleteDialog } from "./DeleteDialog";
|
||||
import { KYCVerificationDialog } from "./KYCVerificationDialog";
|
||||
import WorkflowStepContainer from "./WorkflowStepContainer";
|
||||
|
||||
type User = RouterOutputs["viewer"]["me"];
|
||||
@@ -41,15 +39,12 @@ export default function WorkflowDetailsPage(props: Props) {
|
||||
const router = useRouter();
|
||||
|
||||
const [isAddActionDialogOpen, setIsAddActionDialogOpen] = useState(false);
|
||||
const [isKYCVerificationDialogOpen, setKYCVerificationDialogOpen] = useState(false);
|
||||
|
||||
const [reload, setReload] = useState(false);
|
||||
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
||||
|
||||
const { data, isLoading } = trpc.viewer.eventTypes.getByViewer.useQuery();
|
||||
|
||||
const isPartOfTeam = useHasTeamPlan();
|
||||
|
||||
const eventTypeOptions = useMemo(
|
||||
() =>
|
||||
data?.eventTypeGroups.reduce((options, group) => {
|
||||
@@ -177,7 +172,6 @@ export default function WorkflowDetailsPage(props: Props) {
|
||||
user={props.user}
|
||||
teamId={teamId}
|
||||
readOnly={props.readOnly}
|
||||
setKYCVerificationDialogOpen={setKYCVerificationDialogOpen}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
@@ -194,7 +188,6 @@ export default function WorkflowDetailsPage(props: Props) {
|
||||
setReload={setReload}
|
||||
teamId={teamId}
|
||||
readOnly={props.readOnly}
|
||||
setKYCVerificationDialogOpen={setKYCVerificationDialogOpen}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -222,12 +215,6 @@ export default function WorkflowDetailsPage(props: Props) {
|
||||
isOpenDialog={isAddActionDialogOpen}
|
||||
setIsOpenDialog={setIsAddActionDialogOpen}
|
||||
addAction={addAction}
|
||||
setKYCVerificationDialogOpen={() => setKYCVerificationDialogOpen(true)}
|
||||
/>
|
||||
<KYCVerificationDialog
|
||||
isOpenDialog={isKYCVerificationDialogOpen}
|
||||
setIsOpenDialog={setKYCVerificationDialogOpen}
|
||||
isPartOfTeam={!!isPartOfTeam.hasTeamPlan}
|
||||
/>
|
||||
<DeleteDialog
|
||||
isOpenDialog={deleteDialogOpen}
|
||||
|
||||
@@ -67,7 +67,6 @@ type WorkflowStepProps = {
|
||||
setReload?: Dispatch<SetStateAction<boolean>>;
|
||||
teamId?: number;
|
||||
readOnly: boolean;
|
||||
setKYCVerificationDialogOpen: Dispatch<SetStateAction<boolean>>;
|
||||
};
|
||||
|
||||
export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
@@ -331,15 +330,13 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
}
|
||||
|
||||
if (step && step.action) {
|
||||
const templateValue = form.watch(`steps.${step.stepNumber - 1}.template`);
|
||||
const actionString = t(`${step.action.toLowerCase()}_action`);
|
||||
|
||||
const selectedAction = {
|
||||
label: actionString.charAt(0).toUpperCase() + actionString.slice(1),
|
||||
value: step.action,
|
||||
needsUpgrade: false,
|
||||
needsVerification: false,
|
||||
verificationAction: () => props.setKYCVerificationDialogOpen(true),
|
||||
needsTeamsUpgrade: false,
|
||||
needsOrgsUpgrade: false,
|
||||
};
|
||||
|
||||
const selectedTemplate = { label: t(`${step.template.toLowerCase()}`), value: step.template };
|
||||
@@ -530,14 +527,13 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
defaultValue={selectedAction}
|
||||
options={actionOptions?.map((option) => ({
|
||||
...option,
|
||||
verificationAction: () => props.setKYCVerificationDialogOpen(true),
|
||||
}))}
|
||||
isOptionDisabled={(option: {
|
||||
label: string;
|
||||
value: WorkflowActions;
|
||||
needsUpgrade: boolean;
|
||||
needsVerification: boolean;
|
||||
}) => option.needsUpgrade || option.needsVerification}
|
||||
needsTeamsUpgrade: boolean;
|
||||
needsOrgsUpgrade: boolean;
|
||||
}) => option.needsTeamsUpgrade || option.needsOrgsUpgrade}
|
||||
/>
|
||||
);
|
||||
}}
|
||||
@@ -617,7 +613,7 @@ export default function WorkflowStepContainer(props: WorkflowStepProps) {
|
||||
/>
|
||||
<Button
|
||||
color="secondary"
|
||||
className="-ml-[3px] h-[38px] min-w-fit sm:block sm:rounded-bl-none sm:rounded-tl-none "
|
||||
className="-ml-[3px] h-[36px] min-w-fit py-0 sm:block sm:rounded-bl-none sm:rounded-tl-none "
|
||||
disabled={verifyPhoneNumberMutation.isLoading || props.readOnly}
|
||||
onClick={() => {
|
||||
verifyPhoneNumberMutation.mutate({
|
||||
|
||||
@@ -41,6 +41,9 @@ export function isAttendeeAction(action: WorkflowActions) {
|
||||
export function isTextMessageToAttendeeAction(action?: WorkflowActions) {
|
||||
return action === WorkflowActions.SMS_ATTENDEE || action === WorkflowActions.WHATSAPP_ATTENDEE;
|
||||
}
|
||||
export function isTextMessageToSpecificNumber(action?: WorkflowActions) {
|
||||
return action === WorkflowActions.SMS_NUMBER || action === WorkflowActions.WHATSAPP_NUMBER;
|
||||
}
|
||||
|
||||
export function getWhatsappTemplateForTrigger(trigger: WorkflowTriggerEvents): WorkflowTemplates {
|
||||
switch (trigger) {
|
||||
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
WORKFLOW_TRIGGER_EVENTS,
|
||||
} from "./constants";
|
||||
|
||||
export function getWorkflowActionOptions(t: TFunction, isTeamsPlan?: boolean, isKYCVerified?: boolean) {
|
||||
export function getWorkflowActionOptions(t: TFunction, isTeamsPlan?: boolean, isOrgsPlan?: boolean) {
|
||||
return WORKFLOW_ACTIONS.filter((action) => action !== WorkflowActions.EMAIL_ADDRESS) //removing EMAIL_ADDRESS for now due to abuse episode
|
||||
.map((action) => {
|
||||
const actionString = t(`${action.toLowerCase()}_action`);
|
||||
@@ -23,8 +23,9 @@ export function getWorkflowActionOptions(t: TFunction, isTeamsPlan?: boolean, is
|
||||
return {
|
||||
label: actionString.charAt(0).toUpperCase() + actionString.slice(1),
|
||||
value: action,
|
||||
needsUpgrade: isSMSOrWhatsappAction(action) && !isTeamsPlan,
|
||||
needsVerification: isTextMessageToAttendeeAction(action) && !isKYCVerified,
|
||||
needsTeamsUpgrade:
|
||||
isSMSOrWhatsappAction(action) && !isTextMessageToAttendeeAction(action) && !isTeamsPlan,
|
||||
needsOrgsUpgrade: isTextMessageToAttendeeAction(action) && !isOrgsPlan,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
import hasKeyInMetadata from "@calcom/lib/hasKeyInMetadata";
|
||||
import type { Prisma } from "@calcom/prisma/client";
|
||||
|
||||
type EventTypeOwnerType = {
|
||||
team?: {
|
||||
metadata: Prisma.JsonValue;
|
||||
} | null;
|
||||
owner?: {
|
||||
metadata: Prisma.JsonValue;
|
||||
teams: {
|
||||
accepted: boolean;
|
||||
team: {
|
||||
metadata: Prisma.JsonValue;
|
||||
};
|
||||
}[];
|
||||
} | null;
|
||||
};
|
||||
|
||||
export function isEventTypeOwnerKYCVerified(eventType?: EventTypeOwnerType | null) {
|
||||
if (!eventType) return false;
|
||||
|
||||
if (eventType.team) {
|
||||
const isKYCVerified =
|
||||
eventType.team &&
|
||||
hasKeyInMetadata(eventType.team, "kycVerified") &&
|
||||
!!eventType.team.metadata.kycVerified;
|
||||
return isKYCVerified;
|
||||
}
|
||||
|
||||
if (eventType.owner) {
|
||||
const isKYCVerified =
|
||||
eventType.owner &&
|
||||
hasKeyInMetadata(eventType.owner, "kycVerified") &&
|
||||
!!eventType.owner.metadata.kycVerified;
|
||||
if (isKYCVerified) return isKYCVerified;
|
||||
|
||||
const isPartOfVerifiedTeam = eventType.owner.teams.find(
|
||||
(team) =>
|
||||
team.accepted && hasKeyInMetadata(team.team, "kycVerified") && !!team.team.metadata.kycVerified
|
||||
);
|
||||
return !!isPartOfVerifiedTeam;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -23,7 +23,6 @@ type ProcessWorkflowStepParams = {
|
||||
emailAttendeeSendToOverride?: string;
|
||||
hideBranding?: boolean;
|
||||
seatReferenceUid?: string;
|
||||
isKYCVerified: boolean;
|
||||
eventTypeRequiresConfirmation?: boolean;
|
||||
};
|
||||
|
||||
@@ -48,11 +47,9 @@ const processWorkflowStep = async (
|
||||
hideBranding,
|
||||
seatReferenceUid,
|
||||
eventTypeRequiresConfirmation,
|
||||
isKYCVerified,
|
||||
}: ProcessWorkflowStepParams
|
||||
) => {
|
||||
if (isTextMessageToAttendeeAction(step.action) && (!isKYCVerified || !eventTypeRequiresConfirmation))
|
||||
return;
|
||||
if (isTextMessageToAttendeeAction(step.action) && !eventTypeRequiresConfirmation) return;
|
||||
|
||||
if (step.action === WorkflowActions.SMS_ATTENDEE || step.action === WorkflowActions.SMS_NUMBER) {
|
||||
const sendTo = step.action === WorkflowActions.SMS_ATTENDEE ? smsReminderNumber : step.sendTo;
|
||||
@@ -143,7 +140,6 @@ export const scheduleWorkflowReminders = async (args: ScheduleWorkflowRemindersA
|
||||
hideBranding,
|
||||
seatReferenceUid,
|
||||
eventTypeRequiresConfirmation = false,
|
||||
isKYCVerified,
|
||||
} = args;
|
||||
if (isNotConfirmed || !workflows.length) return;
|
||||
|
||||
@@ -177,7 +173,6 @@ export const scheduleWorkflowReminders = async (args: ScheduleWorkflowRemindersA
|
||||
hideBranding,
|
||||
seatReferenceUid,
|
||||
eventTypeRequiresConfirmation,
|
||||
isKYCVerified,
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -208,13 +203,11 @@ export interface SendCancelledRemindersArgs {
|
||||
smsReminderNumber: string | null;
|
||||
evt: ExtendedCalendarEvent;
|
||||
hideBranding?: boolean;
|
||||
isKYCVerified: boolean;
|
||||
eventTypeRequiresConfirmation?: boolean;
|
||||
}
|
||||
|
||||
export const sendCancelledReminders = async (args: SendCancelledRemindersArgs) => {
|
||||
const { workflows, smsReminderNumber, evt, hideBranding, isKYCVerified, eventTypeRequiresConfirmation } =
|
||||
args;
|
||||
const { workflows, smsReminderNumber, evt, hideBranding, eventTypeRequiresConfirmation } = args;
|
||||
if (!workflows.length) return;
|
||||
|
||||
for (const workflowRef of workflows) {
|
||||
@@ -228,7 +221,6 @@ export const sendCancelledReminders = async (args: SendCancelledRemindersArgs) =
|
||||
hideBranding,
|
||||
calendarEvent: evt,
|
||||
eventTypeRequiresConfirmation,
|
||||
isKYCVerified,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,6 @@ const tabs: VerticalTabItemProps[] = [
|
||||
{ name: "apps", href: "/settings/admin/apps/calendar" },
|
||||
{ name: "users", href: "/settings/admin/users" },
|
||||
{ name: "organizations", href: "/settings/admin/organizations" },
|
||||
{ name: "kyc_verification", href: "/settings/admin/kycVerification" },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user