All files / src/controllers/requestSpecs leads.ts

100% Statements 13/13
100% Branches 2/2
100% Functions 1/1
100% Lines 12/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 321x 1x       1x 1x   1x           1x       1x         1x 1x 1x       1x 1x  
import { Leads } from "../../models"
import { any, array, baseRequest, boolean, string } from "./utils"
 
 
// Leads
enum preferredContact {
  'Phone', 'Email',
}
let leadRequest = {
  description: "userUID,consultantUID,registrarUID is nothing but user ID's, we can to get these from /users API  in user controller, if we did not give user Id then it marked as current user ID",
  required: ["domainName"],
  properties: { isSurveyCompleted: boolean, domainName: string, preferText: boolean, preferredTime: string, comments: string, marketAnalysis: string, deadLine: { any }, beSeen: string, offerAmount: string, questionsAny: string, preferredContact: { type: 'string', default: "Email", enum: Object.values(preferredContact) }, userUID: string, consultantUID: string, registrarUID: string }
}
 
export const leadsReq = baseRequest({
  ...leadRequest,
  properties: { ...leadRequest.properties, userUID: string, consultantUID: string, registrarUID: string }
})
export const updateLeadReq = baseRequest({
  ...leadRequest,
  required: [],
  properties: { ...leadRequest.properties, phone: string, email: string }
})
export const leadsRes = baseRequest({ description: "list leads for the user in dashboard with related data like payment for this lead and opportunity for this leads", properties: { loadSchema: true, modelName: Leads, title: 'Lead', exclude: ['isDelete'] } })
export const getRegistrarLeadsReq = baseRequest({ description: "list  Registrar leads with filter by date range and sort by date and total columns in dashboard", properties: {} })
export const opportunitiesReq = baseRequest({ properties: { closeUID: string, leadUID: string, opportunity: [] } })
 
 
// Close Req
export const CloseCustomLeadReq = baseRequest({ properties: { name: string, description: string, type: string, choices: array, editable_with_roles: array, accepts_multiple_values: boolean }, title: 'Reset Password' })
export const webHookReq = baseRequest({ properties: {  }, title: 'Subscribe web hooks, https://developer.close.com/#webhook-subscriptions' })