class Mautic {
  late int formId;
  String? firstname;
  String? lastname;
  String? email;
  String? fitnessLevel;
  String? goal;
  int? databaseId;
  String? subscriptionDate;
  String? language;
  String? purchaseDate;
  String? exerciseDate;
  String? trialDate;

  Map<String, dynamic> toJson() => {
        "formId": this.formId,
        "firstname": this.firstname,
        "lastname": this.lastname,
        "email": this.email,
        "fitnessLevel": this.fitnessLevel,
        "goal": this.goal,
        "databaseId": this.databaseId,
        "subscriptionDate": this.subscriptionDate,
        "lang": this.language
      };

  String toForm() {
    String form = "mauticform[formId]=${this.formId}";
    form += this.email == null ? "" : "&mauticform[email]=${this.email}";
    form += this.lastname == null ? "" : "&mauticform[f_name]=${this.lastname}";
    form += this.firstname == null ? "" : "&mauticform[firstname]=${this.firstname}";
    form += this.fitnessLevel == null ? "" : "&mauticform[fitness_level]=${this.fitnessLevel}";
    form += this.goal == null ? "" : "&mauticform[goal]=${this.goal}";
    form += this.subscriptionDate == null ? "" : "&mauticform[subscribed]=${this.subscriptionDate}";
    form += this.databaseId == null ? "" : "&mauticform[databaseid]=${this.databaseId}";
    form += this.language == null ? "" : "&mauticform[lang]=${this.language}";
    form += this.purchaseDate == null ? "" : "&mauticform[purchase_date]=${this.purchaseDate}";
    form += this.exerciseDate == null ? "" : "&mauticform[last_exercise]=${this.exerciseDate}";
    form += this.trialDate == null ? "" : "&mauticform[trialdate]=${this.trialDate}";

    return form;
  }

  @override
  String toString() => this.toJson().toString();
}
