getGoalsToEntity static method
Implementation
static domain.GoalsParticipant getGoalsToEntity(infra.GoalStatus goal) => domain.GoalsParticipant(
id: goal.id,
userId: goal.participationId,
goalId: goal.goalId,
status: goal.status,
name: goal.name,
description: goal.desc,
image: goal.image.url,
formula: goal.formula,
activityTarget: goal.activityTarget,
activityTimes: goal.activityTimes,
startsDate: goal.startsAt,
endDate: goal.endsAt,
period: goal.period,
periodBegins: goal.startsAt,
periodEnds: goal.endsAt,
sponsorID: goal.sponsorId,
tags: goal.tags,
sponsorPercentage: goal.sponsorPercentage,
isEnabled: goal.enabled,
giveNormalPoints: goal.giveNormalPoints,
winned: goal.winned,
winningDates: goal.winningDates,
participantMetricValue: goal.participantMetricValue,
rewardName: goal.rewardName,
goalData: goal.goalData,
conditions: goal.conditionsGoals
.map((c) => domain.ConditionsGoals(
metricId: c.metricId,
metricName: c.metricName,
operatorMetric: c.conditionOperator,
timeframe: c.timeframe,
valueMetric: c.value,
))
.toList(),
);