@bolttech/server-side-next
Version:
This library was generated with [Nx](https://nx.dev).
267 lines (266 loc) • 7.79 kB
TypeScript
import { TokenSetType } from "../../common/services/auth";
import { QuoteHashStatuses, QuoteStatus, QuoteSubStatus } from "../../common/constants/quote.constants";
import { Quote, QuoteHashType, QuoteIdType } from '../../common/interface/quote.interface';
import { ORDER_STATUS } from './quote.enum';
export interface QuoteServiceInterface {
getQuoteById(quoteId: string, tokenSet?: TokenSetType): Promise<Quote>;
getQuoteByHash(h: string, x: string, tokenSet?: TokenSetType): Promise<Quote>;
getQuoteIdByHash(h: string, x: string, tokenSet?: TokenSetType): Promise<QuoteIdType>;
getQuoteHashById(quoteId: string, tokenSet?: TokenSetType): Promise<QuoteHashType>;
createQuote(quote: Quote, tokenSet?: TokenSetType): Promise<Quote>;
updateQuoteByHash(h: string, x: string, toUpdate: Quote, tokenSet?: TokenSetType): Promise<void>;
updateQuoteById(quoteId: string, toUpdate: Quote, tokenSet?: TokenSetType): Promise<Quote>;
putWithMerge(quoteId: string, toUpdate: Quote, tokenSet?: TokenSetType): Promise<Quote>;
put(key: string, value: string | Record<string, unknown> | null, quoteId: string, tokenSet?: TokenSetType): Promise<Quote>;
putMany(values: Record<string, unknown>, quoteId: string, tokenSet?: TokenSetType): Promise<Quote | undefined>;
duplicateQuote(quoteId: string, tokenSet: TokenSetType): Promise<Quote>;
updateExternalReferenceCodeToEntityUserId(externalReferenceCode: unknown, entityUserId: unknown, entityId: unknown, tokenSet?: TokenSetType): Promise<unknown>;
resetVoucher(quoteId: string, tokenSet?: TokenSetType): Promise<unknown>;
hasInsuredPolicy(quoteId: string, tokenSet?: TokenSetType): Promise<unknown>;
}
export interface Applicant {
email?: string;
firstName?: string;
lastName?: string;
phoneNumber?: string;
gender?: string;
title?: string;
idNumber?: string;
dateBirth?: string;
}
export interface Refund {
readonly agentCommissionValue: number;
readonly newOrderTotal: number;
readonly refundedValue: number;
}
export interface Voucher {
applied: boolean;
applyOverTaxes: boolean;
discountType: string;
value: number;
}
export interface QuoteSession {
deviceType?: string;
id?: string;
userAgent?: string;
}
export interface ScoreForm {
crossSell: Record<string, unknown>;
questionnaire: Record<string, unknown>;
transactionId: string;
upSell: Record<string, unknown>;
}
export interface Certificate {
address: string;
address2?: string;
district: string;
province: string;
sameAddressCertificate: boolean;
}
export interface CrmDetails {
details: CrmDetailsInsuredPerson[];
locale: string;
}
export interface CrmDetailsInsuredPerson {
fields: CrmDetailsInsuredPersonField[];
insuredPersonNumber: number;
}
export interface CrmDetailsInsuredPersonField {
name: string;
value: string;
}
export interface CrossSell {
previousQuoteId: string;
}
export interface Currency {
country: string;
currency: string;
currencySymbol?: string;
}
export interface Customer {
customerId?: string;
email?: string;
firstName?: string;
lastName?: string;
mobileNumber?: string;
}
export interface Employees {
annualIncome: number;
firstName: string;
jobNature: string;
}
export interface HasLinkedCustomer {
status: true;
updatedAt?: Date;
}
export interface Lead {
created: boolean;
externalId: string;
offline: boolean;
reference: string;
}
export interface Order<T> extends Currency {
agentCommissionOfferedEarned: number;
agentCommissionOfferedValue: number;
agentCommissionValue: number;
customerTotal: number;
discountTaxValue: number;
discountValue: number;
externalReference: string;
formatted: T;
otp: {
status: boolean;
phoneNumber: string;
};
partnerCode: string;
partnerPrice: number;
paymentAction?: {
action: string;
data: string;
};
paymentStatus: string;
paymentStatusUpdatedAt?: string;
priceWithDiscount: number;
status: ORDER_STATUS;
total: number;
originalPrice: number;
voucher: Voucher;
}
export interface QuoteResponse<T> {
result: T;
status: boolean;
statusCode?: number;
message?: string;
}
export interface GetQuoteIdByHashType {
h: string;
x: number;
quoteId: string;
status: string;
createdAt: Date;
updatedAt: Date;
}
export interface QuoteTaxInformation {
accountNumber: string;
address: string;
address2?: string;
companyName: string;
district?: string;
fullName: string;
province?: string;
taxCode: string;
}
export interface QuoteStatusByUserType {
[key: string]: QuoteStatus;
}
export interface QuoteSubStatusByUserType {
[key: string]: QuoteSubStatus;
}
export interface QuoteHashStatus {
[key: string]: QuoteHashStatuses;
}
export interface SubStatus {
LICENSED: QuoteSubStatusByUserType;
UNLICENSED: QuoteSubStatusByUserType;
}
export interface QuoteRenewalDetails {
cycle?: number;
originalLeadId?: string;
previousQuoteCoverageEnd?: string;
previousQuoteId?: string;
sentEmails?: QuoteRenewDetailsSentEmails[];
}
export interface QuoteRenewDetailsProduct {
code: string;
}
export interface QuoteRenewDetailsSentEmails {
messageType: string;
sentAt: string;
}
export interface QuoteRecurrenceDetails {
activation?: QuoteRecurrenceActivation;
instanceSid?: string;
isRecurrenceEnabled?: boolean;
nextDate?: string;
optOutURL?: string;
recurringId?: string;
refreshToken?: string;
}
export interface QuoteRecurrenceActivation {
amount?: number;
refunded?: boolean;
refundedAt?: Date;
}
export interface QuoteOauth {
accountId?: string;
lastInteraction?: string;
permissions?: string[];
roles?: string[];
routes?: Record<string, unknown>[];
status?: string;
sub?: string;
user?: Record<string, unknown>;
username?: string;
}
export interface QuoteHash {
expiresAt?: Date;
h: string;
quoteId?: string;
renewalCode?: string;
status?: QuoteHashStatuses;
x: number;
}
export interface PolicyStatus {
readonly code: string;
readonly createdAt: Date;
readonly message: string;
}
export interface PlanState {
id: string;
internalId: string;
planId: string;
planName: string;
price: PlanPrices;
productId: string;
recurrenceDetails?: {
type: 'subscription' | 'renewal';
optional: boolean;
};
travelPlan: string;
vehicle: object;
metaData: Record<string, unknown>;
}
export interface PlanPrices {
agentCommissionOfferedValue: number;
agentCommissionRaw: number;
agentCommissionType: string;
agentCommissionValue: number;
agentRetainsCommission: boolean;
discountTaxValue: number;
discountValue: number;
eciLevy?: number;
finalPrice: number;
iaLevy?: number;
mib?: number;
originalPrice: number;
otherLevies?: number;
partnerPrice: number;
providerPriceWithoutTax: number;
providerTax: number;
stampDuty?: number;
terrorCharge?: number;
vat?: number;
}
export interface Partner {
agentId?: string | number;
expires?: {
date?: Date;
paymentExpire?: boolean;
};
filters?: unknown;
isOldSession?: boolean;
platinum?: boolean;
scope?: string;
source?: string;
transaction?: unknown;
}