60 lines
1.9 KiB
Swift
60 lines
1.9 KiB
Swift
//
|
|
// VehicleOwnershipPeriod.swift
|
|
// AutoCatCore
|
|
//
|
|
// Created by Selim Mustafaev on 13.06.2024.
|
|
// Copyright © 2024 Selim Mustafaev. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import RealmSwift
|
|
|
|
public final class VehicleOwnershipPeriod: Object, Decodable {
|
|
@Persisted public var lastOperation: String = ""
|
|
@Persisted public var ownerType: String = ""
|
|
@Persisted public var from: Int64 = 0
|
|
@Persisted public var to: Int64 = 0
|
|
@Persisted public var region: String?
|
|
@Persisted public var registrationRegion: String?
|
|
@Persisted public var locality: String?
|
|
@Persisted public var code: String?
|
|
@Persisted public var street: String?
|
|
@Persisted public var building: String?
|
|
@Persisted public var inn: String?
|
|
}
|
|
|
|
extension VehicleOwnershipPeriod: DtoConvertible {
|
|
|
|
public var dto: VehicleOwnershipPeriodDto {
|
|
|
|
VehicleOwnershipPeriodDto(lastOperation: lastOperation,
|
|
ownerType: ownerType,
|
|
from: from,
|
|
to: to,
|
|
region: region,
|
|
registrationRegion: registrationRegion,
|
|
locality: locality,
|
|
code: code,
|
|
street: street,
|
|
building: building,
|
|
inn: inn)
|
|
}
|
|
|
|
convenience public init(dto: VehicleOwnershipPeriodDto) {
|
|
|
|
self.init()
|
|
|
|
self.lastOperation = dto.lastOperation
|
|
self.ownerType = dto.ownerType
|
|
self.from = dto.from
|
|
self.to = dto.to
|
|
self.region = dto.region
|
|
self.registrationRegion = dto.registrationRegion
|
|
self.locality = dto.locality
|
|
self.code = dto.code
|
|
self.street = dto.street
|
|
self.building = dto.building
|
|
self.inn = dto.inn
|
|
}
|
|
}
|