You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a feature request that will be able to pull data from the corp journal to get the correct profit from items sold. Below is a rough outline of how a feature might work.
The basic workflow for the seller would be as such:
Change Active Wallet to designated loot payout division
Sell items, check "Use Corp Account".
Once all loot is sold, hit "Import API" button.
Data is imported from API (corp and char) and loaded onto the page. (do we load it as text-only, or load into a text input to allow the user to change data in case they find a discrepancy? Perhaps )
User hits submit, data is imported into database.
The basic workflow for the backend would be as such:
When user requests API import, fetch data and check for the typeIDs. For rowcounts, use the number of loot that are being sold, and request 100 more (as a buffe, also make this configurable). So, if there's 38 loots being sold, request 138 rows of corp journal history. Since the API should be imported immediately after the loot is sold, it should be the most recent.
Loop through the transaction entries, checking for typeID and characterID relating to the loot ID and seller ID, respectively. Disregard any other transactions. Stop if all the loot needing to be check has been checked.
Once all the rows have been checked, check to see if all the loot has been account for. If it has, that means the corp journal contained all the needed info. If there's still some loot left without profit values, that means the seller may have sold the loot to his/her personal wallet. Check character wallet the same way as corp wallet
3a. If the loot still hasn't been accounted for after the character wallet check, something's wrong. Display error. (Figure out what to do in these situations, since the loot has already been sold. Perhaps instruct user to look through corp and character tansaction history to try to find the problem. Or log the time and date of selling and have a director look into it.)
Once all the loot has been accounted for and has a profit value associated to it, display it on the page. Using AJAX would work out well since it's able to load the API data and return it seamlessly.
If seller has some in their personal account, add it up and instruct them to transfer the proper amount to the correct wallet division.
Have seller look over the info and confirm, once that happens import data into database. (maybe: If they owed the corp some money, check corp wallet division journal for player's donation. Wallet journal should be fresh since earlier we were working with transactions. If not fresh, donation won't show up; log this so that it can be checked into later to confirm donation).
Done!
Considerations:
Old data. The wallet journal was accessed recently and the cache has not expired. Warn seller about this and disallow continuation until the cached time has passed (typically 15min).
User's API has expired and is no longer active. We need this to check their journal. Display error message if this happens.
Since we need the characters API, it would be best to finish Issue #9 first so that we already have the info in the database.
The text was updated successfully, but these errors were encountered:
Feature completed with commit 6ac803. Only the characters API is fetched, since it also contains transactions made on behalf of the corp.
Features not completed as of above commit:
What to do when user's API is invalid
Logging the users debt into the database, and subsequently checking it every now and then to make sure they've made the corp donation.
I'll close this once those two additions are completed.
This is a feature request that will be able to pull data from the corp journal to get the correct profit from items sold. Below is a rough outline of how a feature might work.
The basic workflow for the seller would be as such:
The basic workflow for the backend would be as such:
3a. If the loot still hasn't been accounted for after the character wallet check, something's wrong. Display error. (Figure out what to do in these situations, since the loot has already been sold. Perhaps instruct user to look through corp and character tansaction history to try to find the problem. Or log the time and date of selling and have a director look into it.)
Considerations:
Since we need the characters API, it would be best to finish Issue #9 first so that we already have the info in the database.
The text was updated successfully, but these errors were encountered: