Open cch5ng opened 5 years ago
resc
how to store date/time in db
get user time zone
push notifications
service worker in react application
https://create-react-app.dev/docs/making-a-progressive-web-app/
cron jobs with node
UI consideration: probably to user it is simplest if during the shopping session, every time they check an item as purchased, this should be the time that the start date/time gets saved (db) to count down to the expiration notification event... otherwise need to add another button for completed list purchase but that looks redundant visually
logistics
set db server timezone; America/Los_Angeles
010719
[ ] store timezones as constants file
[ ] write a script, want to store an array of strings (db timezones)
[ ] implement UI where user can set their time zone (react select)
[ ] need to figure out how
store the times to expiration
mapping shopping items to correct time to expire (by section? by item name?)
want to make a rough implementation
want to create a couple simple tests
right now focus on US time zones for now
010920/011320
[x] sketch out the flow for how to get the timestamp for item purchased into BE
[x] choose a rough data source for when foods typically expire
[x] update data file to add a hard coded numeric field for how much to increment to the expiration date
[x] choose the initial method to map between a list item and the line/rule for when that item should expire
[ ] initially use section setting to determine the expiration length category
[ ] sketch out the flow for how the timing of notifications would work
[ ] start to test out notifications
[ ] later on test different time zones (US)
[x] user settings for local timezone
(fri) need to start doing research on how to set up push notifications (in particular service worker in react context)
(fri) research to figure out how to map a food item to a category of expiration date; maybe something a long the line of how google search works (it is not always guaranteed to be an exact match so how to find the best match); do a little digging to understand the relationship b/t ML and text searching
resc
research on notifications and UX (user preferences)
I like the notifications options samples by Breaking News
resource on sms api (most cost $)
010920 > 310
X-(fixed) some issue with setting comp useEffect; the timing seems off where the form field gets overwritten by useState call; need to figure out if my syntax with useEffect needs to change (try to look at definition of 2nd param again)
check how I handled this in the other form for retrieving either shopping list or template list
012320 > 350
X-(done) write up some tests to check out the logic in the map_expiration_dates.js file
012720 > 330
[ ] view that allows user to do matching test
[ ] view overlay that reminds user to do matching test
resc
UX or examples on different notification types; use like model for how to remind user they should set up the mapping between sample shopping list and the list item expiration date matches
https://www.nngroup.com/articles/indicators-validations-notifications/
013120 > 1218
(012920 > 353)
need to debug issues on ExpirationMapTest;
fix the logic for handling checkboxes; if user changes a checkbox from disabled (checked) to enabled, then this should somehow trigger the mapping logic (?)
(done) implement event handler when user wants to override a mapping (?) and set a different food expiration category
(done) add button and form submit handler
(done) fix inputChangeHandler() - only call expirationDateMapper1() on form submit/btn click
(done) getExpirationCategory() check if it works
(done) also revisit I think in the console there might have been some issue with the exports in the map_expiration_dates.js file (after the fix, check if import works and also check how this affects the unit tests)
value prop on select should not be null; not sure where in the code this might be getting set; it should be "none"
first pass
after user completes shopping trip they should signal
what they bought
when they bought it
then user should get some notification when a food item is about to expire (1-2 days before)
[ ] analysis of what needs to happen in order to implement; missing info (technical requirements)
first pass
storing date/time that a list item was purchased
determine when to start the countdown timer for notification (what should be the trigger)
determine how to map the list item name to the amount of time until food expiration occurs
determine which resource to use to make rules for food expiration timeline (by food type); not sure how to find a free resource
determine notification formats (push notification, email, or SMS)
scheduling
try first using cron job interfacing with node
potentially query on the hour to check which notifications are next due
need to think a little bit more about how to schedule notifications so that they are not considered annoying (opt out)
considerations
how to store times in database
how to handle different time zones
how to track a user's local time zone (where/how to input that)
is it simplest to use geolocation? or require user input on registration
what is the simplest way to get it? US state; how about internationally
this probably affects UI like where can the user review and edit this info later
also think there has to be something like scheduled notifications and how to implement this
something like celery/node-celery?
or node with cron jobs?