@perkforce/tool-kit
Version:
Perkforce Tool Kit, specifically developed for perkforce in house development and testing.
1,497 lines (1,466 loc) • 153 kB
TypeScript
import { IPaginationOptions, PermissionCheckModeEnum as PermissionCheckModeEnum$1, IHasRequiredPermissions as IHasRequiredPermissions$1 } from 'zaions-tool-kit';
import moment from 'moment';
declare enum UserTypeEnum {
merchant = "merchant",
employer = "employer",
employee = "employee",
studentBody = "studentBody",
admin = "admin",
all = "all",
madeByMe = "madeByMe",
owner = "owner",
superUser = "superUser",
standardUser = "standardUser",
invalid = "invalid"
}
declare enum StatusEnum {
draft = "draft",
approved = "approved",
live = "live",
scheduled = "scheduled",
ended = "ended",
endingSoon = "endingSoon",
pendingApproval = "pendingApproval",
disapproved = "disapproved",
invalid = "invalid",
pending = "pending",
accepted = "accepted",
paused = "paused",
available = "available",
verified = "verified",
unverified = "unverified",
active = "active",
inactive = "inactive",
deprecated = "deprecated",
added = "added",
invited = "invited",
signedUp = "signedUp",
completed = "completed",
failed = "failed",
inProgress = "inProgress",
processing = "processing"
}
declare enum BrandLogoEnum {
noLogo = "noLogo",
usePerkLogo = "usePerkLogo",
useProfileLogo = "useProfileLogo"
}
declare enum OrderTypeEnum {
purchased = "purchased",
free = "free"
}
declare enum UnavailableItemTypeEnum {
outOfStock = "outOfStock",
perUserLimitReached = "perUserLimitReached",
draft = "draft",
scheduled = "scheduled",
expired = "expired",
deleted = "deleted"
}
declare enum GroupTypeEnum {
superUsers = "superUsers",
allUsers = "allUsers",
normal = "normal"
}
declare enum FormModeEnum {
add = "add",
edit = "edit",
list = "list"
}
declare enum AllowedAccessBecauseEnum {
manual = "manual",
emailFormat = "emailFormat",
newSignupsEmployees = "newSignupsEmployees"
}
declare enum PlatformEnum {
android = "android",
ios = "ios",
web = "web"
}
declare enum ValidationRuleEnum {
string = "string",
email = "email",
password = "password",
positiveInt = "positiveInt",
url = "url"
}
declare enum TestAccountsTypeEnum {
internal = "internal",
external = "external"
}
declare enum IntegrationAppEnum {
microsoftTeams = "microsoftTeams",
slack = "slack",
stripe = "stripe",
pushNotifications = "pushNotifications"
}
declare enum IntegrationStateEnum {
enabled = "enabled",
disabled = "disabled",
notConnected = "notConnected"
}
declare enum PerkActionEnum {
addEdit = "addEdit",
pubUnPub = "pubUnPub",
sendForApproval = "sendForApproval"
}
declare enum SortOrderEnum {
ascend = "ascend",
descend = "descend"
}
declare enum LocationTypeEnum {
point = "Point",
lineString = "LineString",
polygon = "Polygon",
multiPoint = "MultiPoint"
}
declare enum ButtonTypeEnum {
primary = "primary",
dashed = "dashed",
default = "default",
link = "link",
text = "text"
}
declare enum ButtonVariantEnum {
link = "link",
text = "text",
dashed = "dashed",
outlined = "outlined",
solid = "solid",
filled = "filled"
}
declare enum ButtonColorEnum {
default = "default",
danger = "danger",
primary = "primary",
blue = "blue",
purple = "purple",
cyan = "cyan",
green = "green",
magenta = "magenta",
pink = "pink",
red = "red",
orange = "orange",
yellow = "yellow",
volcano = "volcano",
geekBlue = "geekblue",
lime = "lime",
gold = "gold"
}
declare enum NotificationPermissionsEnum {
granted = "granted",
denied = "denied",
default = "default"
}
declare enum CaptureMethodEnum {
automatic = "automatic",
manual = "manual"
}
declare enum ButtonSizeEnum {
small = "small",
middle = "middle",
large = "large"
}
declare enum FlexAlignEnum {
flexStart = "flex-start",
center = "center",
flexEnd = "flex-end"
}
declare enum FlexJustifyEnum {
flexStart = "flex-start",
center = "center",
flexEnd = "flex-end",
spaceBetween = "space-between",
spaceAround = "space-around",
spaceEvenly = "space-evenly"
}
declare enum CustomCategoryImageTypeEnum {
svg = "svg",
other = "other"
}
declare enum SelectedCategoryTypeEnum {
category = "category",
subcategory = "subcategory"
}
declare enum ImportRedeemCodesTypeEnum {
file = "file",
csv = "csv"
}
declare enum RedeemCodeTypeEnum {
file = "file",
url = "url",
text = "text"
}
declare enum PlatformTypeEnum {
web = "web",
android = "android",
ios = "ios"
}
declare enum ApiResponseStatusEnum {
success = "success",
error = "error"
}
declare enum PermissionCheckModeEnum {
every = "every",
any = "any"
}
declare enum EnvironmentTypeEnum {
frontend = "frontend",
backend = "backend"
}
declare enum DataStoredFromEnum {
mobileBrowser = "mobileBrowser",
mobileApp = "mobileApp"
}
declare enum BudgetStatusEnum {
notClaimed = "notClaimed",
requested = "requested",
granted = "granted",
rejected = "rejected",
expired = "expired",
refunded = "refunded"
}
declare enum PerkTypeEnum {
perk = "perk",
benefit = "benefit"
}
declare enum FormActionEnum {
add = "add",
update = "update"
}
declare enum QueryKeyTypeEnum {
id = "id",
roleIdentifier = "roleIdentifier",
defaultRoleForEmployer = "defaultRoleForEmployer",
defaultRoleForStudentBody = "defaultRoleForStudentBody",
defaultRoleForMerchant = "defaultRoleForMerchant",
defaultRoleForMerchantEmployee = "defaultRoleForMerchantEmployee",
defaultRoleForStudentBodyEmployee = "defaultRoleForStudentBodyEmployee",
defaultRoleForStudentBodySuperUser = "defaultRoleForStudentBodySuperUser",
defaultRoleForEmployerEmployee = "defaultRoleForEmployerEmployee",
defaultRoleForEmployerSuperUser = "defaultRoleForEmployerSuperUser",
defaultRoleForAdmin = "defaultRoleForAdmin"
}
declare enum UserLogChangeTypeEnum {
validationFailed = "validationFailed",
roleUpdate = "roleUpdate",
processingError = "processingError"
}
declare enum DateFormatEnum {
default = "default",
dateTimeWithAt = "dateTimeWithAt",
dateTimeWithDash = "dateTimeWithDash"
}
declare enum BrandCarouselSettingEffectEnum {
fade = "fade",
scrollx = "scrollx"
}
declare enum PermissionCategoryEnum {
userManagement = "userManagement",
roleManagement = "roleManagement",
perkManagement = "perkManagement",
perkApprovalManagement = "perkApprovalManagement",
permissionManagement = "permissionManagement"
}
declare enum PermissionsEnum {
viewAnyPerk = "viewAnyPerk",
deleteAnyPerk = "deleteAnyPerk",
updateAnyPerk = "updateAnyPerk",
listPerks = "listPerks",
viewPerk = "viewPerk",
canViewNonPublishedPerkOfOrganizationOwner = "canViewNonPublishedPerkOfOrganizationOwner",
canViewNonPublishedPerkOfOrganizationSuperUser = "canViewNonPublishedPerkOfOrganizationSuperUser",
canViewNonPublishedPerkOfOrganizationStandardUser = "canViewNonPublishedPerkOfOrganizationStandardUser",
createPerk = "createPerk",
updatePerk = "updatePerk",
updateOrgUserPerk = "updateOrgUserPerk",
deletePerk = "deletePerk",
deleteOrgUserPerk = "deleteOrgUserPerk",
canAddDescriptionToPerk = "canAddDescriptionToPerk",
canAddImageToPerk = "canAddImageToPerk",
canAddCustomCategoryToPerk = "canAddCustomCategoryToPerk",
canAddLogoToPerk = "canAddLogoToPerk",
canAddCategoryToPerk = "canAddCategoryToPerk",
canAddGroupsToPerk = "canAddGroupsToPerk",
canSelectOrganisationsInPerk = "canSelectOrganisationsInPerk",
canAddContactToPerk = "canAddContactToPerk",
canAddDisplayScheduleToPerk = "canAddDisplayScheduleToPerk",
canAddDiscountToPerk = "canAddDiscountToPerk",
canAddPurchasableToPerk = "canAddPurchasableToPerk",
canAddLimitsAndConstraintsToPerk = "canAddLimitsAndConstraintsToPerk",
canAddCodesToPerk = "canAddCodesToPerk",
canAddInterestToPerk = "canAddInterestToPerk",
canAddLocationsToPerk = "canAddLocationsToPerk",
canPublishPerk = "canPublishPerk",
listAllPerkApprovalRequests = "listAllPerkApprovalRequests",
listPerkApprovalRequests = "listPerkApprovalRequests",
viewAnyPerkApprovalRequest = "viewAnyPerkApprovalRequest",
viewPerkApprovalRequest = "viewPerkApprovalRequest",
rejectAnyPerkApprovalRequest = "rejectAnyPerkApprovalRequest",
rejectPerkApprovalRequest = "rejectPerkApprovalRequest",
approveAnyPerkApprovalRequest = "approveAnyPerkApprovalRequest",
approvePerkApprovalRequest = "approvePerkApprovalRequest",
listRoles = "listRoles",
viewRole = "viewRole",
createRole = "createRole",
updateRole = "updateRole",
deleteRole = "deleteRole",
canAssignRoleToUser = "canAssignRoleToUser",
canRemoveRoleFromUser = "canRemoveRoleFromUser",
canRunRoleValidatorManager = "canRunRoleValidatorManager",
canRunUserRoleBackgroundMigration = "canRunUserRoleBackgroundMigration",
canViewUserRoleBackgroundMigration = "canViewUserRoleBackgroundMigration",
assignPermissionsToRole = "assignPermissionsToRole",
removePermissionsFromRole = "removePermissionsFromRole",
listPermissions = "listPermissions",
viewPermission = "viewPermission",
createPermission = "createPermission",
updatePermission = "updatePermission",
deletePermission = "deletePermission",
deprecatePermission = "deprecatePermission",
initializePermissions = "initializePermissions"
}
declare enum FcmSendMethodEnum {
tokens = "tokens",
topics = "topics"
}
declare enum FCMTopicsEnum {
allUsers = "allUsers",
allAdmins = "allAdmins",
allEmployers = "allEmployers",
allMerchants = "allMerchants",
allStudentBodies = "allStudentBodies",
allStandardUsers = "allStandardUsers",
allSuperUsers = "allSuperUsers",
webAppUsers = "webAppUsers",
androidAppUsers = "androidAppUsers",
iosAppUsers = "iosAppUsers"
}
declare enum FirebasePushNotificationSendToEnum {
specificUsers = "specificUsers",
fcmTopics = "fcmTopics"
}
interface IGroup<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
name?: string;
slug?: string;
description?: string;
department?: string;
employerId?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
members?: Env extends EnvironmentTypeEnum.backend ? Array<any> : Array<IUser>;
createdAt?: string | Date;
type?: GroupTypeEnum;
}
interface IGetGroupsByEmployerResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getGroupsByEmployer?: {
groups?: Array<IGroup<Env>>;
count?: number;
};
}
interface IGetGroupBySlugResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getGroupBySlug?: IGroup<Env>;
}
interface IGetMembersByGroupResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getMembersByGroup?: {
members: Array<IUser<Env>>;
count?: number;
};
}
interface IGetAllowGroupDeleteResponse {
getAllowGroupDelete?: {
totalPerks?: number;
};
}
interface IInvite<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
status?: StatusEnum;
from?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
to?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
fromType?: UserTypeEnum;
toType?: UserTypeEnum;
toPaused?: boolean;
fromPaused?: boolean;
referrer?: IUser<Env>;
detailsForRecipient?: string;
toExists?: boolean;
createdAt?: string | Date;
acceptedAt?: string | Date;
deletedAt?: string | Date;
}
interface IGetEmployerMerchantInvitesResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getEmployerMerchantInvites?: {
invites?: Array<IInvite<Env>>;
count?: number;
};
}
interface IGetInviteByIdResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getInviteById?: IInvite<Env>;
}
interface IGetIsConnectedResponse {
getIsConnected?: boolean;
}
interface IGetConnectionsResponse {
getConnections?: {
connectedCount?: number;
pendingCount?: number;
};
}
interface IInviteList<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
invites?: Array<IInvite<Env>>;
count?: number;
}
interface IMerchant<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
userId?: any;
name?: string;
description?: string;
onboarded?: string;
createdAt?: string | Date;
deletedAt?: string | Date;
}
interface IMainBanner<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
logo?: string;
title?: string;
description?: string;
btnText?: string;
image?: string;
priority?: number;
onHome?: boolean;
merchantId?: Env extends EnvironmentTypeEnum.backend ? string : IMerchant<Env>;
createdAt?: string | Date;
deletedAt?: string | Date;
}
interface ICard<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
logo?: string;
description?: string;
image?: string;
merchantId?: Env extends EnvironmentTypeEnum.backend ? string : IMerchant<Env>;
priority?: number;
onHome?: boolean;
createdAt?: string | Date;
deletedAt?: string | Date;
}
interface ICardOrBannerResult<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
logo?: string;
title?: string;
description?: string;
btnText?: string;
image?: string;
merchantId?: Env extends EnvironmentTypeEnum.backend ? string : IMerchant<Env>;
priority?: number;
onHome?: boolean;
createdAt?: string | Date;
deletedAt?: string | Date;
}
interface IGetEmployeeHomeBannerInterface<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getEmployeeHomeBanner?: Array<IMainBanner<Env>>;
}
interface IGetEmployeeHomeCardsInterface<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getEmployeeHomeCards?: Array<ICard<Env>>;
}
interface IGetMerchantByIdResponse {
getMerchantById?: any;
}
interface IGetMerchantsResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getMerchants?: Array<IMerchant<Env>>;
}
interface IGetMerchantByUserIdResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getMerchantByUserId?: IMerchant<Env>;
}
interface IGetMerchantByCardIdResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getMerchantByCardId?: IMerchant<Env>;
}
interface IGetCardOrBannerResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getCardOrBanner?: ICardOrBannerResult<Env>;
}
interface IBusinessCategoryFormInput {
_id?: any;
name?: string;
createdById?: any;
iconFile?: any;
iconUrl?: string;
}
interface ISubCategory<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
name?: string;
slug?: string;
categoryId?: Env extends EnvironmentTypeEnum.backend ? string : IBusinessCategory<Env>;
order?: number;
isDefault?: boolean;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
addedBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
count?: number;
perkCount?: number;
draftCount?: number;
createdAt?: string | Date;
updatedAt?: string | Date;
deletedAt?: string | Date;
}
interface ICategoriesPerksCount<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
perksCount?: Env extends EnvironmentTypeEnum.backend ? Array<string> : string[];
}
interface IBusinessCategory<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
name?: string;
slug?: string;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
addedBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
createdAt?: string | Date;
subCategories?: Array<ISubCategory<Env>>;
subCatUser?: Array<IUser<Env>>;
order?: number;
deletedAt?: string | Date;
iconUrl?: string;
key?: number | string;
index?: number;
containPerks?: boolean;
isDefault?: boolean;
}
interface IBusinessCategoriesListForAdmin<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
categories?: Array<IBusinessCategory<Env>>;
count?: number;
}
interface IBusinessCategoriesList<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
categories?: Array<IBusinessCategory<Env>>;
count?: number;
categoriesPerksCount?: Array<ICategoriesPerksCount<Env>>;
activePerksCount?: number;
}
interface IGetBusinessCategoriesByUserResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBusinessCategoriesByUser?: IBusinessCategoriesList<Env>;
}
interface IGetBusinessCategoryBySubCategoryResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBusinessCategoryBySubCategory?: IBusinessCategory<Env>;
}
interface IGetBusinessCategoriesForAdminResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBusinessCategoriesForAdmin?: IBusinessCategoriesListForAdmin<Env>;
}
interface IPerkCategory<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
name?: string;
slug?: string;
isDefault?: boolean;
order?: number;
createdAt?: string | Date;
perkCount?: number;
draftCount?: number;
deletedAt?: string | Date;
isPopular?: boolean;
newArrival?: boolean;
key?: number | string;
}
interface IGetPerkCategoryBySlugResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getPerkCategoryBySlug?: IPerkCategory<Env>;
}
interface IPerkCategoriesList<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
perkCategories?: Array<IPerkCategory<Env>>;
count?: number;
}
interface IGetPerkCategoriesResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getPerkCategories?: IPerkCategoriesList<Env>;
}
interface ISlackAuthedUser {
id?: any;
}
interface ISlackTeam {
id?: any;
name?: string;
}
interface ISlackIncomingWebhook {
channel?: string;
channel_id?: any;
configuration_url?: string;
url?: string;
}
interface ISlackResponseMetadata {
scopes?: Array<string>;
}
interface IUserSlackData {
ok?: boolean;
app_id?: any;
authed_user?: ISlackAuthedUser;
scope?: string;
token_type?: string;
access_token?: string;
bot_user_id?: string;
team?: ISlackTeam;
enterprise?: string;
is_enterprise_install?: boolean;
response_metadata?: ISlackResponseMetadata;
}
interface ISlackWorkspaceChannel {
id?: any;
name?: string;
is_channel?: boolean;
is_group?: boolean;
is_private?: boolean;
}
interface ISlackWorkspaceTeam {
id?: any;
name?: string;
}
interface ILastSlackNotificationInfo {
slackTeam?: ISlackWorkspaceTeam;
slackChannel?: ISlackWorkspaceChannel;
}
interface ISlackNotificationsHistory<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
userId?: any;
userName?: string;
perkId?: Env extends EnvironmentTypeEnum.backend ? any : IPerk<Env>;
organizationOwnerId?: Env extends EnvironmentTypeEnum.backend ? string : IUser<Env>;
slackChannel?: ISlackWorkspaceChannel;
slackChannelName?: string;
slackTeam?: ISlackWorkspaceTeam;
createdAt?: string;
}
interface ISlackNotificationsHistoryResult<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
slackNotificationsHistory?: Array<ISlackNotificationsHistory<Env>>;
lastSlackNotificationInfo?: ILastSlackNotificationInfo;
}
interface ISlackWorkspaceChannels {
channels?: Array<ISlackWorkspaceChannel>;
team?: ISlackWorkspaceTeam;
success?: boolean;
message?: string;
}
interface ISendSlackNotification<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
success?: boolean;
message?: string;
notificationRecord?: ISlackNotificationsHistory<Env>;
}
interface IGetSlackNotificationsResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getSlackNotifications?: ISlackNotificationsHistoryResult<Env>;
}
interface IGetSlackWorkspaceChannelsResponse {
getSlackWorkspaceChannels?: ISlackWorkspaceChannels;
}
interface IGetLastUsedSlackInfoResponse {
getSlackWorkspaceChannels?: ILastSlackNotificationInfo;
}
interface ILocation {
id?: any;
lat?: number;
lng?: number;
desc?: string;
className?: string;
}
interface IRedeemCode<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
perkId?: Env extends EnvironmentTypeEnum.backend ? any : string;
userId?: Env extends EnvironmentTypeEnum.backend ? any : string;
code?: string;
url?: string;
type?: string;
expireDate?: string;
file?: File;
createdAt?: string | Date;
updatedAt?: string | Date;
}
interface IMaxAllowedPerUserEveryDays {
allowedPerUser?: number;
allowedEveryDays?: number;
}
interface IInterest {
allowed?: boolean;
email?: boolean;
}
interface IPerk<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
name?: string;
perkType?: string;
useProfileLocation?: boolean;
businessCategory?: Env extends EnvironmentTypeEnum.backend ? string : IBusinessCategory<Env>;
subCategory?: Env extends EnvironmentTypeEnum.backend ? string : ISubCategory<Env>;
perkCategory?: Env extends EnvironmentTypeEnum.backend ? string : IPerkCategory<Env>;
details: string;
website?: string;
contactName?: string;
discountCode?: string;
phoneNo?: string;
image?: string;
imageUrl?: string;
brandLogoUrl?: string;
brandLogo?: string;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
createdBySuperUser?: Env extends EnvironmentTypeEnum.backend ? string : IUser<Env>;
createdByStandardUser?: Env extends EnvironmentTypeEnum.backend ? string : IUser<Env>;
status?: StatusEnum;
brandLogoType?: BrandLogoEnum;
createdAt?: string | Date;
locations?: Array<ILocation>;
alwaysDisplay?: boolean;
displayFromDate?: string | Date;
displayUntilDate?: string | Date;
updatedAt?: string | Date;
notForGeneralPublic?: boolean;
forUserType?: string;
forUsers?: Env extends EnvironmentTypeEnum.backend ? string[] | string[] : string[];
purchasable?: boolean;
useRedeemCodes?: boolean;
totalRedeemLimitAvailable?: boolean;
hasMaxAllowedPerUser?: boolean;
hasMaxAllowedPerUserEveryDays?: boolean;
maxAllowedPerUserEveryDays?: IMaxAllowedPerUserEveryDays;
maxAllowedPerUserEveryDaysPassed?: number;
value?: number;
totalRedeemLimit?: number;
maxAllowedPerUser?: number;
autoRedeemCodes?: boolean;
deletedAt?: string;
perkClicksCount?: number;
slackNotificationsHistory?: Array<ISlackNotificationsHistory<Env>>;
lastSlackNotificationInfo?: ILastSlackNotificationInfo;
forGroups?: Env extends EnvironmentTypeEnum.backend ? string[] | string[] : string[];
perkDetailsText?: string;
interest?: IInterest;
currentUserInterestRegistered?: boolean;
scheduledStatus?: StatusEnum;
startDate?: string;
endDate?: string;
action?: PerkActionEnum;
sendSlackNotification?: boolean;
sendMicrosoftTeamsNotification?: boolean;
userSubDomain?: string;
perkLocations?: {
type?: LocationTypeEnum;
coordinates?: Array<ILocation>;
};
isAlwaysAvailable?: boolean;
displayNow?: boolean;
createdById?: any;
}
interface IPerkForm<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> extends Partial<IPerk<Env>> {
allowedPerUser?: number;
allowedEveryDays?: number;
}
interface IPerkList<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
perks?: Array<IPerk<Env>>;
count?: number;
}
interface IPerkManagement {
step?: FormModeEnum;
searchQuery?: {
value?: string;
trigger?: boolean;
};
userTypeFilter?: string | null;
purchasableFilter?: boolean;
status?: string | null;
showReferralModal?: boolean;
showInviteModal?: boolean;
showPageOptions?: boolean;
processing?: boolean;
}
interface IGetPerksByUserResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getPerksByUser?: {
perks?: Array<IPerk<Env>>;
count?: number;
perksPerPage?: number;
isValidCategory?: boolean;
isValidSubCategory?: boolean;
};
}
interface IGetPerkByIdResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getPerkById?: {
perk?: IPerk<Env>;
perkRedeemCodes?: IRedeemCode<Env>;
userAllowanceReached?: boolean;
};
}
interface IGetAllowPerkDeleteResponse {
getAllowPerkDelete?: boolean;
}
interface IGetAllowPerkRedeemResponse {
getAllowPerkRedeem?: boolean;
}
interface IGetPurchasablePerksResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getPurchasablePerks?: Array<IPerk<Env>>;
}
interface IAdminGetPerksResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
adminGetPerks?: IPerkList<Env>;
}
interface IGetBrandPerksResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBrandPerks?: IPerkList<Env>;
}
interface IGetSuperUserPerksResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getSuperUserPerks?: Array<IPerk<Env>>;
}
interface IGetPerksByUserReq {
status?: null | StatusEnum;
searchQuery?: string;
offset?: number;
limit?: number;
categoryId?: any;
categorySlug?: string;
subCategoryId?: any;
subCategorySlug?: string;
userType?: null | UserTypeEnum;
purchasableFilter?: boolean;
}
interface IMsTeamsApp {
processed?: boolean;
inMicrosoftTeams?: boolean;
errorOccurred?: boolean;
errorMessage?: string;
microsoftTeamsContext?: any;
}
interface IMSTeamsData {
expiresOn?: Date;
msTeamAppLog?: string;
accessToken?: string;
refreshToken?: string;
refreshTokenAt?: Date;
isConnected?: boolean;
}
interface IMSTeamsTeam {
id?: any;
displayName?: string;
internalid?: any;
webUrl?: string;
isArchived?: boolean;
visibility?: string;
}
interface IMSTeamsChannel {
id?: any;
displayName?: string;
webUrl?: string;
membershipType?: string;
}
interface IMSTeamsAppLogs<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
name?: string;
userId?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
userEmail?: string;
oldRefreshToken?: string;
accessToken?: string;
refreshToken?: string;
expiresOn?: string | Date;
oldConDetails?: {
accessToken?: string;
refreshToken?: string;
expiresOn?: string | Date;
lastUpdatedAt?: string | Date;
updateCount?: number;
msTeamAppLog?: Env extends EnvironmentTypeEnum.backend ? any : string;
};
time?: string | Date;
}
interface IMSTeamsNotificationsHistory<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
userId?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
userName?: string;
userType?: UserTypeEnum;
perkId?: Env extends EnvironmentTypeEnum.backend ? any : IPerk<Env>;
perkTitle?: string;
organizationOwnerId?: any;
userIsTheOrganizationOwner?: boolean;
categoryName?: string;
categoryLink?: string;
msChannel?: IMSTeamsChannel;
msTeam?: IMSTeamsTeam;
createdAt?: string | Date;
}
interface ILastMSTeamsNotificationInfoResult {
msTeamsTeam?: IMSTeamsTeam;
msTeamsChannel?: IMSTeamsChannel;
}
interface IMSTeamsNotificationsHistoryResult<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
msTeamsNotificationsHistory?: Array<IMSTeamsNotificationsHistory<Env>>;
lastMSTeamsNotificationInfo?: ILastMSTeamsNotificationInfoResult;
}
interface IMSTeamsGetJoinedTeams {
message?: string;
success?: boolean;
joinedTeams?: Array<IMSTeamsTeam>;
}
interface MSTeamsSelectedTeamChannelsResult {
message?: string;
success?: boolean;
channels?: Array<IMSTeamsChannel>;
}
interface IMicrosoftTeamsNotificationSend<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
message?: string;
success?: boolean;
notificationRecord?: IMSTeamsNotificationsHistory<Env>;
}
interface IGetMSTeamsNotificationsHistoryResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getMSTeamsNotificationsHistory?: IMSTeamsNotificationsHistoryResult<Env>;
}
interface IGetMSTeamsUserJoinedTeamsResponse {
getMSTeamsUserJoinedTeams?: {
message?: string;
success?: boolean;
joinedTeams: Array<IMSTeamsTeam>;
};
}
interface IGetMSTeamsSelectedTeamChannelsResponse {
getMSTeamsSelectedTeamChannels?: {
message?: string;
success?: boolean;
channels?: Array<IMSTeamsChannel>;
};
}
interface IStripeError {
code?: string;
reason?: string;
requirement?: string;
}
interface IUserStripeData {
accountId?: any;
disabled_reason?: string;
errors?: Array<IStripeError>;
enabled?: boolean;
}
interface ICreateAccountResult {
url?: string;
success?: boolean;
message?: string;
}
interface Loc {
id?: any;
lat?: number;
lng?: number;
desc?: string;
}
interface IProfileFormInput {
companyName?: string;
websiteUrl?: string;
employees?: string;
description?: string;
logo?: Buffer;
brandLogo?: Buffer;
brandLogoUrl?: string;
headerLogo?: Buffer;
imageUrl?: string;
headerImageUrl?: string;
locations?: Array<ILocation>;
firstName?: string;
lastName?: string;
phoneNo?: string;
}
interface EditProfileResult<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.backend> {
success?: boolean;
message?: string;
user?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
}
interface IPerkUsed<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
perk?: Env extends EnvironmentTypeEnum.backend ? any : IPerk;
used?: string;
}
interface IUser<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
stripeCustomerIds?: {
customerid?: any;
customerId?: any;
sellerId?: string;
}[];
firstName?: string;
lastName?: string;
type?: UserTypeEnum;
email?: string;
phoneNo?: string;
code?: string | number;
codeGenAt?: string | Date | number;
companyName?: string;
verified?: boolean;
active?: boolean;
action?: string;
stripe?: IUserStripeData;
merchant?: IMerchant<Env>;
employer?: IUser<Env>;
createdAt?: string | Date;
isLoggedIn?: boolean;
lastSignIn?: string | Date;
restrictAccess?: boolean;
suspended?: boolean;
onboarding?: boolean;
invited?: boolean;
invitedBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
invite?: IInvite;
vanityUrl?: string;
skipPhoneStep?: boolean;
skipAccountTypeStep?: boolean;
phoneAttempts?: number;
lastPhoneAttempt?: string | Date;
logo?: string;
headerLogo?: string;
brandLogo?: string;
isSuperUser?: boolean;
employeesLandingCategory?: EmployeesLandingCategory;
waitingApproval?: boolean;
employerId?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
distance?: string;
region?: boolean;
employerUserData?: IUser<Env>;
deletedAt?: string | Date;
termsAndConditionsAccepted?: boolean;
termsAndConditionsAcceptedAt?: Array<string | Date>;
codeRetries?: number;
stripeAppFeePercent?: number;
perksUsed?: Array<IPerkUsed<Env>>;
perksUsedEveryDays?: Array<IPerkUsed<Env>>;
allowStripeConnection?: boolean;
allowCarousel?: boolean;
perksPerBusiness?: number;
carouselItemsPerBusiness?: number;
perksPerCompany?: number;
benefitsPerCompany?: number;
slackConnectionDetails?: IUserSlackData;
isActive?: boolean;
lastActiveTime?: string | Date | number;
allowSlackConnection?: boolean;
orderEmailRecipient?: boolean;
groups?: Array<IGroup<Env>>;
status?: string;
allowedAccessBecause?: AllowedAccessBecauseEnum;
allowedAccessEmailFormat?: string;
completedByAdminAt?: string | Date | number;
allowMSTeamsConnection?: boolean;
msTeamsConDetails?: IMSTeamsData;
organization_unique_hash?: any;
tinyMceFolderName?: string;
microsoftTeamsIntegrationState?: IntegrationStateEnum;
slackIntegrationState?: IntegrationStateEnum;
stripeIntegrationState?: IntegrationStateEnum;
lastLocationUpdatedAt?: string | Date | number;
fcmTokens?: IFcmDeviceToken[];
roleIdentifiers?: Array<string>;
updatedAt?: string | Date | number;
stripeCustomerid?: any;
websiteUrl?: string;
employees?: string;
description?: string;
locations?: Array<Loc>;
lastSlackNotificationInfo?: ILastSlackNotificationInfo;
allowPushNotifications?: boolean;
pushNotificationsIntegrationState?: IntegrationStateEnum;
}
type IPfFoBUser = IUser<EnvironmentTypeEnum.backend> | IUser<EnvironmentTypeEnum.frontend>;
interface IFcmDeviceToken {
token?: string;
addedAt?: string;
updatedAt?: string;
platform?: PlatformTypeEnum;
}
interface EmployeesLandingCategory {
isDefault?: boolean;
categoryId?: any;
categorySlug?: string;
}
interface IUserWithToken<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
token?: string;
user?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
success?: boolean;
message?: string;
noEmail?: boolean;
vanityVerified?: string;
codeRetriesLimitReached?: boolean;
activationLink?: string;
}
interface IJWT {
token?: string;
success?: boolean;
message?: string;
}
interface IImpersonateResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
success?: boolean;
message?: string;
token?: string;
user?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
adminToken?: string;
}
interface IBudgetAndBalance {
budget?: string;
balance?: string;
}
interface IUsersList<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
users?: Env extends EnvironmentTypeEnum.backend ? Array<string> : IUser<Env>[];
count?: number;
}
interface ICompaniesAndBusinessWithInvitesList<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
users?: Env extends EnvironmentTypeEnum.backend ? Array<string> : IUser<Env>[];
count?: number;
}
interface IGetUserResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getUser?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
}
interface IGetUserByIdResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getUserById?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
}
interface IGetBrandUserResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBrandUser?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
}
interface IGetUsersResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getUsers?: IUsersList<Env>;
}
interface IRenewTokenResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
renewToken?: IUserWithToken<Env>;
}
interface IResendCodeResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
resendCode?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
}
interface IGetHeaderImageResponse {
getHeaderImage?: string;
}
interface IGetBudgetAndBalanceResponse {
getHeaderImage?: IBudgetAndBalance;
}
interface IGetCompaniesAndBusinessWithInvitesResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getCompaniesAndBusinessWithInvites?: ICompaniesAndBusinessWithInvitesList<Env>;
}
interface IGetAllCompaniesAndBusinessWithInvitesResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getAllCompaniesAndBusinessWithInvites?: ICompaniesAndBusinessWithInvitesList<Env>;
}
interface IAdminSearchUserResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
adminSearchUser?: {
users?: Array<IUser<Env>>;
count?: number;
success?: boolean;
message?: string;
};
}
interface IUserInputFormData {
firstName?: string;
lastName?: string;
email?: string;
phoneNo?: string;
verified?: boolean;
type?: UserTypeEnum;
active?: boolean;
social?: boolean;
action?: string;
isMobile?: boolean;
onboarding?: boolean;
vanityUrl?: string;
waitingApproval?: boolean;
imageUrl?: string;
phoneAttempts?: number;
fbToken?: string;
fbid?: any;
fbId?: any;
signUp?: boolean;
}
interface ISortOptions {
field?: string;
order?: SortOrderEnum;
}
interface IContext {
user?: IUser<EnvironmentTypeEnum.backend>;
userId?: any;
userPermissions?: PermissionsEnum[];
impersonation?: boolean;
token?: string;
}
interface ApiResponse {
success?: boolean;
message?: string;
code?: string;
errors?: {
[key: string]: string[];
} | null;
error?: any | null;
data?: any | null;
statusCode?: number;
}
interface IFilterOptions {
field?: string;
values?: string[];
}
interface IFirebasePushNotification {
title?: string;
body?: string;
icon?: string;
image?: string;
}
interface updatePushNotificationDeviceTokenInput {
token?: string;
platform?: PlatformTypeEnum;
}
interface sendPushNotificationInput {
notification?: IFirebasePushNotification;
sendTo?: FirebasePushNotificationSendToEnum;
specificUsersEmails?: string[];
fcmTopics?: string[];
}
interface IPushNotificationFcmTopic {
_id?: any;
identifier?: string;
description?: string;
createdAt?: Date | string;
updatedAt?: Date | string;
}
interface IApiResponseBase {
status?: ApiResponseStatusEnum;
success?: boolean;
}
interface ISendErrorResponseProps {
errors?: any;
error?: any;
message?: string;
[key: string]: any;
}
interface ISendSuccessResponseProps<T = any> {
data?: T;
message?: string;
[key: string]: any;
}
interface IApiResponse<T = any> extends IApiResponseBase {
message?: string;
data?: T;
errors?: any;
error?: any;
extra?: any;
}
interface IBenefitCategoryIconCommon {
title: string;
keywords: string;
enabled: boolean;
}
interface IBenefitCategoryIconInput extends IBenefitCategoryIconCommon {
iconFile: Buffer;
}
interface IBenefitCategoryIconsData<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> extends Partial<IBenefitCategoryIconCommon> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
title?: string;
keywords?: string;
enabled?: boolean;
iconUrl?: string;
userId?: any;
createdAt?: string | Date;
updatedAt?: string | Date;
}
interface IGetBenefitCategoryIconsResponse {
getBenefitCategoryIcons?: IBenefitCategoryIcons;
}
interface IBenefitCategoryIcons<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
data?: Array<IBenefitCategoryIconsData<Env>>;
count?: string;
canLoadMore?: boolean;
success?: boolean;
message?: string;
}
interface ICategoriesFormInput<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> extends IBenefitCategoryIconsData<Env> {
icon?: File | null;
previewUrl?: string;
}
interface IBenefitClickItem<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
count?: string;
benefit?: Env extends EnvironmentTypeEnum.backend ? any : IPerk<Env>;
employeeId?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
benefitCreatedBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
createdAt?: string | Date;
}
interface IGetBenefitClicksResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBenefitClicks?: IBenefitClicksList<Env>;
}
interface IBenefitClicksList<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
benefitClicks?: Array<IBenefitClickItem<Env>>;
count?: string;
}
interface IBlockEmailExpression<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
expression?: string;
createdAt?: string | Date;
deletedAt?: string | Date;
}
interface IAdminGetBlockEmailExpressionsResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
adminGetBlockEmailExpressions?: IBlockEmailExpressionList<Env>;
}
interface IBlockEmailExpressionList<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
blockEmailExpressions?: Array<IBlockEmailExpression<Env>>;
count?: number;
}
interface IBrandCarouselItem<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
details?: string;
image?: string;
perk?: Env extends EnvironmentTypeEnum.backend ? any : IPerk<Env>;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
createdAt?: string | Date;
deletedAt?: string | Date;
}
interface IGetBrandCarouselItemsResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBrandCarouselItems?: Array<IBrandCarouselItem<Env>>;
}
interface IGetPerksForCarouselResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getPerksForCarousel?: IPerkList<Env>;
}
interface IBrandCarouselSetting<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
autoplay?: boolean;
autoplaySpeed?: number;
effect?: BrandCarouselSettingEffectEnum;
dots?: boolean;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
deletedAt?: string | Date;
arrows?: boolean;
fade?: boolean;
}
interface IGetBrandCarouselSettingResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBrandCarouselSetting?: IBrandCarouselSetting<Env>;
}
interface IUpdateBrandCarouselSettingResult {
success?: boolean;
message?: string;
limitReached?: number;
}
interface IBudget<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
expiry?: string;
onlyEmployerApproval?: boolean;
budgetEntries?: Array<IBudgetDetail>;
total?: number;
stripeFee?: number;
totalAmount?: number;
amountToBeApproved?: number;
amountApproved?: number;
paymentIntentCaptured?: boolean;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
createdAt?: string | Date;
deletedAt?: string | Date;
}
interface IBudgetDetail<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
id?: Env extends EnvironmentTypeEnum.backend ? any : string;
budget?: IBudget<Env>;
claim?: IBudgetClaim<Env>;
amount?: number;
createdFor?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
createdAt?: string | Date;
deletedAt?: string | Date;
}
interface IBudgetClaim<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
budgetEntry?: IBudgetDetail<Env>;
amountApproved?: number;
receipt?: String;
comment?: String;
amountRequested?: number;
status?: BudgetStatusEnum;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
createdAt?: string | Date;
deletedAt?: string | Date;
}
interface IBudgetDetailPagination<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
total?: number;
budgetsDetail?: Array<IBudgetDetail<Env>>;
}
interface IGetBudgetAmountByUserResponse {
getBudgetAmountByUser?: number;
}
interface IGetBudgetDetailByIdResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBudgetDetailById?: IBudgetDetail<Env>;
}
interface IGetBudgetsDetailByUserResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBudgetsDetailByUser?: IBudgetDetailPagination<Env>;
}
interface IBusinessCategoryClickItem<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
count?: number;
businessCategory?: IBusinessCategory<Env>;
employer?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
}
interface IGetBusinessCategoryClicksResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getBusinessCategoryClicks?: IBusinessCategoryClicksList<Env>;
}
interface IBusinessCategoryClicksList<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
businessCategoryClicks?: Array<IBusinessCategoryClickItem<Env>>;
count?: number;
}
interface ICarouselItem<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
name?: string;
details?: string;
image?: string;
perk?: Env extends EnvironmentTypeEnum.backend ? any : IPerk<Env>;
order?: number;
createdBy?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
createdAt?: string | Date;
}
interface IGetCarouselItemsResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getCarouselItems?: Array<ICarouselItem<Env>>;
}
interface ICartItem<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
perk?: Env extends EnvironmentTypeEnum.backend ? any : IPerk<Env>;
quantity?: number;
price?: number;
usedByCurrentUser?: number;
usedEveryDaysByCurrentUser?: number;
perkCopy?: Env extends EnvironmentTypeEnum.backend ? any : IPerk<Env>;
is_deleted?: boolean;
}
interface ICart<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
user?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
business?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
items?: Array<ICartItem<Env>>;
total?: number;
}
interface IUnavailableItem<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
perk?: Env extends EnvironmentTypeEnum.backend ? any : IPerk<Env>;
perkCopy?: Env extends EnvironmentTypeEnum.backend ? any : IPerk<Env>;
type?: string;
remaining?: number;
}
interface ICheckoutResult<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
url?: string;
success?: boolean;
message?: string;
unavailableItems?: Array<IUnavailableItem<Env>>;
}
interface IAddCartItemResult {
success?: boolean;
message?: string;
showHomeButton?: boolean;
}
interface ICartItemLimitReached {
success?: boolean;
message?: string;
limitReached?: boolean;
}
interface ICartItemLimitReachedResponse {
cartItemLimitReached?: ICartItemLimitReached;
}
interface IGetCartResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getCart?: ICart<Env>;
}
interface IGetCheckoutSessionResponse {
getCheckoutSession?: any;
}
interface ICompaniesData<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
data?: Array<IUser<Env>>;
success?: boolean;
message?: string;
}
interface ICompaniesForMerchantPerkRedeem {
data?: {
_id?: any;
email?: string;
companyName?: string;
};
success?: boolean;
message?: string;
}
interface IGetCompaniesForMerchantPerkRedeemResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getCompaniesForMerchantPerkRedeem?: ICompaniesData<Env>;
}
interface IGetCompaniesForAdminBenefitCategoriesResponse<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
getCompaniesForAdminBenefitCategories?: ICompaniesData<Env>;
}
interface ICreditCard<Env extends EnvironmentTypeEnum = EnvironmentTypeEnum.frontend> {
_id?: Env extends EnvironmentTypeEnum.backend ? any : string;
number?: string | number;
user?: Env extends EnvironmentTypeEnum.backend ? any : IUser<Env>;
}
interface IGetCreditCardsResponse {
getCreditCards?: any;
}
interface IEmailDomain<Env extends Environ