Skip to content

Commit

Permalink
Merge pull request #280 from bcgov/feature/blowby-enhancements
Browse files Browse the repository at this point in the history
[INV-254] FEATURE** Blow by data capture enhancement
  • Loading branch information
davidclaveau authored Jan 25, 2024
2 parents 6d0e5de + 5bf9a89 commit a456e33
Show file tree
Hide file tree
Showing 21 changed files with 1,314 additions and 65 deletions.
52 changes: 50 additions & 2 deletions ipad.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@
29FFEBBE237F1EAA00574E3F /* Settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29FFEBBD237F1EAA00574E3F /* Settings.swift */; };
29FFEBC1237F1F6F00574E3F /* SettingsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29FFEBC0237F1F6F00574E3F /* SettingsModel.swift */; };
29FFEBC4237F23B800574E3F /* JWTDecoder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29FFEBC3237F23B800574E3F /* JWTDecoder.swift */; };
41CAEC692B44A2C5002B2960 /* BlowbyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41CAEC682B44A2C5002B2960 /* BlowbyModel.swift */; };
41CAEC6B2B44AB0B002B2960 /* BlowbyFormHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41CAEC6A2B44AB0B002B2960 /* BlowbyFormHelper.swift */; };
41CAEC712B44BF19002B2960 /* BlowbyTableCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41CAEC702B44BF19002B2960 /* BlowbyTableCollectionViewCell.swift */; };
41CAEC732B44C1B1002B2960 /* BlowbyTableCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 41CAEC722B44C1B1002B2960 /* BlowbyTableCollectionViewCell.xib */; };
41CAEC7D2B45C538002B2960 /* ShiftBlowbysHeaderCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 41CAEC7C2B45C538002B2960 /* ShiftBlowbysHeaderCollectionViewCell.swift */; };
41CAEC7F2B45C54F002B2960 /* ShiftBlowbysHeaderCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 41CAEC7E2B45C54F002B2960 /* ShiftBlowbysHeaderCollectionViewCell.xib */; };
5C0F6979237B635800F96CA5 /* WaterBodyAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C0F6978237B635800F96CA5 /* WaterBodyAPI.swift */; };
5C0F697D237B683200F96CA5 /* CodesAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C0F697C237B683200F96CA5 /* CodesAPI.swift */; };
5C0F6980237C6DDA00F96CA5 /* APIChain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C0F697E237B6F7800F96CA5 /* APIChain.swift */; };
Expand All @@ -208,6 +214,8 @@
5C82D404237B31C200B065BA /* WatercraftRiskAssessmentAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C82D403237B31C200B065BA /* WatercraftRiskAssessmentAPI.swift */; };
9620B078298849BF0084268C /* NullSwitchInputCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9620B076298849BF0084268C /* NullSwitchInputCollectionViewCell.swift */; };
9620B079298849BF0084268C /* NullSwitchInputCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9620B077298849BF0084268C /* NullSwitchInputCollectionViewCell.xib */; };
96CDB9632B4886FF009A45C7 /* NewBlowbyModal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CDB9612B4886FF009A45C7 /* NewBlowbyModal.swift */; };
96CDB9642B4886FF009A45C7 /* NewBlowbyModal.xib in Resources */ = {isa = PBXBuildFile; fileRef = 96CDB9622B4886FF009A45C7 /* NewBlowbyModal.xib */; };
A7AE5275237CC3660044DBB7 /* unapproved-cross.json in Resources */ = {isa = PBXBuildFile; fileRef = A7AE5272237CC3660044DBB7 /* unapproved-cross.json */; };
A7AE5276237CC3660044DBB7 /* check-mark-success.json in Resources */ = {isa = PBXBuildFile; fileRef = A7AE5273237CC3660044DBB7 /* check-mark-success.json */; };
A7AE5277237CC3660044DBB7 /* sync-circle.json in Resources */ = {isa = PBXBuildFile; fileRef = A7AE5274237CC3660044DBB7 /* sync-circle.json */; };
Expand Down Expand Up @@ -413,6 +421,12 @@
29FFEBBD237F1EAA00574E3F /* Settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Settings.swift; sourceTree = "<group>"; };
29FFEBC0237F1F6F00574E3F /* SettingsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsModel.swift; sourceTree = "<group>"; };
29FFEBC3237F23B800574E3F /* JWTDecoder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = JWTDecoder.swift; sourceTree = "<group>"; };
41CAEC682B44A2C5002B2960 /* BlowbyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlowbyModel.swift; sourceTree = "<group>"; };
41CAEC6A2B44AB0B002B2960 /* BlowbyFormHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BlowbyFormHelper.swift; sourceTree = "<group>"; };
41CAEC702B44BF19002B2960 /* BlowbyTableCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BlowbyTableCollectionViewCell.swift; sourceTree = "<group>"; };
41CAEC722B44C1B1002B2960 /* BlowbyTableCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BlowbyTableCollectionViewCell.xib; sourceTree = "<group>"; };
41CAEC7C2B45C538002B2960 /* ShiftBlowbysHeaderCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShiftBlowbysHeaderCollectionViewCell.swift; sourceTree = "<group>"; };
41CAEC7E2B45C54F002B2960 /* ShiftBlowbysHeaderCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ShiftBlowbysHeaderCollectionViewCell.xib; sourceTree = "<group>"; };
5C0F6978237B635800F96CA5 /* WaterBodyAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WaterBodyAPI.swift; sourceTree = "<group>"; };
5C0F697A237B63F500F96CA5 /* MusselAppAPITest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MusselAppAPITest.swift; sourceTree = "<group>"; };
5C0F697C237B683200F96CA5 /* CodesAPI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodesAPI.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -445,6 +459,8 @@
763C8716EF742F6764FFE7D7 /* Pods-ipad.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ipad.debug.xcconfig"; path = "Target Support Files/Pods-ipad/Pods-ipad.debug.xcconfig"; sourceTree = "<group>"; };
9620B076298849BF0084268C /* NullSwitchInputCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NullSwitchInputCollectionViewCell.swift; sourceTree = "<group>"; };
9620B077298849BF0084268C /* NullSwitchInputCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NullSwitchInputCollectionViewCell.xib; sourceTree = "<group>"; };
96CDB9612B4886FF009A45C7 /* NewBlowbyModal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NewBlowbyModal.swift; sourceTree = "<group>"; };
96CDB9622B4886FF009A45C7 /* NewBlowbyModal.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NewBlowbyModal.xib; sourceTree = "<group>"; };
987374CFF5F2318652AA2FCC /* Pods-ipadTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ipadTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ipadTests/Pods-ipadTests.release.xcconfig"; sourceTree = "<group>"; };
99C48CD83AAD3AAA2CD083BF /* Pods-ipadTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ipadTests.release.xcconfig"; path = "Target Support Files/Pods-ipadTests/Pods-ipadTests.release.xcconfig"; sourceTree = "<group>"; };
A41A1378A874E8BDB895F235 /* Pods-ipad.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ipad.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ipad/Pods-ipad.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -592,6 +608,7 @@
children = (
29DB4E4023870F2B00B13646 /* ShiftModel.swift */,
2944BCD92433931600826F48 /* Form Fields */,
41CAEC682B44A2C5002B2960 /* BlowbyModel.swift */,
);
path = Shift;
sourceTree = "<group>";
Expand Down Expand Up @@ -622,6 +639,7 @@
isa = PBXGroup;
children = (
296DEC22238C56A30035E7FA /* ShiftFormHelper.swift */,
41CAEC6A2B44AB0B002B2960 /* BlowbyFormHelper.swift */,
);
path = "Form Fields";
sourceTree = "<group>";
Expand Down Expand Up @@ -676,6 +694,7 @@
2944BCDF243394A300826F48 /* Cells */ = {
isa = PBXGroup;
children = (
41CAEC7B2B45C4AC002B2960 /* Blowbys */,
29DB4E422387111700B13646 /* Base */,
29DB4E432387112000B13646 /* Header */,
29DB4E4B238712ED00B13646 /* Inspections */,
Expand Down Expand Up @@ -739,6 +758,7 @@
2944BCF52437C0EA00826F48 /* Views */ = {
isa = PBXGroup;
children = (
96CDB9602B4886FF009A45C7 /* New Blowby Modal */,
2968859026030F9D00ECA183 /* Major Cities Picker */,
2907E4B52368D21D00946B3F /* Input Modal */,
29A97437236FD615006C668F /* Form */,
Expand Down Expand Up @@ -1259,6 +1279,8 @@
29DB4E4B238712ED00B13646 /* Inspections */ = {
isa = PBXGroup;
children = (
41CAEC702B44BF19002B2960 /* BlowbyTableCollectionViewCell.swift */,
41CAEC722B44C1B1002B2960 /* BlowbyTableCollectionViewCell.xib */,
29DB4E4C2387131000B13646 /* InspectionsTableCollectionViewCell.swift */,
29DB4E4D2387131000B13646 /* InspectionsTableCollectionViewCell.xib */,
);
Expand Down Expand Up @@ -1374,6 +1396,15 @@
path = "JWT Decoder";
sourceTree = "<group>";
};
41CAEC7B2B45C4AC002B2960 /* Blowbys */ = {
isa = PBXGroup;
children = (
41CAEC7C2B45C538002B2960 /* ShiftBlowbysHeaderCollectionViewCell.swift */,
41CAEC7E2B45C54F002B2960 /* ShiftBlowbysHeaderCollectionViewCell.xib */,
);
path = Blowbys;
sourceTree = "<group>";
};
5C82D3D42374AECC00B065BA /* High Risk Modal */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1436,6 +1467,15 @@
path = "Null Switch Input";
sourceTree = "<group>";
};
96CDB9602B4886FF009A45C7 /* New Blowby Modal */ = {
isa = PBXGroup;
children = (
96CDB9612B4886FF009A45C7 /* NewBlowbyModal.swift */,
96CDB9622B4886FF009A45C7 /* NewBlowbyModal.xib */,
);
path = "New Blowby Modal";
sourceTree = "<group>";
};
A7AE5271237CC3660044DBB7 /* LottieAnimations */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1546,6 +1586,7 @@
1EF7EBF223EC8E3E003886F6 /* WaterbodyPicker.xib in Resources */,
29F29F93236B6A22004F12E7 /* SwitcherView.xib in Resources */,
5C82D3D32374A0D400B065BA /* .gitignore in Resources */,
41CAEC732B44C1B1002B2960 /* BlowbyTableCollectionViewCell.xib in Resources */,
5C82D3D72374AECC00B065BA /* HighRiskModalView.xib in Resources */,
2944AF9C2379B243007517DC /* ViewFieldCollectionViewCell.xib in Resources */,
A7AE5275237CC3660044DBB7 /* unapproved-cross.json in Resources */,
Expand Down Expand Up @@ -1579,6 +1620,7 @@
295051112374F54A000FBD6E /* IntegerInputCollectionViewCell.xib in Resources */,
299BF02023FCA19A001732CD /* pdfMap.pdf in Resources */,
294D8F6223847C9A0094090D /* TableRowTableViewCell.xib in Resources */,
96CDB9642B4886FF009A45C7 /* NewBlowbyModal.xib in Resources */,
296885B526030FE900ECA183 /* MajorCityPicker.xib in Resources */,
F5EB30A127B5C77400F22712 /* Main.storyboard in Resources */,
A7AE5276237CC3660044DBB7 /* check-mark-success.json in Resources */,
Expand All @@ -1601,6 +1643,7 @@
5C649C922412F6E300F01AE5 /* GoogleService-Info.plist in Resources */,
1E54FFB623D783940044721F /* InputTitleCollectionViewCell.xib in Resources */,
29CE5E1D2375E48000C54F96 /* ConditionalInputCollectionViewCell.xib in Resources */,
41CAEC7F2B45C54F002B2960 /* ShiftBlowbysHeaderCollectionViewCell.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1684,7 +1727,9 @@
296DEC27238C61A80035E7FA /* IntegerStepperInputCollectionViewCell.swift in Sources */,
5C7D32F424304CFC00AFCE43 /* UIViewControllerExtensions.swift in Sources */,
29BAC5192367B34000A620F4 /* Fonts.swift in Sources */,
96CDB9632B4886FF009A45C7 /* NewBlowbyModal.swift in Sources */,
5C82D404237B31C200B065BA /* WatercraftRiskAssessmentAPI.swift in Sources */,
41CAEC712B44BF19002B2960 /* BlowbyTableCollectionViewCell.swift in Sources */,
5C82D3D82374AECC00B065BA /* HighRiskModalView.swift in Sources */,
29BAC5102367984000A620F4 /* GradiantView.swift in Sources */,
291F918224742FD800974D33 /* WaterbodiesService.swift in Sources */,
Expand All @@ -1695,6 +1740,7 @@
295051092374D764000FBD6E /* DoubleInputCollectionViewCell.swift in Sources */,
5C82D3DD2374B9D700B065BA /* AppRemoteAPIConst.swift in Sources */,
29F29FA1236B8670004F12E7 /* DropdownCollectionViewCell.swift in Sources */,
41CAEC6B2B44AB0B002B2960 /* BlowbyFormHelper.swift in Sources */,
29D5866925D20E6F00FEB37E /* MajorCitiesService.swift in Sources */,
29514BD92368ADB100DC89C4 /* OptionType.swift in Sources */,
290DA9E12404622700438699 /* AwaitingAccessResponse.swift in Sources */,
Expand Down Expand Up @@ -1747,6 +1793,7 @@
2933DD5E238DC2150068E9DF /* CodeTableService.swift in Sources */,
2933DD67238ED4470068E9DF /* ShiftService.swift in Sources */,
29FEA0A023FF12C200F490DB /* UserRoleModel.swift in Sources */,
41CAEC692B44A2C5002B2960 /* BlowbyModel.swift in Sources */,
29DB4E3E23870B7B00B13646 /* ShifOverviewHeaderCollectionViewCell.swift in Sources */,
29DB4E462387113900B13646 /* BaseShiftOverviewCollectionViewCell.swift in Sources */,
5C82D3DF2374B9D700B065BA /* RemoteAPIManager.swift in Sources */,
Expand Down Expand Up @@ -1798,6 +1845,7 @@
298BF7CC2395D45C0072AA28 /* PreviousWaterBodyModel.swift in Sources */,
5C82D3DE2374B9D700B065BA /* RemoteAPI.swift in Sources */,
5C82D3F92376036700B065BA /* WorkflowAPI.swift in Sources */,
41CAEC7D2B45C538002B2960 /* ShiftBlowbysHeaderCollectionViewCell.swift in Sources */,
29BAC51C2367B5B500A620F4 /* RealmRequests.swift in Sources */,
2950510D2374DFF7000FBD6E /* StringExtension.swift in Sources */,
);
Expand Down Expand Up @@ -1997,7 +2045,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 383;
CURRENT_PROJECT_VERSION = 392;
DEVELOPMENT_TEAM = L796QSLV3E;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = L796QSLV3E;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -2027,7 +2075,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 383;
CURRENT_PROJECT_VERSION = 392;
DEVELOPMENT_TEAM = L796QSLV3E;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = L796QSLV3E;
ENABLE_BITCODE = NO;
Expand Down
5 changes: 5 additions & 0 deletions ipad/Constants/AppRemoteAPIConst.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ enum EndPoints: String {
case user = "/account/me"
case uploads = "/uploads/report-issue"
case majorCities = "/mussels/major-cities"
case blowBys = "/mussels/blow-bys"
}

/**
Expand Down Expand Up @@ -124,6 +125,10 @@ struct APIURL {
static let uploads: String = {
return Self.baseURL + EndPoints.uploads.rawValue
}()

static let blowBys: String = {
return Self.baseURL + EndPoints.blowBys.rawValue
}()
}


Expand Down
6 changes: 5 additions & 1 deletion ipad/Constants/StringConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ struct StringConstants {
static let inspections: String = ""
}
}

struct BlowbyFormHeaders {
static let timeStamp = "Blowby time"
static let watercraftComplexity = "Watercraft Complexity"
static let reportedToRapp = "Reported to RAPP"
}
// MARK: Shift
struct ShiftFormHeaders {
struct ShiftStart {
Expand Down
8 changes: 8 additions & 0 deletions ipad/Database/Storage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,14 @@ class Storage {
return object
}

// MARK: BlowBys
public func blowBy(withLocalId localId: String) -> BlowbyModel? {
guard let realm = try? Realm(), let object = realm.objects(BlowbyModel.self).filter("localId = %@", localId).first else {
return nil
}
return object
}

// MARK: Code Tables
public func codeTable(type: CodeTableType) -> [String] {
do {
Expand Down
137 changes: 137 additions & 0 deletions ipad/Models/Shift/BlowbyModel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
//
// BlowbyModel.swift
// ipad
//
// Created by Sustainment Team on 2024-01-02.
// Copyright © Sustainment Team. All rights reserved.
//

import Foundation

import Realm
import RealmSwift

/// Model for displaying Blowbys that occur during a shift, complies with Realm protocols
class BlowbyModel: Object, BaseRealmObject {
@objc dynamic var userId: String = ""
@objc dynamic var localId: String = {
return UUID().uuidString
}()

override class func primaryKey() -> String? {
return "localId"
}

@objc dynamic var remoteId: Int = -1
@objc dynamic var shouldSync: Bool = true

@objc dynamic var date: Date = Date()
@objc dynamic var timeStamp: String = ""

@objc dynamic var blowByTime: String = ""
@objc dynamic var watercraftComplexity: String = ""
@objc dynamic var reportedToRapp: Bool = false
@objc dynamic var formattedReporttoRapp: String = "No"

// MARK: Setters

/// Setter method for BlowbyModel, used when new Blowbys are created, as they are not Realm objects
/// - Parameters:
/// - value: value to change Models key to
/// - key: Text representation of the key to be changed in the model
func set(value: Any, for key: String) {
if self[key] == nil {
print("\(key) is nil")
return
}
self[key] = value
if key == "reportedToRapp" {
if let reported = value as? Bool {
formattedReporttoRapp = reported ? "Yes" : "No";
}
}
}

/// Setter method for BlowbyModel, used when editing a new Blowby, since Realm objects must be edited in a write transaction
/// - Parameters:
/// - value: Value to change Models key to
/// - key: Text representation of the key to be changed in the model
func editSet(value: Any, for key: String) {
do {
let realm = try Realm()
try realm.write {
self[key] = value;
if key == "reportedToRapp" {
if let reported = value as? Bool {
formattedReporttoRapp = reported ? "Yes" : "No";
}
}
}
} catch let error as NSError {
print("** REALM ERROR")
print(error)
}
}

/// Function for setting RemoteID of Object managed by Realm
/// - Parameter remoteId: remoteID Integer
func set(remoteId: Int) {
do {
let realm = try Realm()
try realm.write {
self.remoteId = remoteId
}
} catch let error as NSError {
print("** REALM ERROR")
print(error)
}
}

/// Returns Blowby fields set to this instance of object
/// - Parameters:
/// - editable: Boolean for determining if values can be edited, or remain static
/// - modalSize: Boolean to determine if Large or small size of input fields are returned
/// - Returns: Array of InputItems tailored to this model instance
func getThisBlowbyFields(editable: Bool, modalSize: Bool) -> [InputItem] {
return BlowByFormHelper.getBlowByFields(for: self, editable: editable, modalSize: modalSize)
}

/// Creates a formatted Date time object for displaying Blowby Data
/// - Parameters:
/// - time: Value from the TimeInput field
/// - date: Value from the Date Input field
/// - Returns: Date object taking the calendar date from date object, and time value from time String
func formattedDateTime(time: String, date: Date) -> String? {
let timeFormatter = DateFormatter()
timeFormatter.dateFormat = "YYYY-MM-dd HH:mm:ss"
timeFormatter.timeZone = TimeZone(abbreviation: "UTC")
let startDate = date
let startTimeSplit = time.components(separatedBy: ":")
guard let timeInDate = startDate.setTime(hour: Int(startTimeSplit[0]) ?? 0, min: Int(startTimeSplit[1]) ?? 0, sec: 1) else {
return nil
}

return timeFormatter.string(from: timeInDate)
}

// MARK: - To Dictionary
func toDictionary() -> [String : Any] {
return toDictionary(shift: -1)
}

func toDictionary(shift id: Int) -> [String : Any] {
let date = self.date
guard let blowByTimeFormatted = formattedDateTime(time: timeStamp, date: date) else {
return [String : Any]()
}

let body: [String: Any] = [
"observerWorkflowId": id,
"blowByTime": blowByTimeFormatted,
"watercraftComplexity": watercraftComplexity,
"reportedToRapp": reportedToRapp
]

return body
}
}
Loading

0 comments on commit a456e33

Please sign in to comment.