Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last version-update some files #9

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
15 changes: 12 additions & 3 deletions lib/customer.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ class Customer extends Person {
body.verification_code = this.generateCode();

await this.save(body);
smsSender.sendCode(body.verification_code, body.mobile_no);
this.sendActivationMail(body.username, false);
return smsSender.sendCode(body.verification_code, body.mobile_no);
//FIXME:
// activation_link = null
// mailgun did not work and need to comment and activate account only with sms
// this.sendActivationMail(body.username, false);
}

async sendVerificationSms(smsInfo) {
Expand Down Expand Up @@ -198,10 +201,16 @@ class Customer extends Person {
if (!foundCostomer)
throw error.codeNotFound;

//TODO:
// need to added some fields for update same as isVerified
// email_verified = true
// mobile_verified = true
const res = await this.CustomerModel.findOneAndUpdate({ username: theUsername }, {
$set: {
verification_code: null,
mobile_verified: true
mobile_verified: true,
activation_link: null, // email verification now need to skip, because mailgun is not available
email_verified: true // email verification now need to skip, because mailgun is not available
}
}, { new: true });

Expand Down
16 changes: 13 additions & 3 deletions lib/offline.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ class Offline {
// make avarage on those order details which have more than 1 qty
detail.map(x => {
if (x.qty > 1) {
x.retailPrice = x.retailPrice / qty;
x.discountValue = x.discountValue / qty
x.retailPrice = x.retailPrice / x.qty;
x.discountValue = x.discountValue / x.qty
}
return x;
})
Expand Down Expand Up @@ -523,7 +523,17 @@ class Offline {
}
}



transferOrderLine(body, user) {
const data = {
orderId: body.orderId,
orderLineId: body.orderLineId,
warehouseId: user.warehouse_id,
userId: body.userId,
barcode: body.barcode,
};
return this.transferResponse(data);
}

}

Expand Down
Loading