- Fixed App Store icon display with ios-marketing idiom - Added iPad orientation support for multitasking - Added UILaunchScreen for iPad requirements - Removed unused BLE permissions and files from build Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
32 lines
1.2 KiB
Swift
32 lines
1.2 KiB
Swift
import Foundation
|
|
|
|
struct Employment: Identifiable {
|
|
/// Composite ID to avoid collisions when same employee works at multiple businesses
|
|
var id: String { "\(employeeId)-\(businessId)" }
|
|
let employeeId: Int
|
|
let businessId: Int
|
|
let businessName: String
|
|
let businessAddress: String
|
|
let businessCity: String
|
|
let employeeStatusId: Int
|
|
let pendingTaskCount: Int
|
|
|
|
var statusName: String {
|
|
switch employeeStatusId {
|
|
case 1: return "Active"
|
|
case 2: return "Suspended"
|
|
case 3: return "Terminated"
|
|
default: return "Unknown"
|
|
}
|
|
}
|
|
|
|
init(json: [String: Any]) {
|
|
employeeId = Beacon.parseInt(json["EmployeeID"]) ?? 0
|
|
businessId = Beacon.parseInt(json["BusinessID"]) ?? 0
|
|
businessName = (json["BusinessName"] as? String) ?? (json["Name"] as? String) ?? ""
|
|
businessAddress = (json["BusinessAddress"] as? String) ?? (json["Address"] as? String) ?? ""
|
|
businessCity = (json["BusinessCity"] as? String) ?? (json["City"] as? String) ?? ""
|
|
employeeStatusId = Beacon.parseInt(json["EmployeeStatusID"] ?? json["StatusID"]) ?? 0
|
|
pendingTaskCount = Beacon.parseInt(json["PendingTaskCount"]) ?? 0
|
|
}
|
|
}
|