#ifndef LAMP_PROGRAM_H
#define LAMP_PROGRAM_H

#include "lamp_guard.h"

typedef enum {
    LP_BASE_COLOR,
    LP_DARK_GEL,
    LP_BUILDER_EXTENSION,
    LP_TOP_COAT,
    LP_MANUAL_60,
    LP_MANUAL_120,
    LP_RECIPE_COUNT
} lp_recipe;

/* Resolve a listing-derived recipe only when it is valid for the explicit mode.
   On failure, duration_ms is left untouched. */
bool lp_resolve_duration(lg_mode mode, lp_recipe recipe, uint32_t *duration_ms);
/* A one-touch 120 s Dark/Top preset is explicitly routed into Manual so the
   90 s AI ceiling and both advertised one-touch durations can coexist.
   From OFF, shorter gel presets start in AI; Manual 60/120 remain long-press
   selections and are resolved only by lp_resolve_duration(). */
bool lp_resolve_one_touch_mode(lg_mode current_mode, lp_recipe recipe,
                               lg_mode *resolved_mode, uint32_t *duration_ms);
/* Resolve the product recipe and arm the guard as one operation. */
bool lp_arm_recipe(lg_guard *guard, lg_mode mode, lp_recipe recipe,
                   uint32_t now_ms);
/* Resolve a one-touch gel preset and arm the guard as one operation. */
bool lp_arm_one_touch_recipe(lg_guard *guard, lg_mode current_mode,
                             lp_recipe recipe, uint32_t now_ms);

#endif
