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

Feature/15 create flow run log service #24

Merged
merged 4 commits into from
May 3, 2024

Conversation

Sachinbisht27
Copy link
Member

@Sachinbisht27 Sachinbisht27 commented May 2, 2024

#15

Please complete the following steps and check these boxes before filing your PR:

Types of changes

  • Bug fix (a change which fixes an issue)
  • New feature (a change which adds functionality)

Short description of what this resolves:

Changes contain:

  • Handling of webhook to get user flow details
  • Addition of the logic to create a new entry in the user flow table.
  • Logic to update the details in the same entry once the flow ends.
  • Addition of a check to verify whether the user flow details are already in the database.

Checklist:

  • I have performed a self-review of my own code.
  • The code follows the style guidelines of this project.
  • The code changes are passing the CI checks
  • I have documented my code wherever required.
  • The changes requires a change to the documentation.
  • I have updated the documentation based on the my changes.
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@Sachinbisht27 Sachinbisht27 requested a review from Satendra-SR May 2, 2024 13:27
@Sachinbisht27 Sachinbisht27 self-assigned this May 2, 2024
@Sachinbisht27 Sachinbisht27 marked this pull request as ready for review May 2, 2024 13:27
Copy link
Member

@Satendra-SR Satendra-SR left a comment

Choose a reason for hiding this comment

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

Minor changes, else looks good

Comment on lines +12 to +13
UserFlows.flow_uuid == flow_uuid,
UserFlows.user_phone == user_phone,
Copy link
Member

Choose a reason for hiding this comment

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

This is gonna take more resources as the table grows. Can we find possibilities to configure index for these two columns?

Copy link
Member

Choose a reason for hiding this comment

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

We can take it seperately

Copy link
Member Author

Choose a reason for hiding this comment

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

Added indexing in the flow uuid column as well.

Comment on lines 24 to 29
if not today_flow_log:
user_flow_log = self.create_log(flow_uuid, flow_name, flow_type)
elif today_flow_log and flow_completed:
user_flow_log = self.update_log(today_flow_log)
else:
user_flow_log = None
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
if not today_flow_log:
user_flow_log = self.create_log(flow_uuid, flow_name, flow_type)
elif today_flow_log and flow_completed:
user_flow_log = self.update_log(today_flow_log)
else:
user_flow_log = None
user_flow_log = None
if not today_flow_log:
user_flow_log = self.create_log(flow_uuid, flow_name, flow_type)
elif today_flow_log and flow_completed:
user_flow_log = self.update_log(today_flow_log)

@Sachinbisht27 Sachinbisht27 merged commit ba17671 into develop May 3, 2024
1 check passed
@Sachinbisht27 Sachinbisht27 deleted the feature/15-create-flow-run-log-service branch May 3, 2024 09:55
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