save raw appointment info
This commit is contained in:
@@ -528,6 +528,22 @@ class CommandorPage {
|
|||||||
console.log("will click on valid button");
|
console.log("will click on valid button");
|
||||||
console.log("isTerminated is " + this.isTerminated);
|
console.log("isTerminated is " + this.isTerminated);
|
||||||
if (!this.isTerminated) {
|
if (!this.isTerminated) {
|
||||||
|
let raw = await this.getRawAppointmentInfo(this.page)
|
||||||
|
if (raw.email !== undefined) {
|
||||||
|
this.contact.mail = raw.email
|
||||||
|
}
|
||||||
|
if (raw.passportNumber !== undefined) {
|
||||||
|
this.contact.passportNumber = raw.passportNumber
|
||||||
|
}
|
||||||
|
if (raw.lastName !== undefined) {
|
||||||
|
this.contact.lastName = raw.lastName
|
||||||
|
}
|
||||||
|
if (raw.phoneNumber !== undefined) {
|
||||||
|
this.contact.phoneNumber = raw.phoneNumber
|
||||||
|
}
|
||||||
|
if (raw.firstName !== undefined) {
|
||||||
|
this.contact.firstName = raw.firstName
|
||||||
|
}
|
||||||
await this.page.evaluate(() => {
|
await this.page.evaluate(() => {
|
||||||
document.getElementsByClassName("btn")[0].click();
|
document.getElementsByClassName("btn")[0].click();
|
||||||
})
|
})
|
||||||
@@ -684,23 +700,6 @@ class CommandorPage {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
// save to mongoDb
|
// save to mongoDb
|
||||||
let raw = await this.getRawAppointmentInfo(this.page)
|
|
||||||
// await this.mongoManager.saveRawReserveInfoToDb(raw)
|
|
||||||
if (raw.email !== undefined) {
|
|
||||||
this.contact.mail = raw.email
|
|
||||||
}
|
|
||||||
if (raw.passportNumber !== undefined) {
|
|
||||||
this.contact.passportNumber = raw.passportNumber
|
|
||||||
}
|
|
||||||
if (raw.lastName !== undefined) {
|
|
||||||
this.contact.lastName = raw.lastName
|
|
||||||
}
|
|
||||||
if (raw.phoneNumber !== undefined) {
|
|
||||||
this.contact.phoneNumber = raw.phoneNumber
|
|
||||||
}
|
|
||||||
if (raw.firstName !== undefined) {
|
|
||||||
this.contact.firstName = raw.firstName
|
|
||||||
}
|
|
||||||
let reserve = ReserveResultPojo.create_from_contact(this.contact, id, url, this.choosedStore, publishType);
|
let reserve = ReserveResultPojo.create_from_contact(this.contact, id, url, this.choosedStore, publishType);
|
||||||
reserve.source_from = this.device.model();
|
reserve.source_from = this.device.model();
|
||||||
await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict())
|
await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict())
|
||||||
|
|||||||
Reference in New Issue
Block a user