diff --git a/Sources/SwiftFSRS/Models/Card.swift b/Sources/SwiftFSRS/Models/Card.swift index 8e4a96b..c4519c8 100644 --- a/Sources/SwiftFSRS/Models/Card.swift +++ b/Sources/SwiftFSRS/Models/Card.swift @@ -1,6 +1,9 @@ import Foundation public struct Card: Hashable, Codable, Sendable { + /// The current state of the card (New, Learning, Review, Relearning) + public var status: Status + /// Date when the card is next due for review public var due: Date @@ -22,9 +25,6 @@ public struct Card: Hashable, Codable, Sendable { /// Times the card was forgotten or remembered incorrectly public var lapses: Int - /// The current state of the card (New, Learning, Review, Relearning) - public var status: Status - /// The most recent review date, if applicable public var lastReview: Date? diff --git a/Sources/SwiftFSRS/Models/CardReview.swift b/Sources/SwiftFSRS/Models/CardReview.swift index 54bfb79..653d67f 100644 --- a/Sources/SwiftFSRS/Models/CardReview.swift +++ b/Sources/SwiftFSRS/Models/CardReview.swift @@ -1,10 +1,18 @@ import Foundation public struct CardReview: Codable { + /// The post-review card. public var card: Card + + /// The review log. public var reviewLog: ReviewLog - // Unlike other implementations, we only persist pre-review data in the review log + /// Initialize a new card review. + /// + /// - Parameters: + /// - card: The post-review card. + /// - oldCard: The pre-review card. + /// - rating: The rating given to the card. public init(card: Card, oldCard: Card, rating: Rating) { self.card = card