payfrit-beacon-ios/_backup/Models/Employment.swift
John Pinkyfloyd 8c2320da44 Add ios-marketing idiom, iPad orientations, launch screen
- 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>
2026-02-10 19:38:11 -08:00

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
}
}