We are making a business plan at the university and we have to install some sensors to the refrigerator with a timer, since this will connect to a mobile app through Alexa. Do you know of any magnetic sensor or something like that with a timer and be able to know how long the door has been open?
Lots of such sensors are readily available - reed switch on one side, magnet on the other. Connect to an Arduino, measure how long it's open.
I prefer to use a light sensor to tell if the door is open. Something like the TEPT5700.
Regarding the reed switch idea, these are widely available in an easy to mount form sold to use for security systems, and are fairly inexpensive:
Search for magnetic door switch on your shopping site of choice.