-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from moneymanagerex/new_models-8
Add Field, FieldContent
- Loading branch information
Showing
27 changed files
with
399 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// FieldContentData.swift | ||
// MMEX | ||
// | ||
// Created 2024-09-26 by George Ef ([email protected]) | ||
// | ||
|
||
import Foundation | ||
import SQLite | ||
|
||
struct FieldContentData: ExportableEntity { | ||
var id : Int64 = 0 | ||
var fieldId : Int64 = 0 | ||
var refType : RefType = RefType.transaction | ||
var refId : Int64 = 0 | ||
var content : String = "" | ||
static let refTypes: Set<RefType> = [ .transaction, .scheduled ] | ||
} | ||
|
||
extension FieldContentData: DataProtocol { | ||
static let dataName = "FieldContent" | ||
|
||
func shortDesc() -> String { | ||
"\(self.id)" | ||
} | ||
} | ||
|
||
extension FieldContentData { | ||
static let sampleData: [FieldContentData] = [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// Field.swift | ||
// MMEX | ||
// | ||
// Created 2024-09-26 by George Ef ([email protected]) | ||
// | ||
|
||
import Foundation | ||
import SQLite | ||
|
||
enum FieldType: String, EnumCollateNoCase { | ||
case string = "String" | ||
case integer = "Integer" | ||
case decimal = "Decimal" | ||
case boolean = "Boolean" | ||
case date = "Date" | ||
case time = "Time" | ||
case singleChoice = "SingleChoice" | ||
case multiChoice = "MultiChoice" | ||
case unknown = "" | ||
static let defaultValue = Self.unknown | ||
} | ||
|
||
struct FieldData: ExportableEntity { | ||
var id : Int64 = 0 | ||
var refType : RefType = RefType.defaultValue | ||
var description : String = "" | ||
var type : FieldType = FieldType.defaultValue | ||
var properties : String = "" | ||
static let refTypes: Set<RefType> = [ .transaction, .scheduled ] | ||
} | ||
|
||
extension FieldData: DataProtocol { | ||
static let dataName = "Field" | ||
|
||
func shortDesc() -> String { | ||
"\(self.id)" | ||
} | ||
} | ||
|
||
extension FieldData { | ||
static let sampleData: [FieldData] = [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.