Adding more fields to vehicle model

This commit is contained in:
Selim Mustafaev 2022-04-03 00:40:09 +03:00
parent b81b613c9f
commit f7c1a3dcc0
16 changed files with 528 additions and 44 deletions

View File

@ -67,6 +67,15 @@
7AE32D6927F06536004EF6E0 /* CoreDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D6827F06536004EF6E0 /* CoreDataSource.swift */; }; 7AE32D6927F06536004EF6E0 /* CoreDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D6827F06536004EF6E0 /* CoreDataSource.swift */; };
7AE32D6E27F06D2D004EF6E0 /* SwiftDate in Frameworks */ = {isa = PBXBuildFile; productRef = 7AE32D6D27F06D2D004EF6E0 /* SwiftDate */; }; 7AE32D6E27F06D2D004EF6E0 /* SwiftDate in Frameworks */ = {isa = PBXBuildFile; productRef = 7AE32D6D27F06D2D004EF6E0 /* SwiftDate */; };
7AE32D7127F06DA4004EF6E0 /* DateSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D7027F06DA4004EF6E0 /* DateSection.swift */; }; 7AE32D7127F06DA4004EF6E0 /* DateSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AE32D7027F06DA4004EF6E0 /* DateSection.swift */; };
929EDE7F27F89C3000E55F65 /* VEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE7E27F89C3000E55F65 /* VEngine.swift */; };
929EDE8127F8A75E00E55F65 /* VPhoto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8027F8A75E00E55F65 /* VPhoto.swift */; };
929EDE8327F8C6C500E55F65 /* VOwnershipPeriod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8227F8C6C500E55F65 /* VOwnershipPeriod.swift */; };
929EDE8527F8CB0600E55F65 /* VEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8427F8CB0600E55F65 /* VEvent.swift */; };
929EDE8727F8E11E00E55F65 /* VOsago.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8627F8E11E00E55F65 /* VOsago.swift */; };
929EDE8927F8E65500E55F65 /* VAd.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8827F8E65500E55F65 /* VAd.swift */; };
929EDE8C27F8E87B00E55F65 /* VNote.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8B27F8E87B00E55F65 /* VNote.swift */; };
929EDE8E27F8F4F500E55F65 /* DebugInfoEntry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8D27F8F4F500E55F65 /* DebugInfoEntry.swift */; };
929EDE9027F8F76300E55F65 /* DebugInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8F27F8F76300E55F65 /* DebugInfo.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -180,6 +189,15 @@
7AE32D6527F063A1004EF6E0 /* UIEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIEdgeInsets.swift; sourceTree = "<group>"; }; 7AE32D6527F063A1004EF6E0 /* UIEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIEdgeInsets.swift; sourceTree = "<group>"; };
7AE32D6827F06536004EF6E0 /* CoreDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataSource.swift; sourceTree = "<group>"; }; 7AE32D6827F06536004EF6E0 /* CoreDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreDataSource.swift; sourceTree = "<group>"; };
7AE32D7027F06DA4004EF6E0 /* DateSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateSection.swift; sourceTree = "<group>"; }; 7AE32D7027F06DA4004EF6E0 /* DateSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DateSection.swift; sourceTree = "<group>"; };
929EDE7E27F89C3000E55F65 /* VEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VEngine.swift; sourceTree = "<group>"; };
929EDE8027F8A75E00E55F65 /* VPhoto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPhoto.swift; sourceTree = "<group>"; };
929EDE8227F8C6C500E55F65 /* VOwnershipPeriod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VOwnershipPeriod.swift; sourceTree = "<group>"; };
929EDE8427F8CB0600E55F65 /* VEvent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VEvent.swift; sourceTree = "<group>"; };
929EDE8627F8E11E00E55F65 /* VOsago.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VOsago.swift; sourceTree = "<group>"; };
929EDE8827F8E65500E55F65 /* VAd.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VAd.swift; sourceTree = "<group>"; };
929EDE8B27F8E87B00E55F65 /* VNote.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VNote.swift; sourceTree = "<group>"; };
929EDE8D27F8F4F500E55F65 /* DebugInfoEntry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugInfoEntry.swift; sourceTree = "<group>"; };
929EDE8F27F8F76300E55F65 /* DebugInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DebugInfo.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -416,14 +434,12 @@
7A49F50427D406CB00AEAAE0 /* Models */ = { 7A49F50427D406CB00AEAAE0 /* Models */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
7A49F50527D406CB00AEAAE0 /* VBrand.swift */, 929EDE8A27F8E84F00E55F65 /* vmodels */,
7A49F50627D406CB00AEAAE0 /* Vehicle.swift */, 7A49F50627D406CB00AEAAE0 /* Vehicle.swift */,
7A49F50727D406CB00AEAAE0 /* User.swift */, 7A49F50727D406CB00AEAAE0 /* User.swift */,
7A49F50827D406CB00AEAAE0 /* Response.swift */, 7A49F50827D406CB00AEAAE0 /* Response.swift */,
7A49F50927D406CB00AEAAE0 /* Settings.swift */, 7A49F50927D406CB00AEAAE0 /* Settings.swift */,
7A49F50A27D406CB00AEAAE0 /* PlateNumber.swift */, 7A49F50A27D406CB00AEAAE0 /* PlateNumber.swift */,
7A49F50B27D406CB00AEAAE0 /* VName.swift */,
7A1D80E727F30399007BD64F /* VModel.swift */,
); );
path = Models; path = Models;
sourceTree = "<group>"; sourceTree = "<group>";
@ -452,6 +468,25 @@
path = DataSource; path = DataSource;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
929EDE8A27F8E84F00E55F65 /* vmodels */ = {
isa = PBXGroup;
children = (
7A49F50527D406CB00AEAAE0 /* VBrand.swift */,
7A49F50B27D406CB00AEAAE0 /* VName.swift */,
7A1D80E727F30399007BD64F /* VModel.swift */,
929EDE7E27F89C3000E55F65 /* VEngine.swift */,
929EDE8027F8A75E00E55F65 /* VPhoto.swift */,
929EDE8227F8C6C500E55F65 /* VOwnershipPeriod.swift */,
929EDE8427F8CB0600E55F65 /* VEvent.swift */,
929EDE8627F8E11E00E55F65 /* VOsago.swift */,
929EDE8827F8E65500E55F65 /* VAd.swift */,
929EDE8B27F8E87B00E55F65 /* VNote.swift */,
929EDE8D27F8F4F500E55F65 /* DebugInfoEntry.swift */,
929EDE8F27F8F76300E55F65 /* DebugInfo.swift */,
);
path = vmodels;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */ /* Begin PBXHeadersBuildPhase section */
@ -724,7 +759,10 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
7A49F50D27D406CB00AEAAE0 /* Vehicle.swift in Sources */, 7A49F50D27D406CB00AEAAE0 /* Vehicle.swift in Sources */,
929EDE8327F8C6C500E55F65 /* VOwnershipPeriod.swift in Sources */,
929EDE8C27F8E87B00E55F65 /* VNote.swift in Sources */,
7A49F50327D406C300AEAAE0 /* VehicleService.swift in Sources */, 7A49F50327D406C300AEAAE0 /* VehicleService.swift in Sources */,
929EDE8E27F8F4F500E55F65 /* DebugInfoEntry.swift in Sources */,
7A49F4DB27D4064500AEAAE0 /* AutoCatCore.docc in Sources */, 7A49F4DB27D4064500AEAAE0 /* AutoCatCore.docc in Sources */,
7A49F50227D406C300AEAAE0 /* StorageService.swift in Sources */, 7A49F50227D406C300AEAAE0 /* StorageService.swift in Sources */,
7A49F4FE27D406BA00AEAAE0 /* AnyEncodable.swift in Sources */, 7A49F4FE27D406BA00AEAAE0 /* AnyEncodable.swift in Sources */,
@ -733,10 +771,16 @@
7A49F51127D406CB00AEAAE0 /* PlateNumber.swift in Sources */, 7A49F51127D406CB00AEAAE0 /* PlateNumber.swift in Sources */,
7A49F50C27D406CB00AEAAE0 /* VBrand.swift in Sources */, 7A49F50C27D406CB00AEAAE0 /* VBrand.swift in Sources */,
7A49F51027D406CB00AEAAE0 /* Settings.swift in Sources */, 7A49F51027D406CB00AEAAE0 /* Settings.swift in Sources */,
929EDE9027F8F76300E55F65 /* DebugInfo.swift in Sources */,
929EDE8927F8E65500E55F65 /* VAd.swift in Sources */,
7A49F4F927D406B200AEAAE0 /* Constants.swift in Sources */, 7A49F4F927D406B200AEAAE0 /* Constants.swift in Sources */,
929EDE8527F8CB0600E55F65 /* VEvent.swift in Sources */,
7A49F50F27D406CB00AEAAE0 /* Response.swift in Sources */, 7A49F50F27D406CB00AEAAE0 /* Response.swift in Sources */,
929EDE8127F8A75E00E55F65 /* VPhoto.swift in Sources */,
7A49F4FB27D406B200AEAAE0 /* Api.swift in Sources */, 7A49F4FB27D406B200AEAAE0 /* Api.swift in Sources */,
7A49F51527D40C6100AEAAE0 /* AutoCat2.xcdatamodeld in Sources */, 7A49F51527D40C6100AEAAE0 /* AutoCat2.xcdatamodeld in Sources */,
929EDE7F27F89C3000E55F65 /* VEngine.swift in Sources */,
929EDE8727F8E11E00E55F65 /* VOsago.swift in Sources */,
7A49F50E27D406CB00AEAAE0 /* User.swift in Sources */, 7A49F50E27D406CB00AEAAE0 /* User.swift in Sources */,
7A49F4FA27D406B200AEAAE0 /* ApiError.swift in Sources */, 7A49F4FA27D406B200AEAAE0 /* ApiError.swift in Sources */,
7AE32D7127F06DA4004EF6E0 /* DateSection.swift in Sources */, 7AE32D7127F06DA4004EF6E0 /* DateSection.swift in Sources */,

View File

@ -1,41 +1,43 @@
{ {
"object": {
"pins": [ "pins": [
{ {
"identity" : "differencekit", "package": "DifferenceKit",
"kind" : "remoteSourceControl", "repositoryURL": "https://github.com/ra1028/DifferenceKit",
"location" : "https://github.com/ra1028/DifferenceKit",
"state": { "state": {
"branch": null,
"revision": "62745d7780deef4a023a792a1f8f763ec7bf9705", "revision": "62745d7780deef4a023a792a1f8f763ec7bf9705",
"version": "1.2.0" "version": "1.2.0"
} }
}, },
{ {
"identity" : "pkhud", "package": "PKHUD",
"kind" : "remoteSourceControl", "repositoryURL": "https://github.com/pkluz/PKHUD.git",
"location" : "https://github.com/pkluz/PKHUD.git",
"state": { "state": {
"branch": null,
"revision": "8fd26f23057c6bebd6695524b1c3e05e93aba571", "revision": "8fd26f23057c6bebd6695524b1c3e05e93aba571",
"version": "5.4.0" "version": "5.4.0"
} }
}, },
{ {
"identity" : "swiftdate", "package": "SwiftDate",
"kind" : "remoteSourceControl", "repositoryURL": "https://github.com/malcommac/SwiftDate",
"location" : "https://github.com/malcommac/SwiftDate",
"state": { "state": {
"branch": null,
"revision": "6190d0cefff3013e77ed567e6b074f324e5c5bf5", "revision": "6190d0cefff3013e77ed567e6b074f324e5c5bf5",
"version": "6.3.1" "version": "6.3.1"
} }
}, },
{ {
"identity" : "swiftentrykit", "package": "SwiftEntryKit",
"kind" : "remoteSourceControl", "repositoryURL": "https://github.com/huri000/SwiftEntryKit",
"location" : "https://github.com/huri000/SwiftEntryKit",
"state": { "state": {
"branch": null,
"revision": "5ad36cccf0c4b9fea32f4e9b17a8e38f07563ef0", "revision": "5ad36cccf0c4b9fea32f4e9b17a8e38f07563ef0",
"version": "2.0.0" "version": "2.0.0"
} }
} }
], ]
"version" : 2 },
"version": 1
} }

View File

@ -1,5 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="20086" systemVersion="21E230" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithCloudKit="YES" userDefinedModelVersionIdentifier=""> <model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="19574" systemVersion="20G80" minimumToolsVersion="Automatic" sourceLanguage="Swift" usedWithCloudKit="YES" userDefinedModelVersionIdentifier="">
<entity name="DebugInfo" representedClassName=".CDDebugInfo" syncable="YES" codeGenerationType="class">
<relationship name="autocod" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfoEntry" inverseName="autocodInfo" inverseEntity="DebugInfoEntry"/>
<relationship name="nomerogram" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfoEntry" inverseName="nomerogramInfo" inverseEntity="DebugInfoEntry"/>
<relationship name="vehicle" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Vehicle" inverseName="debugInfo" inverseEntity="Vehicle"/>
<relationship name="vin01base" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfoEntry" inverseName="vin01baseInfo" inverseEntity="DebugInfoEntry"/>
<relationship name="vin01history" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfoEntry" inverseName="vin01historyInfo" inverseEntity="DebugInfoEntry"/>
<relationship name="vin01vin" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfoEntry" inverseName="vin01vinInfo" inverseEntity="DebugInfoEntry"/>
</entity>
<entity name="DebugInfoEntry" representedClassName=".CDDebugInfoEntry" syncable="YES" codeGenerationType="class">
<attribute name="error" optional="YES" attributeType="String"/>
<attribute name="fields" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="status" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<relationship name="autocodInfo" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfo" inverseName="autocod" inverseEntity="DebugInfo"/>
<relationship name="nomerogramInfo" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfo" inverseName="nomerogram" inverseEntity="DebugInfo"/>
<relationship name="vin01baseInfo" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfo" inverseName="vin01base" inverseEntity="DebugInfo"/>
<relationship name="vin01historyInfo" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfo" inverseName="vin01history" inverseEntity="DebugInfo"/>
<relationship name="vin01vinInfo" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfo" inverseName="vin01vin" inverseEntity="DebugInfo"/>
</entity>
<entity name="VAd" representedClassName=".CDVAd" syncable="YES" codeGenerationType="class">
<attribute name="adDescription" optional="YES" attributeType="String"/>
<attribute name="city" optional="YES" attributeType="String"/>
<attribute name="date" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="id" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="mileage" optional="YES" attributeType="String"/>
<attribute name="photos" optional="YES" attributeType="Transformable" valueTransformerName="NSSecureUnarchiveFromData" customClassName=".[String]"/>
<attribute name="price" optional="YES" attributeType="String"/>
<attribute name="region" optional="YES" attributeType="String"/>
<attribute name="url" optional="YES" attributeType="String"/>
<relationship name="vehicle" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Vehicle" inverseName="ads" inverseEntity="Vehicle"/>
</entity>
<entity name="VBrand" representedClassName=".CDVBrand" syncable="YES" codeGenerationType="class"> <entity name="VBrand" representedClassName=".CDVBrand" syncable="YES" codeGenerationType="class">
<attribute name="logo" optional="YES" attributeType="String"/> <attribute name="logo" optional="YES" attributeType="String"/>
<relationship name="name" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VName" inverseName="brand" inverseEntity="VName"/> <relationship name="name" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VName" inverseName="brand" inverseEntity="VName"/>
@ -21,8 +51,34 @@
<attribute name="vin1" optional="YES" attributeType="String"/> <attribute name="vin1" optional="YES" attributeType="String"/>
<attribute name="vin2" optional="YES" attributeType="String"/> <attribute name="vin2" optional="YES" attributeType="String"/>
<attribute name="year" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/> <attribute name="year" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<relationship name="ads" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="VAd" inverseName="vehicle" inverseEntity="VAd"/>
<relationship name="brand" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VBrand" inverseName="vehicle" inverseEntity="VBrand"/> <relationship name="brand" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VBrand" inverseName="vehicle" inverseEntity="VBrand"/>
<relationship name="debugInfo" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="DebugInfo" inverseName="vehicle" inverseEntity="DebugInfo"/>
<relationship name="engine" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VEngine" inverseName="vehicle" inverseEntity="VEngine"/>
<relationship name="events" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="VEvent" inverseName="vehicle" inverseEntity="VEvent"/>
<relationship name="model" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VModel" inverseName="vehicle" inverseEntity="VModel"/> <relationship name="model" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VModel" inverseName="vehicle" inverseEntity="VModel"/>
<relationship name="notes" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="VNote" inverseName="vehicle" inverseEntity="VNote"/>
<relationship name="osagoContracts" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="VOsago" inverseName="vehicle" inverseEntity="VOsago"/>
<relationship name="ownershipPeriods" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="VOwnershipPeriod" inverseName="vehicle" inverseEntity="VOwnershipPeriod"/>
<relationship name="photos" optional="YES" toMany="YES" deletionRule="Nullify" destinationEntity="VPhoto" inverseName="vehicle" inverseEntity="VPhoto"/>
</entity>
<entity name="VEngine" representedClassName=".CDVEngine" syncable="YES" codeGenerationType="class">
<attribute name="fuelType" optional="YES" attributeType="String"/>
<attribute name="number" optional="YES" attributeType="String"/>
<attribute name="powerHp" optional="YES" attributeType="Float" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="powerKw" optional="YES" attributeType="Float" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="volume" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<relationship name="vehicle" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Vehicle" inverseName="engine" inverseEntity="Vehicle"/>
</entity>
<entity name="VEvent" representedClassName=".CDVEvent" syncable="YES" codeGenerationType="class">
<attribute name="address" optional="YES" attributeType="String"/>
<attribute name="date" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="direction" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="id" optional="YES" attributeType="String"/>
<attribute name="latitude" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="longitude" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="speed" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<relationship name="vehicle" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Vehicle" inverseName="events" inverseEntity="Vehicle"/>
</entity> </entity>
<entity name="VModel" representedClassName=".CDVModel" syncable="YES" codeGenerationType="class"> <entity name="VModel" representedClassName=".CDVModel" syncable="YES" codeGenerationType="class">
<relationship name="name" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VName" inverseName="model" inverseEntity="VName"/> <relationship name="name" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VName" inverseName="model" inverseEntity="VName"/>
@ -34,10 +90,60 @@
<relationship name="brand" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VBrand" inverseName="name" inverseEntity="VBrand"/> <relationship name="brand" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VBrand" inverseName="name" inverseEntity="VBrand"/>
<relationship name="model" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VModel" inverseName="name" inverseEntity="VModel"/> <relationship name="model" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="VModel" inverseName="name" inverseEntity="VModel"/>
</entity> </entity>
<entity name="VNote" representedClassName=".CDVNote" syncable="YES" codeGenerationType="class">
<attribute name="date" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="id" optional="YES" attributeType="String"/>
<attribute name="text" optional="YES" attributeType="String"/>
<attribute name="user" optional="YES" attributeType="String"/>
<relationship name="vehicle" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Vehicle" inverseName="notes" inverseEntity="Vehicle"/>
</entity>
<entity name="VOsago" representedClassName=".CDVOsago" syncable="YES" codeGenerationType="class">
<attribute name="date" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="insurant" optional="YES" attributeType="String"/>
<attribute name="name" optional="YES" attributeType="String"/>
<attribute name="number" optional="YES" attributeType="String"/>
<attribute name="owner" optional="YES" attributeType="String"/>
<attribute name="plateNumber" optional="YES" attributeType="String"/>
<attribute name="restrictions" optional="YES" attributeType="String"/>
<attribute name="status" optional="YES" attributeType="String"/>
<attribute name="usageRegion" optional="YES" attributeType="String"/>
<attribute name="vin" optional="YES" attributeType="String"/>
<relationship name="vehicle" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Vehicle" inverseName="osagoContracts" inverseEntity="Vehicle"/>
</entity>
<entity name="VOwnershipPeriod" representedClassName=".CDVOwnershipPeriod" syncable="YES" codeGenerationType="class">
<attribute name="building" optional="YES" attributeType="String"/>
<attribute name="code" optional="YES" attributeType="String"/>
<attribute name="from" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<attribute name="inn" optional="YES" attributeType="String"/>
<attribute name="lastOperation" optional="YES" attributeType="String"/>
<attribute name="locality" optional="YES" attributeType="String"/>
<attribute name="ownerType" optional="YES" attributeType="String"/>
<attribute name="region" optional="YES" attributeType="String"/>
<attribute name="registrationRegion" optional="YES" attributeType="String"/>
<attribute name="street" optional="YES" attributeType="String"/>
<attribute name="to" optional="YES" attributeType="Integer 64" defaultValueString="0" usesScalarValueType="YES"/>
<relationship name="vehicle" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Vehicle" inverseName="ownershipPeriods" inverseEntity="Vehicle"/>
</entity>
<entity name="VPhoto" representedClassName=".CDVPhoto" syncable="YES" codeGenerationType="class">
<attribute name="brand" optional="YES" attributeType="String"/>
<attribute name="date" optional="YES" attributeType="Double" defaultValueString="0.0" usesScalarValueType="YES"/>
<attribute name="model" optional="YES" attributeType="String"/>
<attribute name="url" optional="YES" attributeType="String"/>
<relationship name="vehicle" optional="YES" maxCount="1" deletionRule="Nullify" destinationEntity="Vehicle" inverseName="photos" inverseEntity="Vehicle"/>
</entity>
<elements> <elements>
<element name="VBrand" positionX="118.7528686523438" positionY="-209.1094360351562" width="128" height="74"/> <element name="VBrand" positionX="118.7528686523438" positionY="-209.1094360351562" width="128" height="74"/>
<element name="Vehicle" positionX="-145.9427490234375" positionY="-363.4805297851562" width="128" height="284"/> <element name="Vehicle" positionX="-145.9427490234375" positionY="-363.4805297851562" width="128" height="404"/>
<element name="VName" positionX="-54" positionY="9" width="128" height="89"/>
<element name="VModel" positionX="-9" positionY="-207" width="128" height="59"/> <element name="VModel" positionX="-9" positionY="-207" width="128" height="59"/>
<element name="VName" positionX="-54" positionY="9" width="128" height="89"/>
<element name="VEngine" positionX="-9" positionY="-207" width="128" height="119"/>
<element name="VPhoto" positionX="0" positionY="-198" width="128" height="104"/>
<element name="VOwnershipPeriod" positionX="9" positionY="-189" width="128" height="209"/>
<element name="VEvent" positionX="18" positionY="-180" width="128" height="149"/>
<element name="VOsago" positionX="27" positionY="-171" width="128" height="194"/>
<element name="VAd" positionX="36" positionY="-162" width="128" height="179"/>
<element name="VNote" positionX="45" positionY="-153" width="128" height="104"/>
<element name="DebugInfoEntry" positionX="-9" positionY="-207" width="128" height="149"/>
<element name="DebugInfo" positionX="0" positionY="-198" width="128" height="119"/>
</elements> </elements>
</model> </model>

View File

@ -20,6 +20,14 @@ public struct Vehicle: Decodable {
public let isRightWheel: Bool? public let isRightWheel: Bool?
public let isJapanese: Bool? public let isJapanese: Bool?
public let addedBy: String? public let addedBy: String?
public let engine: VEngine?
public let photos: [VPhoto]
public let ownershipPeriods: [VOwnershipPeriod]
public let events: [VEvent]
public let osagoContracts: [VOsago]
public let ads: [VAd]
public let notes: [VNote]
public let debugInfo: DebugInfo?
} }
extension CDVehicle: Dated { extension CDVehicle: Dated {
@ -66,6 +74,14 @@ extension CDVehicle {
self.isJapanese = vehicle.isJapanese ?? false self.isJapanese = vehicle.isJapanese ?? false
self.addedBy = vehicle.addedBy self.addedBy = vehicle.addedBy
self.synchronized = true self.synchronized = true
self.engine = CDVEngine(model: vehicle.engine, context: context)
self.photos = NSSet(array: vehicle.photos.map { CDVPhoto(model: $0, context: context) })
self.ownershipPeriods = NSSet(array: vehicle.ownershipPeriods.map { CDVOwnershipPeriod(model: $0, context: context) })
self.events = NSSet(array: vehicle.events.map { CDVEvent(model: $0, context: context) })
self.osagoContracts = NSSet(array: vehicle.osagoContracts.map { CDVOsago(model: $0, context: context) })
self.ads = NSSet(array: vehicle.ads.map { CDVAd(model: $0, context: context) })
self.notes = NSSet(array: vehicle.notes.map { CDVNote(model: $0, context: context) })
self.debugInfo = CDDebugInfo(model: vehicle.debugInfo, context: context)
} }
public var unrecognized: Bool { public var unrecognized: Bool {

View File

@ -0,0 +1,31 @@
//
// DebugInfo.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 03.04.2022.
//
import Foundation
import CoreData
public struct DebugInfo: Decodable {
let autocod: DebugInfoEntry?
let vin01vin: DebugInfoEntry?
let vin01base: DebugInfoEntry?
let vin01history: DebugInfoEntry?
let nomerogram: DebugInfoEntry?
}
extension CDDebugInfo {
convenience init(model: DebugInfo?, context: NSManagedObjectContext) {
self.init(context: context)
self.autocod = CDDebugInfoEntry(model: model?.autocod, context: context)
self.vin01vin = CDDebugInfoEntry(model: model?.vin01vin, context: context)
self.vin01base = CDDebugInfoEntry(model: model?.vin01base, context: context)
self.vin01history = CDDebugInfoEntry(model: model?.vin01history, context: context)
self.nomerogram = CDDebugInfoEntry(model: model?.nomerogram, context: context)
}
}

View File

@ -0,0 +1,38 @@
//
// DebugInfoEntry.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 03.04.2022.
//
import Foundation
import CoreData
public enum DebugInfoStatus: Int64 {
case success = 0
case error = 1
case warning = 2
}
public struct DebugInfoEntry: Decodable {
let fields: Int64
let error: String?
let status: Int64
}
extension CDDebugInfoEntry {
convenience init(model: DebugInfoEntry?, context: NSManagedObjectContext) {
self.init(context: context)
self.fields = model?.fields ?? 0
self.error = model?.error
self.status = model?.status ?? 0
}
public var statusEnum: DebugInfoStatus {
get { DebugInfoStatus(rawValue: self.status)! }
set { self.status = newValue.rawValue }
}
}

View File

@ -0,0 +1,39 @@
//
// VAd.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 02.04.2022.
//
import Foundation
import CoreData
public struct VAd: Decodable {
let id: Int64
let url: String?
let price: String?
let date: Double
let mileage: String?
let region: String?
let city: String?
let adDescription: String?
let photos: [String]
}
extension CDVAd {
convenience init(model: VAd?, context: NSManagedObjectContext) {
self.init(context: context)
self.id = model?.id ?? 0
self.url = model?.url
self.price = model?.price
self.date = model?.date ?? 0
self.mileage = model?.mileage
self.region = model?.region
self.city = model?.city
self.adDescription = model?.adDescription
self.photos = model?.photos
}
}

View File

@ -0,0 +1,31 @@
//
// VEngine.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 02.04.2022.
//
import Foundation
import CoreData
public struct VEngine: Decodable {
let number: String?
let volume: Int64?
let powerHp: Float?
let powerKw: Float?
let fuelType: String?
}
extension CDVEngine {
convenience init(model: VEngine?, context: NSManagedObjectContext) {
self.init(context: context)
self.number = model?.number
self.volume = model?.volume ?? 0
self.powerHp = model?.powerHp ?? 0
self.powerKw = model?.powerKw ?? 0
self.fuelType = model?.fuelType
}
}

View File

@ -0,0 +1,35 @@
//
// VEvent.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 02.04.2022.
//
import Foundation
import CoreData
public struct VEvent: Decodable {
let id: String
let date: Double
let latitude: Double
let longitude: Double
let speed: Double
let direction: Double
let address: String?
}
extension CDVEvent {
convenience init(model: VEvent?, context: NSManagedObjectContext) {
self.init(context: context)
self.id = model?.id
self.date = model?.date ?? 0
self.latitude = model?.latitude ?? 0
self.longitude = model?.longitude ?? 0
self.speed = model?.speed ?? 0
self.direction = model?.direction ?? 0
self.address = model?.address
}
}

View File

@ -0,0 +1,29 @@
//
// VNote.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 02.04.2022.
//
import Foundation
import CoreData
public struct VNote: Decodable {
let id: String?
let user: String?
let date: Double
let text: String?
}
extension CDVNote {
convenience init(model: VNote?, context: NSManagedObjectContext) {
self.init(context: context)
self.id = model?.id
self.user = model?.user
self.date = model?.date ?? 0
self.text = model?.text
}
}

View File

@ -0,0 +1,41 @@
//
// VOsago.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 02.04.2022.
//
import Foundation
import CoreData
public struct VOsago: Decodable {
let date: Double
let number: String?
let vin: String?
let plateNumber: String?
let name: String?
let status: String?
let restrictions: String?
let insurant: String?
let owner: String?
let usageRegion: String?
}
extension CDVOsago {
convenience init(model: VOsago?, context: NSManagedObjectContext) {
self.init(context: context)
self.date = model?.date ?? 0
self.number = model?.number
self.vin = model?.vin
self.plateNumber = model?.plateNumber
self.name = model?.name
self.status = model?.status
self.restrictions = model?.restrictions
self.insurant = model?.insurant
self.owner = model?.owner
self.usageRegion = model?.usageRegion
}
}

View File

@ -0,0 +1,43 @@
//
// VOwnershipPeriod.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 02.04.2022.
//
import Foundation
import CoreData
public struct VOwnershipPeriod: Decodable {
let lastOperation: String?
let ownerType: String?
let from: Int64?
let to: Int64?
let region: String?
let registrationRegion: String?
let locality: String?
let code: String?
let street: String?
let building: String?
let inn: String?
}
extension CDVOwnershipPeriod {
convenience init(model: VOwnershipPeriod?, context: NSManagedObjectContext) {
self.init(context: context)
self.lastOperation = model?.lastOperation
self.ownerType = model?.ownerType
self.from = model?.from ?? 0
self.to = model?.to ?? 0
self.region = model?.region
self.registrationRegion = model?.registrationRegion
self.locality = model?.locality
self.code = model?.locality
self.street = model?.street
self.building = model?.building
self.inn = model?.inn
}
}

View File

@ -0,0 +1,29 @@
//
// VPhoto.swift
// AutoCatCore
//
// Created by Selim Mustafaev on 02.04.2022.
//
import Foundation
import CoreData
public struct VPhoto: Decodable {
let brand: String?
let model: String?
let date: Double
let url: String?
}
extension CDVPhoto {
convenience init(model: VPhoto?, context: NSManagedObjectContext) {
self.init(context: context)
self.brand = model?.brand
self.model = model?.model
self.date = model?.date ?? 0
self.url = model?.url
}
}