Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit 7343890

Browse files
authored
Make Stats-related entities Equatable (#751)
2 parents d149306 + 26818ba commit 7343890

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Sources/WordPressKit/Models/Stats/Insights/StatsLastPostInsight.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public struct StatsLastPostInsight: Decodable {
1+
public struct StatsLastPostInsight: Equatable, Decodable {
22
public let title: String
33
public let url: URL
44
public let publishedDate: Date

Sources/WordPressKit/Models/Stats/Insights/StatsPostingStreakInsight.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public struct StatsPostingStreakInsight: Codable {
1+
public struct StatsPostingStreakInsight: Equatable, Codable {
22
public let streaks: PostingStreaks
33
public let postingEvents: [PostingStreakEvent]
44

@@ -54,7 +54,7 @@ public struct StatsPostingStreakInsight: Codable {
5454
}
5555
}
5656

57-
public struct PostingStreakEvent: Codable {
57+
public struct PostingStreakEvent: Equatable, Codable {
5858
public let date: Date
5959
public let postCount: Int
6060

@@ -64,7 +64,7 @@ public struct PostingStreakEvent: Codable {
6464
}
6565
}
6666

67-
public struct PostingStreaks: Codable {
67+
public struct PostingStreaks: Equatable, Codable {
6868
public let long: PostingStreak?
6969
public let current: PostingStreak?
7070

@@ -76,7 +76,7 @@ public struct PostingStreaks: Codable {
7676
}
7777
}
7878

79-
public struct PostingStreak: Codable {
79+
public struct PostingStreak: Equatable, Codable {
8080
public let start: Date
8181
public let end: Date
8282
public let length: Int

Sources/WordPressKit/Models/Stats/StatsPostDetails.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public struct StatsPostDetails {
1+
public struct StatsPostDetails: Equatable {
22
public let fetchedDate: Date
33
public let totalViewsCount: Int
44

@@ -8,7 +8,7 @@ public struct StatsPostDetails {
88
public let lastTwoWeeks: [StatsPostViews]
99
}
1010

11-
public struct StatsWeeklyBreakdown {
11+
public struct StatsWeeklyBreakdown: Equatable {
1212
public let startDay: DateComponents
1313
public let endDay: DateComponents
1414

@@ -19,7 +19,7 @@ public struct StatsWeeklyBreakdown {
1919
public let days: [StatsPostViews]
2020
}
2121

22-
public struct StatsPostViews {
22+
public struct StatsPostViews: Equatable {
2323
public let period: StatsPeriodUnit
2424
public let date: DateComponents
2525
public let viewsCount: Int

0 commit comments

Comments
 (0)