listMetricsToEntity static method

ListMetrics listMetricsToEntity(
  1. ListMetricsResponse response
)

Implementation

static domain.ListMetrics listMetricsToEntity(infra.ListMetricsResponse response) {
  return domain.ListMetrics(
    ok: response.ok,
    data: response.data
        .map(
          (e) => domain.DataListMetrics(
            id: e.id,
            name: e.name,
            description: e.description,
            coll: e.coll,
            targetProperty: e.targetProperty,
            analysisType: e.analysisType,
            filters: e.filter
                .map(
                  (f) => domain.FilterListMetrics(
                    id: f.id,
                    field: f.field,
                    metricOperator: f.filterOperator,
                    val: f.val,
                  ),
                )
                .toList(),
            useGoal: e.useGoals,
            goalRelatedInfo: {},
            slug: e.slug,
          ),
        )
        .toList(),
  );
}