-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat: closes #12 #13
feat: closes #12 #13
Conversation
} | ||
} | ||
const smsBody = `Congratulations! You have successfully registered for donating <Number of devices donated> smartphones as part of the ""Digital Saathi"" campaign. | ||
\nPlease note your tracking IDs: ${trackingKeys}. You can use these IDs to track the status of delivery for your donated smartphones. Contact 1800-180-8190 for any assistance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The tracking ID sent in the SMS should be the
company_id
. - Replace "" by
quantity_of_devices
@@ -0,0 +1,53 @@ | |||
import {Entity, model, property} from '@loopback/repository'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This model is not needed
api/src/models/corporate.model.ts
Outdated
@@ -0,0 +1,53 @@ | |||
import {Entity, model, property} from '@loopback/repository'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This model is not needed
|
||
export class DonateDeviceController { | ||
constructor( | ||
@repository(DonateDeviceRepository) | ||
public donateDeviceRepository: DonateDeviceRepository, | ||
@repository(CorporateRepository) | ||
public corporateRepository: CorporateRepository, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to create this repository
} | ||
} | ||
const smsBody = `Congratulations! You have successfully registered for donating <Number of devices donated> smartphones as part of the ""Digital Saathi"" campaign. | ||
\nPlease note your tracking IDs: ${trackingKeys}. You can use these IDs to track the status of delivery for your donated smartphones. Contact 1800-180-8190 for any assistance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The "Number of devices donated" should be replaced by
quantitiy_of_devices
- The tracking ID should be
company_id
return [obj?.template, obj?.templateId, obj?.variables]; | ||
}; | ||
|
||
const onSuccess = async ({ data }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need an onSuccess
hook in this component
@@ -21,6 +21,21 @@ const EXTENDED_DONATION_RECORD = gql` | |||
} | |||
} | |||
`; | |||
const EXTENDED_CORPORATE_DEVICES_RECORD = gql` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we refactor this to include every custom graphQL fragment in a separate file in a fragments
directory inside customHasura
?
else setDisplayCertificate(false); | ||
let {allStatus} = trackingResponse ?? false; | ||
if(allStatus) { | ||
const obj = config.statusChoices.filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nicely done!
portal/pages/api/track.js
Outdated
let { phone_number } = obj; | ||
phone_number = `******${phone_number.slice(6)}`; | ||
obj.phone_number = phone_number; | ||
let modifiyData = array.map(element => element.delivery_status); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't perform these additional functions (adding name and other attributes to the response) in the maskPhoneNumber
function - can we create a separate function to do this and let maskPhoneNumber
remain as it was
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: modifiyData
-> modifyData
certificate/server.js
Outdated
@@ -46,6 +46,7 @@ async function printPdf(name, trackingKey, udise) { | |||
donor: { | |||
trackingKey: trackingKey, | |||
name: name, | |||
phone_number:phone_number, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a masked phone number - no point adding it to the certificate in this way. Let's skip this, and solve this in this issue
{isSmall ? ( | ||
<SimpleList | ||
primaryText={(record) => record.name} | ||
secondaryText={(record) => record.district} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
district
will not exist on this record
portal/pages/api/track.js
Outdated
obj.name = name; | ||
} else if(device_donation_corporate.poc_phone_number) { | ||
phone_number = `******${device_donation_corporate.poc_phone_number.slice(6)}`; | ||
obj.name = device_donation_corporate.poc_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name
should be company_name
instead of poc_name
const smsBody = `Congratulations! You have successfully registered for donating ${gqlResponse.insert_device_donation_corporates_one.quantity_of_devices} smartphones as part of the "Digital Saathi" campaign. \nPlease note your tracking IDs: ${instanceID}. You can use these IDs to track the status of delivery for your donated smartphones. Contact 1800-180-8190 for any assistance.\n\n- Samagra Shiksha, Himachal Pradesh`; | ||
|
||
const contactNumber = corporateType.poc_phone_number; | ||
const smsDispatchResponse = sendSMS(smsBody, instanceID, contactNumber, "1007668058014878711"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have the templateIds saved as environment variables? LGTM otherwise.
No description provided.