Skip to content

Commit 791506e

Browse files
committed
Deprecate DTOv2.Insight
1 parent 985c5cd commit 791506e

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

Sources/DataTransferObjects/DTOs/DTOv2.swift

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -291,15 +291,8 @@ public enum DTOv2 {
291291
}
292292

293293
/// Defines an insight as saved to the database, no calculation results
294+
@available(*, deprecated, message: "Use V3InsightsController.Insight instead")
294295
public struct Insight: Codable, Hashable, Identifiable {
295-
public enum InsightType: String, Codable, Hashable {
296-
case timeseries
297-
case topN
298-
case customQuery
299-
case funnel
300-
case experiment
301-
}
302-
303296
public var id: UUID
304297
public var groupID: UUID
305298

@@ -308,7 +301,7 @@ public enum DTOv2 {
308301
public var title: String
309302

310303
/// What kind of insight is this?
311-
public var type: InsightType
304+
public var type: String
312305

313306
/// If set, display the chart with this accent color, otherwise fall back to default color
314307
public var accentColor: String?
@@ -348,7 +341,7 @@ public enum DTOv2 {
348341
groupID: UUID,
349342
order: Double?,
350343
title: String,
351-
type: InsightType,
344+
type: String,
352345
accentColor: String? = nil,
353346
widgetable _: Bool? = false,
354347
customQuery: CustomQuery? = nil,
@@ -577,7 +570,7 @@ public extension DTOv2.Insight {
577570
groupID: groupID,
578571
order: nil,
579572
title: "New Time Series Insight",
580-
type: .timeseries,
573+
type: "timeseries",
581574
customQuery: nil,
582575
signalType: nil,
583576
uniqueUser: false,
@@ -597,7 +590,7 @@ public extension DTOv2.Insight {
597590
groupID: groupID,
598591
order: nil,
599592
title: title ?? "New Breakdown Insight",
600-
type: .topN,
593+
type: "topN",
601594
customQuery: nil,
602595
signalType: nil,
603596
uniqueUser: false,
@@ -617,7 +610,7 @@ public extension DTOv2.Insight {
617610
groupID: groupID,
618611
order: nil,
619612
title: "Daily Active Users",
620-
type: .timeseries,
613+
type: "timeseries",
621614
customQuery: nil,
622615
signalType: nil,
623616
uniqueUser: true,
@@ -637,7 +630,7 @@ public extension DTOv2.Insight {
637630
groupID: groupID,
638631
order: nil,
639632
title: "Weekly Active Users",
640-
type: .timeseries,
633+
type: "timeseries",
641634
customQuery: nil,
642635
signalType: nil,
643636
uniqueUser: true,
@@ -657,7 +650,7 @@ public extension DTOv2.Insight {
657650
groupID: groupID,
658651
order: nil,
659652
title: "Active Users this Month",
660-
type: .timeseries,
653+
type: "timeseries",
661654
customQuery: nil,
662655
signalType: nil,
663656
uniqueUser: true,
@@ -677,7 +670,7 @@ public extension DTOv2.Insight {
677670
groupID: groupID,
678671
order: nil,
679672
title: "Signals by Day",
680-
type: .timeseries,
673+
type: "timeseries",
681674
customQuery: nil,
682675
signalType: nil,
683676
uniqueUser: false,
@@ -707,7 +700,7 @@ public extension DTOv2.Insight {
707700
groupID: groupID,
708701
order: nil,
709702
title: "Custom Query",
710-
type: .customQuery,
703+
type: "timeseries",
711704
customQuery: customQuery,
712705
signalType: nil,
713706
uniqueUser: false,

0 commit comments

Comments
 (0)