flightplan-tool / flightplan

Search for award inventory using Node.js and Headless Chrome!
Apache License 2.0
142 stars 41 forks source link

Calendar "inactive" type should depend on query parameters #14

Open ferni7 opened 5 years ago

ferni7 commented 5 years ago

Edit: forgot to finish editing title sorry! and now it wont let me

When you click on a No awawds found cell - show what airlines/classes/pax numbers have been searched for on that date?

Use case is that i can't remember if i've searched for 2pax or 1pax so if it shows i only searched for 2pax i could re-run for 1 pax if i was ok for a single seat?

jd20 commented 5 years ago

If you re-run the search for 1 pax or 2 pax though, the search command should skip any unnecessary queries, since it does check the database to see what was already run. Wouldn't that be sufficient?

ferni7 commented 5 years ago

Yes that's what you fixed in the latest version, but what i did was run searches some for 1pax some for 2pax (where i didn't do 1pax first) and now i can't remember which ones i did for 2pax and which for 1pax... so was thinking if the no awards found showed the search parameters that have been used you could tell if you hadn't searched for it properly.. just an idea/low priority as i can just re-run a search if im unsure :)

jd20 commented 5 years ago

So, if I understand right, you have a specific route, where you searched 1 pax some days, and 2 pax on others. And you want to get the data "complete" for that route (for whatever days you already searched, plus maybe some additional days), for querying up to 2 pax. So, what I was saying is, you shouldn't need to know which days were 1 pax or 2pax. Just run two searches:

1) Search for 1 pax, over the entire time period. It will skip all the days you already searched for 1 pax, and for days you searched 2 pax that had award availability. 2) Now run the search for 2 pax over the entire time period. That will skip all days you already searched for 2 pax, and for days you searched 1 pax that had no award availability.

I don't see how you'd re-run the searches any more efficiently, knowing which days you already searched 1 or 2 pax. Not arguing that maybe there's usefulness in knowing (and I think the best place to expose it might actually be the stats command, which kinda does part of this already), but I'm not seeing how it'd help in the particular case you're describing.

ferni7 commented 5 years ago

This was more about knowing if i need to search or not without searching.

ie If I'd searched for 2pax but forgot if i searched for 1pax or not then only way for me to know is to run the search for 1pax, vs if there is a visual representation of you having searched for both 1 and 2pax but there was no avail etc..

Its a minor thing, can just run the search again if unsure like you said :)

jd20 commented 5 years ago

Hmmm... there is a visual indicator of whether a particular date has been searched (non-searched dates have a darker color), but it doesn't take into account the quantity being queried. It'd be great if it did, that'd be a straightforward solution to the problem you're describing.

So, I think what you really want, is a feature request that when we shade cells darker to indicate we don't have search data for them, it should take into account the quantity (not just route and date).

ferni7 commented 5 years ago

That's exactly what I was suggesting :)

jd20 commented 5 years ago

Currently, calendarStore flips a cell's type to active if any awards are found for that date (including the special empty placeholder). Ideally this would be conditional on the query params (engine / quantity / partner flag). Probably need to use the requests table to calculate the state properly, and maybe get rid of the empty award placeholder altogether. Time allowing, can look at adding additional info to an inactive cell's tooltip, like what requests have already been run.