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

Xola Webhook --> Deputy Shift Creation #12

Merged
merged 6 commits into from
Dec 3, 2020
Merged

Xola Webhook --> Deputy Shift Creation #12

merged 6 commits into from
Dec 3, 2020

Conversation

BearVictor
Copy link
Contributor

@BearVictor BearVictor commented Dec 2, 2020

What does it do?

Make subscribe to the XOLA webhook - process data from them - post request to DEPUTY - Verification, who employee free
make post request to DEPUTY shift.
Finish part 1 all

What else do you need to know?

This is PR include issue: #5 , #6 , #7, #8,
  WHEN START FIRST TIME U HAVE TO RUN SETUP.PY FILE

Checklist

  • Pipeline set to Ready To Deploy or Review/QA
  • Pull request is prepared: Added to sprint, added yourself as assignee, Zenhub task is linked, reviewers are added
  • PR is not very big (about 200 lines of change)
  • Doesn't create any new FIXME or TODO comments. If not, please explain or create issues to resolve it.
  • Doesn’t deliver half-baked changes
  • Tested manually or with a new unit test
  • Follows best practice rules

Demo screenshots or video/animation, if any

Screenshot 2020-12-02 at 16 48 01 2

@BearVictor BearVictor added this to the Sprint W49 milestone Dec 2, 2020
@BearVictor BearVictor self-assigned this Dec 2, 2020
requirements.txt Outdated
@@ -0,0 +1 @@
Flask==1.1.2
Copy link

Choose a reason for hiding this comment

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

add requests package

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 05a96f3

setup.py Outdated
if __name__ == '__main__':
if path.isfile('xola_deputy/Settings.ini'):
key = input("Do you really wanna change your settings?(y/n) ")
print (key)
Copy link

Choose a reason for hiding this comment

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

remove print function

try:
response = requests.post(
url=url, headers=self.__headers, data=data)
print(response.json())
Copy link

Choose a reason for hiding this comment

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

remove print func

url = self.__url + "users/" + self.__user_id + "/hooks"
param = {"eventName": "order.create", "url": self.public_url + "/xola"}
json_mylist = json.dumps(param)
data = f"{json_mylist}"
Copy link

Choose a reason for hiding this comment

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

Try str func instead f string

:param ticket_count: all tickets which reserved in event
:return: how many new shifts we have to do
"""
if shift_count == 1: # we don`t need divine ticket on guids|do 1 shift
Copy link

Choose a reason for hiding this comment

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

Maybe will be better change shift_count for default number of shifts to smth like '-1' instead '1'
(in case if in future we will have experience, which provide 1 guide per 1 ticket)

@mytrov mytrov merged commit 94e53e8 into main Dec 3, 2020
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