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

Feat/extract meta data from sale receipt #65

Merged
merged 7 commits into from
Apr 15, 2024

Conversation

nishant22029
Copy link
Contributor

https://gramhal.monday.com/boards/4834273983/pulses/6417088008

  • Added new page for data extraction from sale receipts

@nishant22029 nishant22029 self-assigned this Apr 15, 2024
var traderCodeCheckbox = document.getElementById('trader_code_not_available_checkbox_' + resourcePk);

if (!/^\d{10}$/.test(ownerMobileNumberInput.value) && !ownerMobileNumberCheckbox.checked && !ownerMobileNumberInput.disabled) {
alert('please enter valid number');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
alert('please enter valid number');
alert('Please enter a valid mobile number.');

}

if (!/^\d+$/.test(traderCodeInput.value) && !traderCodeCheckbox.checked && !traderCodeInput.disabled) {
alert('please enter valid trader code');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
alert('please enter valid trader code');
alert('Please enter a valid trader code.');

admin/views.py Outdated
@@ -1222,6 +1236,14 @@ def update_receipt_status():
return response


@admin.route("/update_receipt_data", methods=["POST"])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use hyphens in the routes.

}


function handleTraderCodeInput(traderCode, resourcePk) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function handleTraderCodeInput(traderCode, resourcePk) {
function handleTraderCodeInput(traderCode, resourcePk) {

.then(response => response.json())
.then(data => {
if (data.success) {
if (data.message === "please provide receipt owner mobile number") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't seem like a very reliable way to check for validation. Any small change to this big message will lead to a failure. I would suggest you either use data.success or send another parameter that is short and slugified.

{% endfor %}
];

function toggleMobileNumberInput(checked, resourcePk) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toggle is not a correct representation of the action. Toggle is for checkbox on/off toggle. This should be named like:

Suggested change
function toggleMobileNumberInput(checked, resourcePk) {
function onChangeMobileNumberInput(checked, resourcePk) {

}
}

function toggleTraderCodeInput(checked, resourcePk) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function toggleTraderCodeInput(checked, resourcePk) {
function onChangeTraderCodeInput(checked, resourcePk) {

@nishant22029 nishant22029 merged commit 51bddec into main Apr 15, 2024
1 check passed
@nishant22029 nishant22029 deleted the feat/extract-meta-data-from-sale-receipt branch April 15, 2024 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants