<commit_before>package org.openlmis.core.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.openlmis.core.exception.DataException;

import static org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion.NON_EMPTY;

@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonSerialize(include = NON_EMPTY)
public class EDIFileColumn extends BaseModel {
  protected String name;
  protected String dataFieldLabel;
  protected Boolean include;
  protected Boolean mandatory;
  protected Integer position;
  protected String datePattern;

  public void validate() {
    if (position == null || position == 0) {
      throw new DataException("file.invalid.position");
    }
  }
}<commit_msg>#996|  Fixing error message for edi file configuration<commit_after>package org.openlmis.core.domain;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.openlmis.core.exception.DataException;

import static org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion.NON_EMPTY;

@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonSerialize(include = NON_EMPTY)
public class EDIFileColumn extends BaseModel {
  protected String name;
  protected String dataFieldLabel;
  protected Boolean include;
  protected Boolean mandatory;
  protected Integer position;
  protected String datePattern;

  public void validate() {
    if (include && (position == null || position == 0)) {
      throw new DataException("file.invalid.position");
    }
  }
}
{'fraction_non_alphanumeric': 0.08690330477356181, 'fraction_numerical': 0.0030599755201958386, 'mean_word_length': 5.462450592885376, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6817505', 'n_tokens_mistral': 472, 'n_tokens_neox': 468, 'n_words': 116}