at least at first, inputs for this system are going to be sent as e-mail attachments, since they used to be processed manually. So I want to find e-mails, parse the attachment.. and I want to do this on heroku with node, so probably using a "worker dyno".
Step 1: figure out how to find the e-mail using node.. ok, done, using node-imap to fetch the message and mailparser to parse out the attachment. I now have a script that grabs an e-mail with a csv, uploads the items to the database, and then marks that file as read..
I also added a "time" field. I could just use the default mongodb _id, but I want to know when the item was originally generated (which is provided in the csv), rather than when the item was added to the database. I'll need to update my indexes for sorting by time too (since they currently sort by _id)..
Step 2: figure out how to run this file on a worker dyno..
..maybe before I do that, I want to make the display of tasks work.. what was I blocked on there. Oh yes. Architecting a nice way of refreshing the client on server updates.
The best I can think of now is the suggested long-poll, and updating textboxes on refreshes. And actually there won't be any textboxes in this interface, so I can punt on that for now.
So how do we do a long poll.. let's first make sure heroku supports that.. hm.. sortof. From what I gather, it supports long polling with a 10 second duration.. hm..
I'm going to punt on versioning altogether for now. Let's get the interface working.. ok, it shows the tasks, with accept and reject buttons. Let's make accept accept, and make an rpc call, and show "accepted / undo" in the interface. And the rpc call doesn't need to tell the user that it was successful because these people are being paid by the hour, and if it wasn't successful, the task will be given to someone else anyway. Pay by the hour is so much easier to program for.. well, easier anyway..
almost there, but need to pick someone up from the airport..