payfrit-beacon-ios/_backup/Models/ServicePoint.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

47 lines
1.6 KiB
Swift

import Foundation
struct ServicePoint: Identifiable {
let id: Int
let businessId: Int
let name: String
let typeId: Int
let typeName: String
let code: String
let description: String
let sortOrder: Int
let isActive: Bool
let isClosedToNewMembers: Bool
let beaconId: Int?
let assignedByUserId: Int?
let createdAt: Date?
let updatedAt: Date?
init(json: [String: Any]) {
id = Beacon.parseInt(json["ID"] ?? json["ServicePointID"]) ?? 0
businessId = Beacon.parseInt(json["BusinessID"]) ?? 0
name = (json["Name"] as? String) ?? (json["ServicePointName"] as? String) ?? ""
typeId = Beacon.parseInt(json["TypeID"] ?? json["ServicePointTypeID"]) ?? 0
typeName = (json["TypeName"] as? String) ?? ""
code = (json["Code"] as? String) ?? ""
description = (json["Description"] as? String) ?? ""
sortOrder = Beacon.parseInt(json["SortOrder"]) ?? 0
isActive = Beacon.parseBool(json["IsActive"]) ?? true
isClosedToNewMembers = Beacon.parseBool(json["IsClosedToNewMembers"]) ?? false
beaconId = Beacon.parseInt(json["BeaconID"])
assignedByUserId = Beacon.parseInt(json["AssignedByUserID"])
createdAt = Beacon.parseDate(json["CreatedAt"])
updatedAt = Beacon.parseDate(json["UpdatedAt"])
}
}
struct ServicePointType: Identifiable {
let id: Int
let name: String
let sortOrder: Int
init(json: [String: Any]) {
id = Beacon.parseInt(json["ID"]) ?? 0
name = (json["Name"] as? String) ?? ""
sortOrder = Beacon.parseInt(json["SortOrder"]) ?? 0
}
}