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 MAYBELLINE_ANSWER_FLOWS: Record<number, TAnswerFlow> = {
  /**************** Upon Arrival: # of OOS ****************/
  10: setDirectAnswerPreset(
    "Maybelline Cosmetics",
    "EYE CATEGORY - UPON ARRIVAL, BEFORE zoning or stocking, please count how many items are out of stock in the Maybelline EYE category",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].maybelline.eye_oos_before(),
  ),
  11: setDirectAnswerPreset(
    "Maybelline Cosmetics",
    "FACE Category - UPON ARRIVAL, BEFORE zoning or stocking, please count how many items are out of stock in the Maybelline FACE category",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].maybelline.face_oos_before(),
  ),
  12: setDirectAnswerPreset(
    "Maybelline Cosmetics",
    "Lip Category - UPON ARRIVAL, BEFORE zoning or stocking, please count how many items are out of stock in the Maybelline Lip category",
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].maybelline.lip_oos_before(),
  ),

  /**************** Total Items Stocked ****************/
  20: setDirectAnswerPreset(
    "Maybelline Cosmetics",
    /What is the total number of pieces of Maybelline .* you stocked today/i,
    "text",
    (storeLabel) => GLOBAL_PRESETS[storeLabel].maybelline.total_stocked(),
  ),

  /**************** Upon Completion: # of OOS ****************/
  30: setDependentAnswerPreset(
    "Maybelline Cosmetics",
    "MAYBELLINE EYE: After Zoning/Stocking/Merchandising, what is the Total # of Out Of Stocks during this visit",
    "text",
    [10],
    beautyUtils.getAfterOOSCount,
  ),
  31: setDependentAnswerPreset(
    "Maybelline Cosmetics",
    "Maybelline FACE: After Zoning/Stocking/Merchandising, what is the Total # of Out Of Stocks during this visit",
    "text",
    [11],
    beautyUtils.getAfterOOSCount,
  ),
  32: setDependentAnswerPreset(
    "Maybelline Cosmetics",
    "Maybelline LIP: After Zoning/Stocking/Merchandising, what is the Total # of Out Of Stocks during this visit",
    "text",
    [12],
    beautyUtils.getAfterOOSCount,
  ),

  /**************** On-hand Discrepancies ****************/
  40: setDependentAnswerPreset(
    "Maybelline Cosmetics",
    "MAYBELLINE EYE: 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(
    "Maybelline Cosmetics",
    "Maybelline FACE: 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(
    "Maybelline Cosmetics",
    "Maybelline LIP: 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,
  ),

  /**************** Count Corrections / DPCIs Corrected ****************/
  50: setDependentAnswerPreset(
    undefined,
    "MAYBELLINE EYE: What is the total number DPCIs in which the counts WERE CORRECTED in the INVENTORY AUDIT in your presence during this visit",
    "text",
    [40],
    beautyUtils.getTotalDPCIsCountCorrected,
  ),
  51: setDependentAnswerPreset(
    undefined,
    "Maybelline FACE: What is the total number DPCIs in which the counts WERE CORRECTED in the INVENTORY AUDIT in your presence during this visit",
    "text",
    [41],
    beautyUtils.getTotalDPCIsCountCorrected,
  ),
  52: setDependentAnswerPreset(
    undefined,
    "Maybelline LIP: What is the total number DPCIs in which the counts WERE CORRECTED in the INVENTORY AUDIT in your presence during this visit",
    "text",
    [42],
    beautyUtils.getTotalDPCIsCountCorrected,
  ),

  /**************** Closing Questions ****************/
  60: setDependentAnswerPreset(
    "Maybelline Cosmetics",
    "Select why 0 Items needed a count correction",
    "radio",
    [40, 41, 42],
    beautyUtils.getWhyZeroItemsNeededCountCorrection,
  ),
  61: setDirectAnswerPreset(
    "Maybelline Cosmetics",
    "Are there shelf labels missing on the Maybelline Cosmetic POG",
    "radio",
    () => "No shelf labels are missing from the MNY POG",
  ),
  62: setDependentAnswerPreset(
    "Maybelline Cosmetics Count Corrections",
    "Did a Team Lead assist you during your service to correct any Maybelline Cosmetics EYE or FACE or Lip incorrect counts for out of stock items in the Inventory Audit",
    "radio",
    [40, 41, 42],
    beautyUtils.getDidATeamMemberAssistYouWithUpdatingOnHands,
  ),
};
