保誠-保戶業務員媒合平台
PAMapp/assets/ts/api/consultant.ts
@@ -1,5 +1,7 @@
import { service } from '~/assets/ts/api/share';
import { AxiosResponse } from 'axios';
import { AppointmentDetail } from '../models/AppointmentDetail';
import { ConsultantLoginInfo } from '../models/ConsultantLoginInfo';
// 顧客登入(TODO: OTP認證開發前 暫時使用)
export function login(user: any) {
@@ -8,7 +10,8 @@
// 推薦保險顧問
export function recommend() {
    return service.get('/consultant/recommend')
    return service.get<Consultants[]>('/consultant/recommend')
            .then(res => res.data);
}
// 我的顧問清單
@@ -16,7 +19,8 @@
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.get('/consultant/favorite', {headers});
    return service.get<Consultants[]>('/consultant/favorite', {headers})
            .then(res => res.data);
}
// 快速篩選
@@ -25,7 +29,7 @@
}
// 嚴選配對
export function strictQuery(data:StrictQueryParams):Promise<AxiosResponse<AgentOfStrictQuery>>{
export function strictQuery(data:StrictQueryParams):Promise<AxiosResponse<AgentOfStrictQuery[]>>{
    return service.post('/consultant/strictQuery', data)
}
@@ -50,6 +54,40 @@
    return service.get('/consultant/detail', {params:{agentNo:agentNo}})
}
// 移除顧問
export function deleteConsultant(agentId: string) {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.delete('/consultant/favorite/'+agentId, {headers})
}
// 忘記密碼網址
export function getForgotPasswordLink():Promise<string>{
    return new Promise((resolve, reject)=>{
        resolve('https://www.google.com/');
    })
}
// 取得驗證碼圖片
export function getVerificationCodeImg():Promise<string>{
    return new Promise((resolve, reject)=>{
        resolve('');
    })
}
// 顧問登入
export function logInToConsultant(consultantDto:ConsultantLoginInfo):Promise<AxiosResponse<RequestOfLoginSuccess>>{
    return service.post('/eService/authenticate',consultantDto);
}
// 取得預約單細節
export function getAppointmentDetail(apointmentId: number):Promise<AxiosResponse<AppointmentDetail>> {
    const headers = {
        Authorization: 'Bearer ' + localStorage.getItem('id_token')
    }
    return service.get('/appointment/getDetail/'+apointmentId, {headers})
}
export interface Consultants {
    agentNo: string,
    name: string,
@@ -60,6 +98,10 @@
    updateTime: Date,
    seniority: string,
    contactStatus?: string;
    latestAppointmentId: number;
    role: string;
    image?: string;
    expertises?: string;
}
export interface FastQueryParams {
@@ -69,16 +111,25 @@
    status: string
}
export interface AppointmentRequests {
  connectDevices: any[],
  hopeContactTime: any,
  email?: string,
  job?: string,
  otherJob?: string,
  gender?: string,
  myQuestion: any[],
  age?: string,
}
export interface AppointmentParams {
    phone: string,
    email: string,
    phone?: string,
    email?: string,
    contactType: string,
    gender: string,
    age: string,
    job: string,
    gender?: string,
    age?: string,
    job?: string,
    requirement: string,
    hopeContactTime: string,
    otherRequirement: string,
    hopeContactTime?: string,
    agentNo: string
}
export interface StrictQueryParams{