MirkoMilanovic / Commission_Counter

This function takes a date string in the format 'YYYY-MM-DD' or 'DD {month name}, YYYY' and platform (that defines a string format, like 'airbnb', 'bcom'...) and returns the commission: get_commission(date_str, platform) -> float
0 stars 0 forks source link

Review #1

Open Irostovsky opened 2 years ago

Irostovsky commented 2 years ago

Hi @MirkoMilanovic I m Ivan from GuestReady. Thanks for doing this task!

I have some notes about the current solution. Lets do it more universal. Imagine that the date string which is passed to the function starts to be received from different sources with different formats. In reality, it is possible when you receive data from Airbnb and from booking.com. For example: from airbnb we receive date string as 2022-01-15 but from booking.com as 12 June, 2023 Please adopt the function to process return the commission by passed date string and platform(airbnb, bcom). Thanks!

MirkoMilanovic commented 2 years ago

Hi @Irostovsky

Yesterday I decided to make it very simple, but now I have finished the function more universal, with a platform, as suggested. Thank you for reaching me, Mirko Milanovic

Irostovsky commented 2 years ago

Thanks @MirkoMilanovic It is much better. I just see 2 points:

  1. Imagine that marketing team would set the commission for Dec to 11% and for Jan to 12%.
  2. And imagine that there more platforms could be added in the future with different date formats.

How could you modify the code to be easily change the commission rates per month and add any platform without changing code logic much. Thanks!

MirkoMilanovic commented 2 years ago

Thanks for the good points @Irostovsky ! Now, after the change, the code looks way better.

Irostovsky commented 2 years ago

Perfect work, @MirkoMilanovic . I would just merge date_formats and platform_format. But it is small refacorign issue. No problem for now. I will notify agency to organize the first interview with you. See you!

MirkoMilanovic commented 2 years ago

Yes, I did hesitate between those two... But anyway, thank you very much @Irostovsky . See you, and have a nice day, Mirko