ThierryAbalea / aircall-technical-test-pager

Aircall Technical Test - Aircall Pager - Thierry ABALEA's solution
MIT License
0 stars 0 forks source link

Escalation Trigger confusion #1

Open ThierryAbalea opened 5 years ago

ThierryAbalea commented 5 years ago

Hi @flomarin88, @hwd, @kimious,

The Use case paragraph is not clear regarding what is triggering the escalation to the next level. The sentence An Alert iterates from one Level to another if nobody at a given Level handled it lacks precision. I don't know if it is part of the exercise to ask clarifications or if it is involuntary unclear.

For example, it never mentions the acknowledgment delay/timeout to escalate to the next level.

Furthermore, the pair programming paragraph mention an endpoint /alerts/:id/next. It suggests that is not the responsibility of the pager application to escalate to the next level. Maybe you have in mind a timer external to the application that will call this endpoint. If it is the case I will probably recommend to name this endpoint: /alerts/:id/ackTimeout. Even if this endpoint have the responsibility to escalate to the next level if required.

Waiting your clarification, I implemented an acknowledgement timeout/delay of 30 minutes for every level.

A possible improvement will be to allow the targets to declare they can't handle the alert. If all the targets do this, it will escalate to the next level. I did not implemented this case. It is probably too much for the sake of this technical test.

kimious commented 5 years ago

Hi @ThierryAbalea,

Thanks for raising the issue!

As you correctly guessed, to keep the technical test simple, the responsibility to trigger the next Level is delegated to an external timer service. This service will have to call the /alerts/:id/next endpoint we mentioned in the 2nd section. Your suggestion to make that more clear and explicit in the assignment is totally valid (I also agree with renaming the endpoint /alerts/:id/ack_timeout or something similar). I'll update the doc!

ThierryAbalea commented 5 years ago

Thanks @kimious

Is it ok if I pursue what I already implemented and add tomorrow during the Pair Programming a timer (just a simple setTimeout) that create a Command/Domain Event AckTimeout that will be consumed by my existing function Service.onAckTimeout() ?

kimious commented 5 years ago

Yes it's 100% fine! Let's continue with what you did tomorrow.