36 lines
805 B
Swift
36 lines
805 B
Swift
//
|
|
// VehiclePhoto.swift
|
|
// AutoCatCore
|
|
//
|
|
// Created by Selim Mustafaev on 13.06.2024.
|
|
// Copyright © 2024 Selim Mustafaev. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import RealmSwift
|
|
|
|
public final class VehiclePhoto: Object {
|
|
@Persisted public var brand: String?
|
|
@Persisted public var model: String?
|
|
@Persisted public var date: TimeInterval = 0
|
|
@Persisted public var url: String = ""
|
|
}
|
|
|
|
extension VehiclePhoto: DtoConvertible {
|
|
|
|
public var dto: VehiclePhotoDto {
|
|
|
|
VehiclePhotoDto(brand: brand, model: model, date: date, url: url)
|
|
}
|
|
|
|
public convenience init(dto: VehiclePhotoDto) {
|
|
|
|
self.init()
|
|
|
|
self.brand = dto.brand
|
|
self.model = dto.model
|
|
self.date = dto.date
|
|
self.url = dto.url
|
|
}
|
|
}
|