import { GLOBAL_PRESETS } from "../global-presets";
import { setDependentAnswerPreset, setDirectAnswerPreset } from "../util/answer-flow";
import { TAnswerFlow } from "../util/types";
import * as beautyUtils from "../util/utils";

export const COLORSONIC_ANSWER_FLOWS: Record<number, TAnswerFlow> = {
  /**************** Upon Arrival: # of OOS ****************/
  10: setDirectAnswerPreset(
    undefined,
    "Colorsonic Inline - UPON ARRIVAL, BEFORE zoning or stocking, please count how many items are out of stock for the Colorsonic Inline POG",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].colorsonic.before(),
  ),

  /**************** Total Items Stocked ****************/
  20: setDirectAnswerPreset(
    undefined,
    "What is the total number of pieces of L'Oreal Colorsonic items you stocked today",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].colorsonic.total_stocked(),
  ),

  /**************** Upon Completion: # of OOS ****************/
  30: setDependentAnswerPreset(
    undefined,
    "L'Oreal Colorsonic: After Zoning/Stocking/Merchandising, what is the Total # of Out Of Stocks during this visit",
    "text",
    [10],
    beautyUtils.getAfterOOSCount,
  ),

  /**************** On-hand Discrepancies ****************/
  40: setDependentAnswerPreset(
    undefined,
    "L'Oreal Colorsonic: How many Out Of Stock items with 0 in the backroom show an on hand count (on hand in parentheses) greater than 0",
    "text",
    [30],
    beautyUtils.getOOSWithOnHandsGreaterThanZero,
  ),

  /**************** Closing Questions ****************/
  60: setDependentAnswerPreset(
    undefined,
    "Select why 0 Items needed a count correction",
    "radio",
    [40],
    beautyUtils.getWhyZeroItemsNeededCountCorrection,
  ),
};
