-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTodoDraft.swift
More file actions
79 lines (74 loc) · 2.12 KB
/
Copy pathTodoDraft.swift
File metadata and controls
79 lines (74 loc) · 2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//
// TodoDraft.swift
// DevLogDomain
//
// Created by opfic on 6/2/26.
//
import Foundation
public struct TodoDraft: Equatable {
public var id: String
public var isPinned: Bool
public var isCompleted: Bool
public var isChecked: Bool
public var title: String
public var content: String
public var createdAt: Date
public var updatedAt: Date
public var completedAt: Date?
public var dueDate: Date?
public var tags: [String]
public var category: TodoCategory
public init(
id: String,
isPinned: Bool,
isCompleted: Bool,
isChecked: Bool,
title: String,
content: String,
createdAt: Date,
updatedAt: Date,
completedAt: Date?,
dueDate: Date?,
tags: [String],
category: TodoCategory
) {
self.id = id
self.isPinned = isPinned
self.isCompleted = isCompleted
self.isChecked = isChecked
self.title = title
self.content = content
self.createdAt = createdAt
self.updatedAt = updatedAt
self.completedAt = completedAt
self.dueDate = dueDate
self.tags = tags
self.category = category
}
public init(todo: Todo) {
self.id = todo.id
self.isPinned = todo.isPinned
self.isCompleted = todo.isCompleted
self.isChecked = todo.isChecked
self.title = todo.title
self.content = todo.content
self.createdAt = todo.createdAt
self.updatedAt = todo.updatedAt
self.completedAt = todo.completedAt
self.dueDate = todo.dueDate
self.tags = todo.tags
self.category = todo.category
}
public static func == (lhs: TodoDraft, rhs: TodoDraft) -> Bool {
lhs.id == rhs.id &&
lhs.isPinned == rhs.isPinned &&
lhs.isCompleted == rhs.isCompleted &&
lhs.isChecked == rhs.isChecked &&
lhs.title == rhs.title &&
lhs.content == rhs.content &&
lhs.completedAt == rhs.completedAt &&
lhs.dueDate == rhs.dueDate &&
lhs.tags == rhs.tags &&
lhs.category == rhs.category
}
}