package com.oguerreiro.resilient.error;

import com.oguerreiro.resilient.domain.enumeration.PeriodStatus;

public class ImporterPeriodNotOpenedToReceiveDataRuntimeException extends ResilientRuntimeException {
  private static final String CODE = "E023";

  public ImporterPeriodNotOpenedToReceiveDataRuntimeException(String name, PeriodStatus currentState) {
    super("Period [" + name + "] not ready to receive data. Expected state " + PeriodStatus.OPENED
        + " but it's current state is " + currentState + ".");

    addMessageArg(name);
    addMessageArg(PeriodStatus.OPENED);
    addMessageArg(currentState);
  }

  @Override
  public String getMessageCode() {
    return CODE;
  }

}