bentocorp / android

The customer Android app
0 stars 0 forks source link

Add lunch to Android...today #95

Closed demant closed 9 years ago

demant commented 9 years ago

I'm going to throw out a ridiculous request. We're getting covered by TechCrunch and VB today, so I'd love to see if we can make this happen.

Over the past few weeks we've made lunch very simple. It's the exact same as dinner. Can we add it to Android today?

I believe this is the only functionality we would need to change:

If (lunch == custom, open the store, else stay closed)

There's a flag on the backend that tells you whether or not lunch is custom. If it is, open the store. If not, leave it closed.

If we can do that, we'll also need to modify the closed store copy slightly:

If between (Friday 8pm) && (Sunday 11:59pm): Have a great weekend! We're back on Monday with more deliciousness. Lunch: 11am-2pm, Dinner: 5pm-10pm

Else If Monday, Tuesday, Wednesday, Thursday & between (8pm - 11:59pm): That's it for tonight! We're back tomorrow...oh yeah! Lunch: 11am-2pm, Dinner: 5pm-10pm

Else We're cookin' up something really delicious today. Get excited! Lunch: 11am-2pm, Dinner: 5pm-10pm

oldestlivingboy commented 9 years ago

@gozpell and @norman784 are researching everything they’ll need to change. If nothing else, though, I think making the changes on such short order (without a bunch of testing) is going to be too risky for my liking.

demant commented 9 years ago

Yeah, I knew it was a bit risky, but since it's basically the same as dinner, it felt okay. But I'll trust your judgment.

vcardillo commented 9 years ago

If it's too risky, let's not do it.

On Wed, Jun 24, 2015 at 9:02 AM, Jason Demant notifications@github.com wrote:

Yeah, I knew it was a bit risky, but since it's basically the same as dinner, it felt okay. But I'll trust your judgment.

— Reply to this email directly or view it on GitHub https://github.com/bentocorp/android/issues/95#issuecomment-114925693.

GonzaloGaleano commented 9 years ago

If (lunch == custom) That is already implemented in the API? Where?

vcardillo commented 9 years ago

In the menu JSON, I added a field:

"menu_type": "custom",

{"menus": {"lunch": {"Menu": {"name": "MARS 3 LUNCH","for_date": "2015-06-24 ","bgimg": "https://d1pztqdeuocb8t.cloudfront.net/first_background.png"," menu_type": "custom",

On Wed, Jun 24, 2015 at 1:20 PM, Gonzalo Galeano notifications@github.com wrote:

If (lunch == custom) That is already implemented in the API? Where?

— Reply to this email directly or view it on GitHub https://github.com/bentocorp/android/issues/95#issuecomment-114998441.

GonzaloGaleano commented 9 years ago

To change between lunch or dinner menu. Just need to check the phone hour?

vcardillo commented 9 years ago

Yeah, there's a bunch of complicated logic there that we implemented on iOS, that involves looking at the meals data from the init API call, and looking at the startTime for the meals. And "buffer_minutes" too.

The first step here is to document the proper logic as we do it on the iPhone, and I've asked @JosephLauSF to document this logic. Once we have that, then I think it makes sense to talk about doing this properly, and ensuring that the logic on both devices is the same.

GonzaloGaleano commented 9 years ago

Would be much simpler if the meals list it was generic and not specific for a /init/{date}, as you are using now. But i'm waiting clarify for do something.

vcardillo commented 9 years ago

It is generic. It's not specific for a date.

vcardillo commented 9 years ago

The only thing that's specific to a date in that call are the menus that are returned if you optionally provide the date argument.

GonzaloGaleano commented 9 years ago

I will try to explain what i am thinking. If there was a channel where you get the complete list of foods, then the stock control, will manage the "actives meals". Then the only verification needed will be the hour to show messages. This is a comment about that i see and is independent of what will do now. I'm waiting more instructions and am checking android code where will need to change for this.

vcardillo commented 9 years ago

That's pretty much what we do. You check the current time to know whether to show "today's lunch" or "tomorrow's lunch" and so forth, and whether the app should be in lunch or dinner mode. I think that's what you're saying.

GonzaloGaleano commented 9 years ago

Not exactly but that info will be very util.

GonzaloGaleano commented 9 years ago

But don't worry. Will try do with the information that i have for not have to do nothing else in the backend.

vcardillo commented 9 years ago

@JosephLauSF has documented the logic at the top of the page: https://github.com/bentocorp/ios/wiki/Business-Logic

Take a look and let us know your questions.

GonzaloGaleano commented 9 years ago

Done. And i think that is working well.

demant commented 9 years ago

Awesome! Can we publish dev and prod build?

On Jun 24, 2015, at 10:12 PM, Gonzalo Galeano notifications@github.com wrote:

Done. And i think that is working well.

— Reply to this email directly or view it on GitHub.

vcardillo commented 9 years ago

And is it possible to name the dev version "Bento Dev" so that we can tell the difference for certain on our phones?

On Thu, Jun 25, 2015 at 8:49 AM, Jason Demant notifications@github.com wrote:

Awesome! Can we publish dev and prod build?

On Jun 24, 2015, at 10:12 PM, Gonzalo Galeano notifications@github.com wrote:

Done. And i think that is working well.

— Reply to this email directly or view it on GitHub.

— Reply to this email directly or view it on GitHub https://github.com/bentocorp/android/issues/95#issuecomment-115300238.

oldestlivingboy commented 9 years ago

@demant We’ve been testing – I don’t think this implementation is quite ready yet.

@vcardillo Yes, we’ll separate the versions better.

norman784 commented 9 years ago

@demant @vcardillo we have a doubt about the menu schedules, we readed the business logic and this is what we understand, please correct me if I'm wrong.

All those scenarios are when the store is closed on weekdays, also we know about friday and weekends has their exceptions.

josephlausf commented 9 years ago
                   LEFT MENU              |                          RIGHT MENU

Open/Soldout:

// 0:00 - 16:29 (12:00am - 4:29pm)
if (now >= 0 && now < 16.5)
         get todayLunch                   |                try to get todayDinner...
                                          |               else try to get nextLunch...
                                          |               else try to get nextDinner.

// 16:30 - 23:59 (4:30pm - 11:59pm)
if (now >= 16.5 && now < 24)
            get todayDinner               |                try to get nextLunch...
                                          |               else try to get nextDinner.

Closed:

// 00:00 - 12.29 (12:00am - 12:29pm)
if (now >= 0 && now < (lunchTime + bufferTime))
        try to get todayLunch...           |          try to get todayDinner...
          else try to get todayDinner...   |         else try to get nextLunch...
         else try to get nextLunch...      |         else try to get nextDinner...
         else try to get nextDinner.       |         else don't show a right menu

// 12:30 - 17:29 (12:30pm - 5:29pm)
else if (now >= (lunchTime + bufferTime) && now < (dinnerTime+bufferTime))
       try to get todayDinner...           |         try to get nextLunch...
         else try to get nextLunch...      |         else try to get nextDinner...
         else try to get nextDinner.       |        else don't show a right menu

// 17.30 - 23:59 (5:30pm - 23:59pm)
else if (now >= (dinnerTime+bufferTime) && now < 24)
       try to get nextLunch...              |         try to get nextDinner...
         else try to get nextDinner.        |         else don't show a right menu
vcardillo commented 9 years ago

Was this helpful?

vcardillo commented 9 years ago

I'm talking to Joseph about the logic.

josephlausf commented 9 years ago

Above logic has been revised. Displaying nextNextMenu is unnecessary. If it's Closed and there's no todayLunch and todayDinner, try to get nextLunch and nextDinner to display on Left and Right. If there's no nextDinner, then don't show a Right side menu at all and ONLY show nextLunch. If there's no nextLunch and only nextDinner is available, then ONLY display nextDinner.

vcardillo commented 9 years ago

Please make sure that this is also reflected in the Business Logic doc.

On Mon, Jun 29, 2015 at 12:12 PM, Joseph Lau notifications@github.com wrote:

Above logic has been revised. Displaying nextNextMenu is unnecessary. If it's Closed and there's no todayLunch and todayDinner, try to get nextLunch and nextDinner to display on Left and Right. If there's no nextDinner, then don't show a Right side menu at all and ONLY show nextLunch. If there's no nextLunch and only nextDinner is available, then ONLY display nextDinner.

— Reply to this email directly or view it on GitHub https://github.com/bentocorp/android/issues/95#issuecomment-116800401.

oldestlivingboy commented 9 years ago

Please test the production build (note: as discussed with @vcardillo, this version doesn’t let you browse the dinner menu during lunch hours and vice versa): https://github.com/bentocorp/android/releases/tag/v1.1

demant commented 9 years ago

Tested and works great!