dwyl / mvp

šŸ“² simplest version of the @dwyl app
https://mvp.fly.dev
GNU General Public License v2.0
87 stars 2 forks source link

Review timer functions #136

Open SimonLab opened 2 years ago

SimonLab commented 2 years ago

I've noticed a few things that I want to update or have a detailed looked at to make sure I didn't miss something:

    {:ok, _timer} =
      Timer.start(%{
        item_id: item.id,
        person_id: person_id,
        start: NaiveDateTime.utc_now()
      })
nelsonic commented 2 years ago

@SimonLab these are all valid questions. agree with removing person_id from the Timer.start šŸ‘ Timer.stop should allow the passing of the stop value but should default to now.

SimonLab commented 2 years ago

I've started to break to many things. I need to review first this section to understand fully how the item/timers structure is created: https://github.com/dwyl/mvp/blob/7e94e47a831a8436bfc97a8e8d1d1171e5ef8c25/lib/app/item.ex#L97-L247

I think the functions linked to the timers are correct and I misunderstood the structure

nelsonic commented 2 years ago

@SimonLab yeah, the disclaimer was my attempt to warn you. šŸ¤Ŗ If you can wrap your head around it, Iā€™m very happy for you to attempt to simplify it. But it needs to be time-boxed. šŸ‘ŒšŸ»

nelsonic commented 2 years ago

@SimonLab if you have time to review this please go for it. šŸ¤ž