Skip to content

Commit

Permalink
fix: Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
larshelge committed Dec 15, 2024
1 parent 64b3d07 commit 02b523f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

@NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public final class EnrollmentAnalyticsColumnName {

public static final String ENROLLMENT_COLUMN_NAME = "enrollment";
public static final String TRACKED_ENTITY_COLUMN_NAME = "trackedentity";
public static final String ENROLLMENT_DATE_COLUMN_NAME = "enrollmentdate";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,26 @@
@NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public final class EnrollmentAnalyticsColumn {

public static final AnalyticsTableColumn TRACKED_ENTITY =
AnalyticsTableColumn.builder()
.name(EnrollmentAnalyticsColumnName.TRACKED_ENTITY_COLUMN_NAME)
.dataType(CHARACTER_11)
.selectExpression("te.uid")
.build();
public static final AnalyticsTableColumn TRACKED_ENTITY_GEOMETRY =
AnalyticsTableColumn.builder()
.name(EnrollmentAnalyticsColumnName.TRACKED_ENTITY_GEOMETRY_COLUMN_NAME)
.dataType(GEOMETRY)
.selectExpression("te.geometry")
.build();

private static final AnalyticsTableColumn ENROLLMENT =
AnalyticsTableColumn.builder()
.name(EnrollmentAnalyticsColumnName.ENROLLMENT_COLUMN_NAME)
.dataType(CHARACTER_11)
.nullable(NOT_NULL)
.selectExpression("en.uid")
.build();
static final AnalyticsTableColumn TRACKED_ENTITY =
AnalyticsTableColumn.builder()
.name(EnrollmentAnalyticsColumnName.TRACKED_ENTITY_COLUMN_NAME)
.dataType(CHARACTER_11)
.selectExpression("te.uid")
.build();
private static final AnalyticsTableColumn ENROLLMENT_DATE =
AnalyticsTableColumn.builder()
.name(EnrollmentAnalyticsColumnName.ENROLLMENT_DATE_COLUMN_NAME)
Expand Down Expand Up @@ -152,12 +159,6 @@ public final class EnrollmentAnalyticsColumn {
.nullable(NOT_NULL)
.selectExpression("coalesce(registrationou.uid,ou.uid)")
.build();
static final AnalyticsTableColumn TRACKED_ENTITY_GEOMETRY =
AnalyticsTableColumn.builder()
.name(EnrollmentAnalyticsColumnName.TRACKED_ENTITY_GEOMETRY_COLUMN_NAME)
.dataType(GEOMETRY)
.selectExpression("te.geometry")
.build();

private static final List<AnalyticsTableColumn> COMMON_COLUMNS =
List.of(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,19 @@
@NoArgsConstructor(access = lombok.AccessLevel.PRIVATE)
public final class EventAnalyticsColumn {

public static final AnalyticsTableColumn TRACKED_ENTITY =
AnalyticsTableColumn.builder()
.name(EventAnalyticsColumnName.TRACKED_ENTITY_COLUMN_NAME)
.dataType(CHARACTER_11)
.selectExpression("te.uid")
.build();
public static final AnalyticsTableColumn TRACKED_ENTITY_GEOMETRY =
AnalyticsTableColumn.builder()
.name(EventAnalyticsColumnName.TRACKED_ENTITY_GEOMETRY_COLUMN_NAME)
.dataType(GEOMETRY)
.selectExpression("te.geometry")
.build();

// Common columns that work across all databases

private static final AnalyticsTableColumn EVENT =
Expand All @@ -65,12 +78,6 @@ public final class EventAnalyticsColumn {
.nullable(NOT_NULL)
.selectExpression("en.uid")
.build();
public static final AnalyticsTableColumn TRACKED_ENTITY =
AnalyticsTableColumn.builder()
.name(EventAnalyticsColumnName.TRACKED_ENTITY_COLUMN_NAME)
.dataType(CHARACTER_11)
.selectExpression("te.uid")
.build();
private static final AnalyticsTableColumn PS =
AnalyticsTableColumn.builder()
.name(EventAnalyticsColumnName.PS_COLUMN_NAME)
Expand Down Expand Up @@ -227,12 +234,6 @@ public final class EventAnalyticsColumn {
.nullable(NOT_NULL)
.selectExpression("coalesce(enrollmentou.uid,ou.uid)")
.build();
public static final AnalyticsTableColumn TRACKED_ENTITY_GEOMETRY =
AnalyticsTableColumn.builder()
.name(EventAnalyticsColumnName.TRACKED_ENTITY_GEOMETRY_COLUMN_NAME)
.dataType(GEOMETRY)
.selectExpression("te.geometry")
.build();

private static final List<AnalyticsTableColumn> COMMON_COLUMNS =
List.of(
Expand Down

0 comments on commit 02b523f

Please sign in to comment.