toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() => {
      "_id": id,
      "created_at": createdAt.toIso8601String(),
      "goal_id": goalId,
      "participation_id": participationId,
      "status": status,
      "updated_at": updatedAt.toIso8601String(),
      "winned": winned,
      "winning_dates": List<dynamic>.from(
        winningDates.map((x) => x.toIso8601String()),
      ),
      "acceptances_count": acceptancesCount,
      "activity_target": activityTarget,
      "activity_times": activityTimes,
      "consolation_reward_amount": consolationRewardAmount,
      "consolation_reward_id": consolationRewardId,
      "consolation_reward_type": consolationRewardType,
      "deleted": deleted,
      "desc": desc,
      "enabled": enabled,
      "ends_at": endsAt.toIso8601String(),
      "formula": formula,
      "give_normal_points": giveNormalPoints,
      "global_awarded_count": globalAwardedCount,
      "global_limit": globalLimit,
      "image": image.toJson(),
      "interval": interval,
      "interval_samples": intervalSamples,
      "limit": limit,
      "mission_id": missionId,
      "name": name,
      "participant_metric_id": participantMetricId,
      "participant_metric_timeframe": participantMetricTimeframe,
      "participant_metric_value": participantMetricValue,
      "period": period,
      "pocket_id": pocketId,
      "recurrent": recurrent,
      "requires_acceptance": requiresAcceptance,
      "reward_type": rewardType,
      "secondary_metric_extra_percentage": secondaryMetricExtraPercentage,
      "secondary_participant_metric_id": secondaryParticipantMetricId,
      "secondary_participant_metric_timeframe": secondaryParticipantMetricTimeframe,
      "secondary_pocket_id": secondaryPocketId,
      "secondary_reward_id": secondaryRewardId,
      "secondary_reward_type": secondaryRewardType,
      "secondary_sponsor_id": secondarySponsorId,
      "secondary_sponsor_percentage": secondarySponsorPercentage,
      "sponsor_id": sponsorId,
      "sponsor_percentage": sponsorPercentage,
      "starts_at": startsAt.toIso8601String(),
      "tags": List<dynamic>.from(tags.map((x) => x)),
      "use_participant_metrics": useParticipantMetrics,
      "reward_name": rewardName,
      "goal_data": goalData,
      "conditions": conditionsGoals,
      "campaign_id": campaignId,
      "ended_at": endedAt?.toIso8601String(),
      "conditions_progress": conditionsProgress,
      "always_award_consolation_reward": alwaysAwardConsolationReward,
      "conditions_failure": conditionsFailure,
    };