/* Options: Date: 2025-08-04 04:36:05 SwiftVersion: 5.0 Version: 6.110 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://szallitoiportal-be.veolia.hu //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: BrowseLastValidProcurement.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/user/{userid}/lastvalidprocurement", "GET") public class BrowseLastValidProcurement : IReturn, IGet, Codable { public typealias Return = BrowseProcurementResponse public var userId:Int required public init(){} } public class BrowseProcurementResponse : ResponseBase { public var procurement:ProcurementDetails required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case procurement } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) procurement = try container.decodeIfPresent(ProcurementDetails.self, forKey: .procurement) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if procurement != nil { try container.encode(procurement, forKey: .procurement) } } } public protocol IConcurrencyStamp { var concurrencyStamp:String { get set } } public class ModifyLegalRepresentativeBase : ModifyRequestBase { public var procurementId:Int public var position:String public var name:String public var address:String public var birthDate:Date? public var email:String required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case procurementId case position case name case address case birthDate case email } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) procurementId = try container.decodeIfPresent(Int.self, forKey: .procurementId) position = try container.decodeIfPresent(String.self, forKey: .position) name = try container.decodeIfPresent(String.self, forKey: .name) address = try container.decodeIfPresent(String.self, forKey: .address) birthDate = try container.decodeIfPresent(Date.self, forKey: .birthDate) email = try container.decodeIfPresent(String.self, forKey: .email) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if procurementId != nil { try container.encode(procurementId, forKey: .procurementId) } if position != nil { try container.encode(position, forKey: .position) } if name != nil { try container.encode(name, forKey: .name) } if address != nil { try container.encode(address, forKey: .address) } if birthDate != nil { try container.encode(birthDate, forKey: .birthDate) } if email != nil { try container.encode(email, forKey: .email) } } } public class ModifyProcurementBase : ModifyRequestBase { public var isGroupMember:Bool? public var groupName:String public var groupShortName:String public var countryId:Int? public var vatNumber:String public var registrationNumber:String public var duns:String public var address:String public var mainActivity:String public var establishedDate:Date? public var workforce:Int? public var website:String public var salesManagerName:String public var salesManagerPhone:String public var salesManagerEmail:String public var csrManagerName:String public var csrManagerPhone:String public var csrManagerEmail:String public var accountCountryId:Int? public var bankName:String public var accountNumber:String public var iban:String public var swift:String public var currencyId:Int? public var workForceN1:Int? public var workForceN2:Int? public var workForceN3:Int? public var subscribedCapital:Int? public var subscribedCapitalCurrencyId:Int? public var revenueN1:Int? public var revenueN2:Int? public var revenueN3:Int? public var netProfitN1:Int? public var netProfitN2:Int? public var netProfitN3:Int? public var equityN1:Int? public var equityN2:Int? public var equityN3:Int? public var liabilityN1:Int? public var liabilityN2:Int? public var liabilityN3:Int? public var operatingResultN1:Int? public var operatingResultN2:Int? public var operatingResultN3:Int? public var dbFailureScore:String public var isAuditedAccount:Bool? public var isAuditedAccountComment:String public var isLiquidationProceedings:Bool? public var isLiquidationProceedingsComment:String public var veoliaAnnualRevenuesProportion:Double? public var isAntiCorruptionDocument:Bool? public var isCorruptionRiskMap:Bool? public var isThirdPartiesEvaluatingSystem:Bool? public var isInternalRules:Bool? public var isHumanRights:Bool? public var isAntiCorruptionTraining:Bool? public var isAntiCorruptionReportSystem:Bool? public var isIso9001:Bool? public var isEcoVadisScorecard:Bool? public var ecoVadisTotalScore:Int? public var isReduceEmployeeSafetyRisk:Bool? public var isPromoteSocialIntegration:Bool? public var isNondiscriminationPolicy:Bool? public var isIso14001:Bool? public var isIdentifiedMajorEnvironmentalImpacts:Bool? public var isUseWaterResources:Bool? public var isConsumptionOfRawMaterials:Bool? public var isEnergyConsumption:Bool? public var isGreenhouseGasEmissions:Bool? public var isAtmosphericEmissions:Bool? public var isAqueousPollution:Bool? public var isWasteGeneration:Bool? public var isNaturalAreasPollution:Bool? public var isPrivacyStatement:Bool? public var isVeoliaSupplierCharter:Bool? public var isVeoliaCoreStandards:Bool? required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case isGroupMember case groupName case groupShortName case countryId case vatNumber case registrationNumber case duns case address case mainActivity case establishedDate case workforce case website case salesManagerName case salesManagerPhone case salesManagerEmail case csrManagerName case csrManagerPhone case csrManagerEmail case accountCountryId case bankName case accountNumber case iban case swift case currencyId case workForceN1 case workForceN2 case workForceN3 case subscribedCapital case subscribedCapitalCurrencyId case revenueN1 case revenueN2 case revenueN3 case netProfitN1 case netProfitN2 case netProfitN3 case equityN1 case equityN2 case equityN3 case liabilityN1 case liabilityN2 case liabilityN3 case operatingResultN1 case operatingResultN2 case operatingResultN3 case dbFailureScore case isAuditedAccount case isAuditedAccountComment case isLiquidationProceedings case isLiquidationProceedingsComment case veoliaAnnualRevenuesProportion case isAntiCorruptionDocument case isCorruptionRiskMap case isThirdPartiesEvaluatingSystem case isInternalRules case isHumanRights case isAntiCorruptionTraining case isAntiCorruptionReportSystem case isIso9001 case isEcoVadisScorecard case ecoVadisTotalScore case isReduceEmployeeSafetyRisk case isPromoteSocialIntegration case isNondiscriminationPolicy case isIso14001 case isIdentifiedMajorEnvironmentalImpacts case isUseWaterResources case isConsumptionOfRawMaterials case isEnergyConsumption case isGreenhouseGasEmissions case isAtmosphericEmissions case isAqueousPollution case isWasteGeneration case isNaturalAreasPollution case isPrivacyStatement case isVeoliaSupplierCharter case isVeoliaCoreStandards } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) isGroupMember = try container.decodeIfPresent(Bool.self, forKey: .isGroupMember) groupName = try container.decodeIfPresent(String.self, forKey: .groupName) groupShortName = try container.decodeIfPresent(String.self, forKey: .groupShortName) countryId = try container.decodeIfPresent(Int.self, forKey: .countryId) vatNumber = try container.decodeIfPresent(String.self, forKey: .vatNumber) registrationNumber = try container.decodeIfPresent(String.self, forKey: .registrationNumber) duns = try container.decodeIfPresent(String.self, forKey: .duns) address = try container.decodeIfPresent(String.self, forKey: .address) mainActivity = try container.decodeIfPresent(String.self, forKey: .mainActivity) establishedDate = try container.decodeIfPresent(Date.self, forKey: .establishedDate) workforce = try container.decodeIfPresent(Int.self, forKey: .workforce) website = try container.decodeIfPresent(String.self, forKey: .website) salesManagerName = try container.decodeIfPresent(String.self, forKey: .salesManagerName) salesManagerPhone = try container.decodeIfPresent(String.self, forKey: .salesManagerPhone) salesManagerEmail = try container.decodeIfPresent(String.self, forKey: .salesManagerEmail) csrManagerName = try container.decodeIfPresent(String.self, forKey: .csrManagerName) csrManagerPhone = try container.decodeIfPresent(String.self, forKey: .csrManagerPhone) csrManagerEmail = try container.decodeIfPresent(String.self, forKey: .csrManagerEmail) accountCountryId = try container.decodeIfPresent(Int.self, forKey: .accountCountryId) bankName = try container.decodeIfPresent(String.self, forKey: .bankName) accountNumber = try container.decodeIfPresent(String.self, forKey: .accountNumber) iban = try container.decodeIfPresent(String.self, forKey: .iban) swift = try container.decodeIfPresent(String.self, forKey: .swift) currencyId = try container.decodeIfPresent(Int.self, forKey: .currencyId) workForceN1 = try container.decodeIfPresent(Int.self, forKey: .workForceN1) workForceN2 = try container.decodeIfPresent(Int.self, forKey: .workForceN2) workForceN3 = try container.decodeIfPresent(Int.self, forKey: .workForceN3) subscribedCapital = try container.decodeIfPresent(Int.self, forKey: .subscribedCapital) subscribedCapitalCurrencyId = try container.decodeIfPresent(Int.self, forKey: .subscribedCapitalCurrencyId) revenueN1 = try container.decodeIfPresent(Int.self, forKey: .revenueN1) revenueN2 = try container.decodeIfPresent(Int.self, forKey: .revenueN2) revenueN3 = try container.decodeIfPresent(Int.self, forKey: .revenueN3) netProfitN1 = try container.decodeIfPresent(Int.self, forKey: .netProfitN1) netProfitN2 = try container.decodeIfPresent(Int.self, forKey: .netProfitN2) netProfitN3 = try container.decodeIfPresent(Int.self, forKey: .netProfitN3) equityN1 = try container.decodeIfPresent(Int.self, forKey: .equityN1) equityN2 = try container.decodeIfPresent(Int.self, forKey: .equityN2) equityN3 = try container.decodeIfPresent(Int.self, forKey: .equityN3) liabilityN1 = try container.decodeIfPresent(Int.self, forKey: .liabilityN1) liabilityN2 = try container.decodeIfPresent(Int.self, forKey: .liabilityN2) liabilityN3 = try container.decodeIfPresent(Int.self, forKey: .liabilityN3) operatingResultN1 = try container.decodeIfPresent(Int.self, forKey: .operatingResultN1) operatingResultN2 = try container.decodeIfPresent(Int.self, forKey: .operatingResultN2) operatingResultN3 = try container.decodeIfPresent(Int.self, forKey: .operatingResultN3) dbFailureScore = try container.decodeIfPresent(String.self, forKey: .dbFailureScore) isAuditedAccount = try container.decodeIfPresent(Bool.self, forKey: .isAuditedAccount) isAuditedAccountComment = try container.decodeIfPresent(String.self, forKey: .isAuditedAccountComment) isLiquidationProceedings = try container.decodeIfPresent(Bool.self, forKey: .isLiquidationProceedings) isLiquidationProceedingsComment = try container.decodeIfPresent(String.self, forKey: .isLiquidationProceedingsComment) veoliaAnnualRevenuesProportion = try container.decodeIfPresent(Double.self, forKey: .veoliaAnnualRevenuesProportion) isAntiCorruptionDocument = try container.decodeIfPresent(Bool.self, forKey: .isAntiCorruptionDocument) isCorruptionRiskMap = try container.decodeIfPresent(Bool.self, forKey: .isCorruptionRiskMap) isThirdPartiesEvaluatingSystem = try container.decodeIfPresent(Bool.self, forKey: .isThirdPartiesEvaluatingSystem) isInternalRules = try container.decodeIfPresent(Bool.self, forKey: .isInternalRules) isHumanRights = try container.decodeIfPresent(Bool.self, forKey: .isHumanRights) isAntiCorruptionTraining = try container.decodeIfPresent(Bool.self, forKey: .isAntiCorruptionTraining) isAntiCorruptionReportSystem = try container.decodeIfPresent(Bool.self, forKey: .isAntiCorruptionReportSystem) isIso9001 = try container.decodeIfPresent(Bool.self, forKey: .isIso9001) isEcoVadisScorecard = try container.decodeIfPresent(Bool.self, forKey: .isEcoVadisScorecard) ecoVadisTotalScore = try container.decodeIfPresent(Int.self, forKey: .ecoVadisTotalScore) isReduceEmployeeSafetyRisk = try container.decodeIfPresent(Bool.self, forKey: .isReduceEmployeeSafetyRisk) isPromoteSocialIntegration = try container.decodeIfPresent(Bool.self, forKey: .isPromoteSocialIntegration) isNondiscriminationPolicy = try container.decodeIfPresent(Bool.self, forKey: .isNondiscriminationPolicy) isIso14001 = try container.decodeIfPresent(Bool.self, forKey: .isIso14001) isIdentifiedMajorEnvironmentalImpacts = try container.decodeIfPresent(Bool.self, forKey: .isIdentifiedMajorEnvironmentalImpacts) isUseWaterResources = try container.decodeIfPresent(Bool.self, forKey: .isUseWaterResources) isConsumptionOfRawMaterials = try container.decodeIfPresent(Bool.self, forKey: .isConsumptionOfRawMaterials) isEnergyConsumption = try container.decodeIfPresent(Bool.self, forKey: .isEnergyConsumption) isGreenhouseGasEmissions = try container.decodeIfPresent(Bool.self, forKey: .isGreenhouseGasEmissions) isAtmosphericEmissions = try container.decodeIfPresent(Bool.self, forKey: .isAtmosphericEmissions) isAqueousPollution = try container.decodeIfPresent(Bool.self, forKey: .isAqueousPollution) isWasteGeneration = try container.decodeIfPresent(Bool.self, forKey: .isWasteGeneration) isNaturalAreasPollution = try container.decodeIfPresent(Bool.self, forKey: .isNaturalAreasPollution) isPrivacyStatement = try container.decodeIfPresent(Bool.self, forKey: .isPrivacyStatement) isVeoliaSupplierCharter = try container.decodeIfPresent(Bool.self, forKey: .isVeoliaSupplierCharter) isVeoliaCoreStandards = try container.decodeIfPresent(Bool.self, forKey: .isVeoliaCoreStandards) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if isGroupMember != nil { try container.encode(isGroupMember, forKey: .isGroupMember) } if groupName != nil { try container.encode(groupName, forKey: .groupName) } if groupShortName != nil { try container.encode(groupShortName, forKey: .groupShortName) } if countryId != nil { try container.encode(countryId, forKey: .countryId) } if vatNumber != nil { try container.encode(vatNumber, forKey: .vatNumber) } if registrationNumber != nil { try container.encode(registrationNumber, forKey: .registrationNumber) } if duns != nil { try container.encode(duns, forKey: .duns) } if address != nil { try container.encode(address, forKey: .address) } if mainActivity != nil { try container.encode(mainActivity, forKey: .mainActivity) } if establishedDate != nil { try container.encode(establishedDate, forKey: .establishedDate) } if workforce != nil { try container.encode(workforce, forKey: .workforce) } if website != nil { try container.encode(website, forKey: .website) } if salesManagerName != nil { try container.encode(salesManagerName, forKey: .salesManagerName) } if salesManagerPhone != nil { try container.encode(salesManagerPhone, forKey: .salesManagerPhone) } if salesManagerEmail != nil { try container.encode(salesManagerEmail, forKey: .salesManagerEmail) } if csrManagerName != nil { try container.encode(csrManagerName, forKey: .csrManagerName) } if csrManagerPhone != nil { try container.encode(csrManagerPhone, forKey: .csrManagerPhone) } if csrManagerEmail != nil { try container.encode(csrManagerEmail, forKey: .csrManagerEmail) } if accountCountryId != nil { try container.encode(accountCountryId, forKey: .accountCountryId) } if bankName != nil { try container.encode(bankName, forKey: .bankName) } if accountNumber != nil { try container.encode(accountNumber, forKey: .accountNumber) } if iban != nil { try container.encode(iban, forKey: .iban) } if swift != nil { try container.encode(swift, forKey: .swift) } if currencyId != nil { try container.encode(currencyId, forKey: .currencyId) } if workForceN1 != nil { try container.encode(workForceN1, forKey: .workForceN1) } if workForceN2 != nil { try container.encode(workForceN2, forKey: .workForceN2) } if workForceN3 != nil { try container.encode(workForceN3, forKey: .workForceN3) } if subscribedCapital != nil { try container.encode(subscribedCapital, forKey: .subscribedCapital) } if subscribedCapitalCurrencyId != nil { try container.encode(subscribedCapitalCurrencyId, forKey: .subscribedCapitalCurrencyId) } if revenueN1 != nil { try container.encode(revenueN1, forKey: .revenueN1) } if revenueN2 != nil { try container.encode(revenueN2, forKey: .revenueN2) } if revenueN3 != nil { try container.encode(revenueN3, forKey: .revenueN3) } if netProfitN1 != nil { try container.encode(netProfitN1, forKey: .netProfitN1) } if netProfitN2 != nil { try container.encode(netProfitN2, forKey: .netProfitN2) } if netProfitN3 != nil { try container.encode(netProfitN3, forKey: .netProfitN3) } if equityN1 != nil { try container.encode(equityN1, forKey: .equityN1) } if equityN2 != nil { try container.encode(equityN2, forKey: .equityN2) } if equityN3 != nil { try container.encode(equityN3, forKey: .equityN3) } if liabilityN1 != nil { try container.encode(liabilityN1, forKey: .liabilityN1) } if liabilityN2 != nil { try container.encode(liabilityN2, forKey: .liabilityN2) } if liabilityN3 != nil { try container.encode(liabilityN3, forKey: .liabilityN3) } if operatingResultN1 != nil { try container.encode(operatingResultN1, forKey: .operatingResultN1) } if operatingResultN2 != nil { try container.encode(operatingResultN2, forKey: .operatingResultN2) } if operatingResultN3 != nil { try container.encode(operatingResultN3, forKey: .operatingResultN3) } if dbFailureScore != nil { try container.encode(dbFailureScore, forKey: .dbFailureScore) } if isAuditedAccount != nil { try container.encode(isAuditedAccount, forKey: .isAuditedAccount) } if isAuditedAccountComment != nil { try container.encode(isAuditedAccountComment, forKey: .isAuditedAccountComment) } if isLiquidationProceedings != nil { try container.encode(isLiquidationProceedings, forKey: .isLiquidationProceedings) } if isLiquidationProceedingsComment != nil { try container.encode(isLiquidationProceedingsComment, forKey: .isLiquidationProceedingsComment) } if veoliaAnnualRevenuesProportion != nil { try container.encode(veoliaAnnualRevenuesProportion, forKey: .veoliaAnnualRevenuesProportion) } if isAntiCorruptionDocument != nil { try container.encode(isAntiCorruptionDocument, forKey: .isAntiCorruptionDocument) } if isCorruptionRiskMap != nil { try container.encode(isCorruptionRiskMap, forKey: .isCorruptionRiskMap) } if isThirdPartiesEvaluatingSystem != nil { try container.encode(isThirdPartiesEvaluatingSystem, forKey: .isThirdPartiesEvaluatingSystem) } if isInternalRules != nil { try container.encode(isInternalRules, forKey: .isInternalRules) } if isHumanRights != nil { try container.encode(isHumanRights, forKey: .isHumanRights) } if isAntiCorruptionTraining != nil { try container.encode(isAntiCorruptionTraining, forKey: .isAntiCorruptionTraining) } if isAntiCorruptionReportSystem != nil { try container.encode(isAntiCorruptionReportSystem, forKey: .isAntiCorruptionReportSystem) } if isIso9001 != nil { try container.encode(isIso9001, forKey: .isIso9001) } if isEcoVadisScorecard != nil { try container.encode(isEcoVadisScorecard, forKey: .isEcoVadisScorecard) } if ecoVadisTotalScore != nil { try container.encode(ecoVadisTotalScore, forKey: .ecoVadisTotalScore) } if isReduceEmployeeSafetyRisk != nil { try container.encode(isReduceEmployeeSafetyRisk, forKey: .isReduceEmployeeSafetyRisk) } if isPromoteSocialIntegration != nil { try container.encode(isPromoteSocialIntegration, forKey: .isPromoteSocialIntegration) } if isNondiscriminationPolicy != nil { try container.encode(isNondiscriminationPolicy, forKey: .isNondiscriminationPolicy) } if isIso14001 != nil { try container.encode(isIso14001, forKey: .isIso14001) } if isIdentifiedMajorEnvironmentalImpacts != nil { try container.encode(isIdentifiedMajorEnvironmentalImpacts, forKey: .isIdentifiedMajorEnvironmentalImpacts) } if isUseWaterResources != nil { try container.encode(isUseWaterResources, forKey: .isUseWaterResources) } if isConsumptionOfRawMaterials != nil { try container.encode(isConsumptionOfRawMaterials, forKey: .isConsumptionOfRawMaterials) } if isEnergyConsumption != nil { try container.encode(isEnergyConsumption, forKey: .isEnergyConsumption) } if isGreenhouseGasEmissions != nil { try container.encode(isGreenhouseGasEmissions, forKey: .isGreenhouseGasEmissions) } if isAtmosphericEmissions != nil { try container.encode(isAtmosphericEmissions, forKey: .isAtmosphericEmissions) } if isAqueousPollution != nil { try container.encode(isAqueousPollution, forKey: .isAqueousPollution) } if isWasteGeneration != nil { try container.encode(isWasteGeneration, forKey: .isWasteGeneration) } if isNaturalAreasPollution != nil { try container.encode(isNaturalAreasPollution, forKey: .isNaturalAreasPollution) } if isPrivacyStatement != nil { try container.encode(isPrivacyStatement, forKey: .isPrivacyStatement) } if isVeoliaSupplierCharter != nil { try container.encode(isVeoliaSupplierCharter, forKey: .isVeoliaSupplierCharter) } if isVeoliaCoreStandards != nil { try container.encode(isVeoliaCoreStandards, forKey: .isVeoliaCoreStandards) } } } public class ResponseBase : Codable { public var responseStatus:ResponseStatus required public init(){} } public class LegalRepresentativeDetails : ModifyLegalRepresentativeBase { public var id:Int required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } } } public class ProcurementDetails : ModifyProcurementBase { public var id:Int public var indebtednessN1:Double? public var indebtednessN2:Double? public var indebtednessN3:Double? public var salesProportionateProfitN1:Double? public var salesProportionateProfitN2:Double? public var salesProportionateProfitN3:Double? public var liquidityRatioN1:Double? public var liquidityRatioN2:Double? public var liquidityRatioN3:Double? public var submittedById:Int? public var submissionDateTime:Date? public var isSubmitted:Bool public var legalRepresentatives:[LegalRepresentativeDetails] = [] required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case id case indebtednessN1 case indebtednessN2 case indebtednessN3 case salesProportionateProfitN1 case salesProportionateProfitN2 case salesProportionateProfitN3 case liquidityRatioN1 case liquidityRatioN2 case liquidityRatioN3 case submittedById case submissionDateTime case isSubmitted case legalRepresentatives } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) id = try container.decodeIfPresent(Int.self, forKey: .id) indebtednessN1 = try container.decodeIfPresent(Double.self, forKey: .indebtednessN1) indebtednessN2 = try container.decodeIfPresent(Double.self, forKey: .indebtednessN2) indebtednessN3 = try container.decodeIfPresent(Double.self, forKey: .indebtednessN3) salesProportionateProfitN1 = try container.decodeIfPresent(Double.self, forKey: .salesProportionateProfitN1) salesProportionateProfitN2 = try container.decodeIfPresent(Double.self, forKey: .salesProportionateProfitN2) salesProportionateProfitN3 = try container.decodeIfPresent(Double.self, forKey: .salesProportionateProfitN3) liquidityRatioN1 = try container.decodeIfPresent(Double.self, forKey: .liquidityRatioN1) liquidityRatioN2 = try container.decodeIfPresent(Double.self, forKey: .liquidityRatioN2) liquidityRatioN3 = try container.decodeIfPresent(Double.self, forKey: .liquidityRatioN3) submittedById = try container.decodeIfPresent(Int.self, forKey: .submittedById) submissionDateTime = try container.decodeIfPresent(Date.self, forKey: .submissionDateTime) isSubmitted = try container.decodeIfPresent(Bool.self, forKey: .isSubmitted) legalRepresentatives = try container.decodeIfPresent([LegalRepresentativeDetails].self, forKey: .legalRepresentatives) ?? [] } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if id != nil { try container.encode(id, forKey: .id) } if indebtednessN1 != nil { try container.encode(indebtednessN1, forKey: .indebtednessN1) } if indebtednessN2 != nil { try container.encode(indebtednessN2, forKey: .indebtednessN2) } if indebtednessN3 != nil { try container.encode(indebtednessN3, forKey: .indebtednessN3) } if salesProportionateProfitN1 != nil { try container.encode(salesProportionateProfitN1, forKey: .salesProportionateProfitN1) } if salesProportionateProfitN2 != nil { try container.encode(salesProportionateProfitN2, forKey: .salesProportionateProfitN2) } if salesProportionateProfitN3 != nil { try container.encode(salesProportionateProfitN3, forKey: .salesProportionateProfitN3) } if liquidityRatioN1 != nil { try container.encode(liquidityRatioN1, forKey: .liquidityRatioN1) } if liquidityRatioN2 != nil { try container.encode(liquidityRatioN2, forKey: .liquidityRatioN2) } if liquidityRatioN3 != nil { try container.encode(liquidityRatioN3, forKey: .liquidityRatioN3) } if submittedById != nil { try container.encode(submittedById, forKey: .submittedById) } if submissionDateTime != nil { try container.encode(submissionDateTime, forKey: .submissionDateTime) } if isSubmitted != nil { try container.encode(isSubmitted, forKey: .isSubmitted) } if legalRepresentatives.count > 0 { try container.encode(legalRepresentatives, forKey: .legalRepresentatives) } } } public class ModifyRequestBase : IConcurrencyStamp, Codable { public var concurrencyStamp:String required public init(){} }