numeroLongTranslate property

String? numeroLongTranslate

Get the 'translation' of the Long number into an understandable String

From : AC1 CL13 To : Aff. Cult. #1 Comm. Lois #13

Implementation

String? get numeroLongTranslate {
  if ((this.numeroLong ?? "").length > 2) {
    if ((this.numeroLong ?? "").substring(0, 2) == "AC") {
      // affaires culturelles
      return "Aff. Cult. #" + (this.numeroLong ?? "").substring(2);
    }
    if ((this.numeroLong ?? "").substring(0, 2) == "AS") {
      // affaires sociales
      return "Aff. Soc. #" + (this.numeroLong ?? "").substring(2);
    }
    if ((this.numeroLong ?? "").substring(0, 2) == "CE") {
      // affaires écos
      return "Aff. Éco. #" + (this.numeroLong ?? "").substring(2);
    }
    if ((this.numeroLong ?? "").substring(0, 2) == "CF") {
      // comm finances
      return "Comm. Fin. #" + (this.numeroLong ?? "").substring(2);
    }
    if ((this.numeroLong ?? "").substring(0, 2) == "CL") {
      // comm lois
      return "Comm. Lois #" + (this.numeroLong ?? "").substring(2);
    }
  }
  return "#" + (this.numeroLong ?? "");
}