Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ jobs:
- name: Test
run: swift test -c ${{ matrix.config }}

skip-fuse:
name: Skip Fuse (Android)
runs-on: macos-26
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Swift Version
run: swift --version
- name: Build (Skip Fuse)
run: SKIP_FUSE=1 swift build --target CoreModelSQLite

android:
name: Android
runs-on: macos-15
Expand Down
25 changes: 24 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let package = Package(
dependencies: [
.package(
url: "https://github.com/PureSwift/CoreModel",
from: "2.7.1"
from: "2.7.2"
),
sqliteDependency
],
Expand All @@ -58,3 +58,26 @@ let package = Package(
)
]
)

// Skip (skip.dev) Fuse (native) transpilation support
let enableSkipFuse = ProcessInfo.processInfo.environment["SKIP_FUSE"] == "1"
if enableSkipFuse {
// Skip requires higher minimum deployment targets
package.platforms = [
.macOS(.v13),
.iOS(.v16),
.watchOS(.v9),
.tvOS(.v16),
.macCatalyst(.v16),
]
package.dependencies += [
.package(url: "https://source.skip.tools/skip.git", from: "1.9.0"),
.package(url: "https://source.skip.tools/skip-fuse.git", from: "1.0.0"),
]
package.targets[0].dependencies += [
.product(name: "SkipFuse", package: "skip-fuse")
]
package.targets[0].plugins = (package.targets[0].plugins ?? []) + [
.plugin(name: "skipstone", package: "skip")
]
}
2 changes: 2 additions & 0 deletions Sources/CoreModelSQLite/Skip/skip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
skip:
mode: 'native'
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Alsey Coleman Miller on 10/3/25.
//

import CoreModel

/// ProfessionalDriver Amenity Type
public enum AmenityType: String, Codable, CaseIterable, Sendable {

Expand All @@ -26,3 +28,7 @@ public enum AmenityType: String, Codable, CaseIterable, Sendable {
/// Clinic
case clinic
}

// MARK: - AttributeCodable

extension AmenityType: AttributeCodable {}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import CoreModel

public extension Date {

Expand Down Expand Up @@ -64,6 +65,10 @@ public extension Date.Month {
}
}

// MARK: - AttributeCodable

extension Date.Month: AttributeCodable {}

// MARK: - CustomStringConvertible

extension Date.Month: CustomStringConvertible {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import CoreModel

public extension Date {

Expand All @@ -27,6 +28,10 @@ public extension Date {
}
}

// MARK: - AttributeCodable

extension Date.Weekday: AttributeCodable {}

// MARK: - Comparable

extension Date.Weekday: Comparable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import CoreModel

#if canImport(UIKit)
import UIKit
Expand Down Expand Up @@ -84,6 +85,10 @@ extension Device.ID: ExpressibleByStringLiteral {
}
}

// MARK: - AttributeCodable

extension Device.ID: AttributeCodable {}

// MARK: - CustomStringConvertible

extension Device.ID: CustomStringConvertible, CustomDebugStringConvertible {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Alsey Coleman Miller on 5/6/25.
//

import CoreModel

/// Driver ID
public struct DriverID: RawRepresentable, Codable, Equatable, Hashable, Sendable {

Expand Down Expand Up @@ -32,6 +34,10 @@ extension DriverID: ExpressibleByStringLiteral {
}
}

// MARK: - AttributeCodable

extension DriverID: AttributeCodable {}

// MARK: - CustomStringConvertible

extension DriverID: CustomStringConvertible, CustomDebugStringConvertible {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Alsey Coleman Miller on 4/15/25.
//

import CoreModel

/// ProfessionalDriver Driver Type
public enum DriverType: String, Codable, CaseIterable, Sendable {

Expand All @@ -18,6 +20,12 @@ public enum DriverType: String, Codable, CaseIterable, Sendable {
case fleet = "TF"
}

// MARK: - AttributeCodable

extension DriverType: AttributeCodable {}

// MARK: - CustomStringConvertible

extension DriverType: CustomStringConvertible {
public var description: String {
switch self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import CoreModel
#if canImport(RegexBuilder)
import RegexBuilder
#endif
Expand Down Expand Up @@ -64,6 +65,10 @@ internal extension EmailAddress {
#endif
}

// MARK: - AttributeCodable

extension EmailAddress: AttributeCodable {}

// MARK: - CustomStringConvertible

extension EmailAddress: CustomStringConvertible, CustomDebugStringConvertible {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import CoreModel

/// PumpSmart Fleet Payment Identifier
public struct FleetPaymentType: Equatable, Hashable, Codable, Sendable, RawRepresentable {
Expand All @@ -20,6 +21,10 @@ public struct FleetPaymentType: Equatable, Hashable, Codable, Sendable, RawRepre
}
}

// MARK: - AttributeCodable

extension FleetPaymentType: AttributeCodable {}

// MARK: - ExpressibleByIntegerLiteral

extension FleetPaymentType: ExpressibleByIntegerLiteral {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extension FuelProduct.ID: CustomStringConvertible {

extension FuelProduct.ID: ObjectIDConvertible {

public init(objectID: ObjectID) {
public init?(objectID: ObjectID) {
self.init(rawValue: objectID.rawValue)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Alsey Coleman Miller on 8/29/23.
//

import CoreModel

/// Gas Vendor
public enum GasVendor: String, Codable, CaseIterable, Sendable {

Expand Down Expand Up @@ -32,6 +34,10 @@ public enum GasVendor: String, Codable, CaseIterable, Sendable {
case ultraMar = "Ultra-Mar"
}

// MARK: - AttributeCodable

extension GasVendor: AttributeCodable {}

// MARK: - CustomStringConvertible

extension GasVendor: CustomStringConvertible, CustomDebugStringConvertible {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import CoreModel

/// Location Identifier
public struct LocationID: RawRepresentable, Codable, Equatable, Hashable, Sendable {
Expand All @@ -26,6 +27,10 @@ extension LocationID: ExpressibleByIntegerLiteral {
}
}

// MARK: - AttributeCodable

extension LocationID: AttributeCodable {}

// MARK: - CustomStringConvertible

extension LocationID: CustomStringConvertible, CustomDebugStringConvertible {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@
// Created by Alsey Coleman Miller on 7/23/25.
//

import CoreModel

/// Parking Notification Type
public enum ParkingNotificationType: String, Codable, CaseIterable, Sendable {

case email = "Email"

case sms = "SMS"
}

// MARK: - AttributeCodable

extension ParkingNotificationType: AttributeCodable {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Alsey Coleman Miller on 7/23/25.
//

import CoreModel

/// Parking Payment Type
public enum ParkingPaymentType: String, Codable, CaseIterable, Sendable {

Expand All @@ -20,3 +22,7 @@ public enum ParkingPaymentType: String, Codable, CaseIterable, Sendable {
/// Cash
case cash = "Cash"
}

// MARK: - AttributeCodable

extension ParkingPaymentType: AttributeCodable {}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
// Created by Alsey Coleman Miller on 7/23/25.
//

import CoreModel

/// Parking Product Name
public enum ParkingProductName: String, Codable, CaseIterable, Sendable {

Expand All @@ -14,3 +16,7 @@ public enum ParkingProductName: String, Codable, CaseIterable, Sendable {

case wideLoad = "Wide Load"
}

// MARK: - AttributeCodable

extension ParkingProductName: AttributeCodable {}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import Foundation
import CoreModel

/// ProfessionalDriver Parking Reservation
@Entity
public struct ParkingReservation: Equatable, Hashable, Codable, Identifiable, Sendable, CachedEntity {

public let id: ID
Expand Down Expand Up @@ -121,54 +122,6 @@ public struct ParkingReservation: Equatable, Hashable, Codable, Identifiable, Se
}
}

extension ParkingReservation: Entity {

public static var entityName: EntityName {
"ParkingReservation"
}

public static var attributes: [CodingKeys: AttributeType] {
[
.deviceID: .string,
.created: .date,
.start: .date,
.end: .date,
.confirmationNumber: .string,
.productName: .string,
.paymentType: .string,
.totalCost: .double,
.firstName: .string,
.lastName: .string,
.email: .string,
.phone: .string,
.notificationType: .string,
.assetTruckNumber: .string,
.truckMake: .string,
.truckColor: .string,
.lastCached: .date
]
}

public static var relationships: [CodingKeys: Relationship] {
[
.site: Relationship(
id: .site,
entity: ParkingReservation.self,
destination: Site.self,
type: .toOne,
inverseRelationship: .parkingReservations
),
.user: Relationship(
id: .user,
entity: ParkingReservation.self,
destination: User.self,
type: .toOne,
inverseRelationship: .parkingReservations
)
]
}
}

// MARK: - Supporting Types

public extension ParkingReservation {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
//

import Foundation
import CoreModel

/// Phone Number
public struct PhoneNumber: RawRepresentable, Codable, Equatable, Hashable, Sendable {
Expand Down Expand Up @@ -58,6 +59,10 @@ public extension PhoneNumber {
}
}

// MARK: - AttributeCodable

extension PhoneNumber: AttributeCodable {}

// MARK: - ExpressibleByStringLiteral

extension PhoneNumber: ExpressibleByStringLiteral {
Expand Down
Loading
Loading