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 HAIRCARE_ANSWER_FLOWS: Record<number, TAnswerFlow> = {
  /**************** Upon Arrival: # of OOS ****************/
  10: setDirectAnswerPreset(
    undefined,
    "Garnier FRUCTIS Hair Care Category - UPON ARRIVAL, BEFORE zoning or stocking, please count how many items are out of stock in the Garnier FRUCTIS Hair Care category",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].haircare.fructis_oos_before(),
  ),
  11: setDirectAnswerPreset(
    undefined,
    "L'Oreal ELVIVE Hair Care Category - UPON ARRIVAL, BEFORE zoning or stocking, please count how many items are out of stock in the L'Oreal ELVIVE Hair Care category",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].haircare.elvive_oos_before(),
  ),
  12: setDirectAnswerPreset(
    undefined,
    "L'Oreal EVER Hair Care Category - UPON ARRIVAL, BEFORE zoning or stocking, please count how many items are out of stock in the L'Oreal EVER Hair Care category",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].haircare.ever_oos_before(),
  ),
  13: setDirectAnswerPreset(
    undefined,
    "Garnier WHOLE BLENDS Hair Care Category - UPON ARRIVAL, BEFORE zoning or stocking, please count how many items are out of stock in the Garnier WHOLE BLENDS Hair Care category",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].haircare.whole_blends_oos_before(),
  ),

  /**************** Total Items Stocked ****************/
  20: setDirectAnswerPreset(
    undefined,
    "What is the total number of pieces of Garnier Fructis Hair Care you stocked today",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].haircare.fructis_stocked(),
  ),
  21: setDirectAnswerPreset(
    undefined,
    "What is the total number of pieces of L'Oreal Elvive Hair Care you stocked today",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].haircare.elvive_stocked(),
  ),
  22: setDirectAnswerPreset(
    undefined,
    "What is the total number of pieces of L'Oreal Ever Hair Care you stocked today",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].haircare.ever_stocked(),
  ),
  23: setDirectAnswerPreset(
    undefined,
    "What is the total number of pieces of Garnier Whole Blends Hair Care you stocked today",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].haircare.whole_blends_stocked(),
  ),

  /**************** Upon Completion: # of OOS ****************/
  30: setDependentAnswerPreset(
    undefined,
    "Garnier FRUCTIS Hair Care: After Zoning/Stocking/Merchandising, what is the Total # of Out Of Stocks during this visit",
    "text",
    [10],
    beautyUtils.getAfterOOSCount,
  ),
  31: setDependentAnswerPreset(
    undefined,
    "L'Oreal ELVIVE Hair Care: After Zoning/Stocking/Merchandising, what is the Total # of Out Of Stocks during this visit",
    "text",
    [11],
    beautyUtils.getAfterOOSCount,
  ),
  32: setDependentAnswerPreset(
    undefined,
    "L'Oreal EVER Hair Care: After Zoning/Stocking/Merchandising, what is the Total # of Out Of Stocks during this visit",
    "text",
    [12],
    beautyUtils.getAfterOOSCount,
  ),
  33: setDependentAnswerPreset(
    undefined,
    "Garnier WHOLE BLENDS Hair Care: After Zoning/Stocking/Merchandising, what is the Total # of Out Of Stocks during this visit",
    "text",
    [13],
    beautyUtils.getAfterOOSCount,
  ),

  /**************** On-hand Discrepancies ****************/
  40: setDependentAnswerPreset(
    undefined,
    "Garnier FRUCTIS Hair Care: 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,
  ),
  41: setDependentAnswerPreset(
    undefined,
    "L'Oreal ELVIVE Hair Care: How many Out Of Stock items with 0 in the backroom show an on hand count (on hand in parentheses) greater than 0",
    "text",
    [31],
    beautyUtils.getOOSWithOnHandsGreaterThanZero,
  ),
  42: setDependentAnswerPreset(
    undefined,
    "L'Oreal EVER Hair Care: How many Out Of Stock items with 0 in the backroom show an on hand count (on hand in parentheses) greater than 0",
    "text",
    [32],
    beautyUtils.getOOSWithOnHandsGreaterThanZero,
  ),
  43: setDependentAnswerPreset(
    undefined,
    "Garnier WHOLE BLENDS Hair Care: How many Out Of Stock items with 0 in the backroom show an on hand count (on hand in parentheses) greater than 0",
    "text",
    [33],
    beautyUtils.getOOSWithOnHandsGreaterThanZero,
  ),

  /**************** Count Corrections / DPCIs Corrected ****************/
  50: setDependentAnswerPreset(
    undefined,
    "Garnier FRUCTIS Hair Care: What is the total number DPCIs in which the counts WERE CORRECTED",
    "text",
    [40],
    beautyUtils.getTotalDPCIsCountCorrected,
  ),
  51: setDependentAnswerPreset(
    undefined,
    "L'Oreal ELVIVE Hair Care: What is the total number DPCIs in which the counts WERE CORRECTED",
    "text",
    [41],
    beautyUtils.getTotalDPCIsCountCorrected,
  ),
  52: setDependentAnswerPreset(
    undefined,
    "L'Oreal EVER Hair Care: What is the total number DPCIs in which the counts WERE CORRECTED",
    "text",
    [42],
    beautyUtils.getTotalDPCIsCountCorrected,
  ),
  53: setDependentAnswerPreset(
    undefined,
    "Garnier WHOLE BLENDS Hair Care: What is the total number DPCIs in which the counts WERE CORRECTED",
    "text",
    [43],
    beautyUtils.getTotalDPCIsCountCorrected,
  ),

  /**************** Closing Questions ****************/
  60: setDependentAnswerPreset(
    undefined,
    "Did a Team Lead assist you during your service to correct any Hair Care counts",
    "radio",
    [40, 41, 42, 43],
    beautyUtils.getDidATeamMemberAssistYouWithUpdatingOnHands,
  ),
  61: setDependentAnswerPreset(
    /Hair Care/i,
    "Select why 0 Items needed a count correction",
    "radio",
    [40, 41, 42, 43],
    beautyUtils.getWhyZeroItemsNeededCountCorrection,
  ),
};
