This repository was archived by the owner on May 28, 2024. It is now read-only.
Attempt at backend trial#3
Open
hbierlee wants to merge 4 commits intodeskbookers:masterfrom
Open
Conversation
… average I use a query to retrieve all bookings and group the bookings of each booker per month. Then I use PHP to further process the results by folding the requested lifetime period of months to get booker counts, booking counts and averages.
Contributor
|
I think you understood is correctly. Is your code ready to review in this case? |
Author
|
In that case, it is ready for review. Like I said, it's definitely not the optimal solution, and some of the requirements have not been met, but I think at this point it'd be better if you take a look at it and gave me some pointers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to send in my work before the end of the day, although I'm aware it's far from perfect. I sort of solved the problem by using SQL get booking counts and turnover per month per booker, and then use some PHP array folding and grouping loops to proces it further to what I think is a LTV report.
That said, I might have misinterpreted the assignment. I have interpreted it like this (if we take a LTV period of 18 months and commission of 10%):
turnover * commissionThis last part is what made the whole thing a lot tougher, so if I understood this wrongly, I would very much like to hear it so I can solve it properly. Otherwise, I'd love to hear some pointers on how to tackle this problem, as I only got so far with SQL.