-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e76e0d4
commit 88c4404
Showing
5 changed files
with
205 additions
and
223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
// | ||
// Feedback.swift | ||
// Splito | ||
// | ||
// Created by Nirali Sonani on 02/01/25. | ||
// | ||
|
||
import FirebaseFirestore | ||
|
||
public struct Feedback: Codable { | ||
|
||
@DocumentID public var id: String? // Automatically generated ID by Firestore | ||
|
||
var title: String | ||
var description: String | ||
var userId: String | ||
var attachmentUrls: [String]? | ||
var appVersion: String | ||
var deviceName: String | ||
var deviceOsVersion: String | ||
var createdAt: Timestamp | ||
|
||
public init(title: String, description: String, userId: String, attachmentUrls: [String]? = nil, | ||
appVersion: String, deviceName: String, deviceOsVersion: String, createdAt: Timestamp = Timestamp()) { | ||
self.title = title | ||
self.description = description | ||
self.userId = userId | ||
self.attachmentUrls = attachmentUrls | ||
self.appVersion = appVersion | ||
self.deviceName = deviceName | ||
self.deviceOsVersion = deviceOsVersion | ||
self.createdAt = createdAt | ||
} | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case id | ||
case title | ||
case description | ||
case userId = "user_id" | ||
case attachmentUrls = "attachment_urls" | ||
case appVersion = "app_version" | ||
case deviceName = "device_name" | ||
case deviceOsVersion = "device_os_version" | ||
case createdAt = "created_at" | ||
} | ||
} | ||
|
||
public struct Attachment { | ||
public var id = UUID().uuidString | ||
public var image: UIImage? | ||
public var videoData: Data? | ||
public var video: URL? | ||
public var name: String | ||
|
||
public init(id: String = UUID().uuidString, image: UIImage? = nil, videoData: Data? = nil, video: URL? = nil, name: String) { | ||
self.id = id | ||
self.image = image | ||
self.videoData = videoData | ||
self.video = video | ||
self.name = name | ||
} | ||
} | ||
|
||
public struct AttachmentData { | ||
public var data: Data | ||
public var attachment: Attachment | ||
|
||
public init(data: Data, attachment: Attachment) { | ||
self.data = data | ||
self.attachment = attachment | ||
} | ||
} | ||
|
||
public struct AttachmentInfo { | ||
public var id = UUID().uuidString | ||
public var url: String | ||
|
||
public init(id: String = UUID().uuidString, url: String) { | ||
self.id = id | ||
self.url = url | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.