Skip to content

Commit

Permalink
Add #69: Get consent history for an individual Repository creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mumthasir mohammed committed Oct 23, 2023
1 parent 6f99f32 commit d2ebc85
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
import Foundation
import SwiftyJSON

class ConsentHistory{

var iD : String!
var log : String!
var orgID : String!
var purposeID : String!
var timeStamp : String!

class ConsentHistory: ConsentHistoryWrapper {
var iD : String?
var log : String?
var orgID : String?
var purposeID : String?
var timeStamp : String?

/**
* Instantiate the instance using the passed json values to set the properties values
Expand All @@ -27,5 +25,12 @@ class ConsentHistory{
purposeID = json["PurposeID"].stringValue
timeStamp = json["TimeStamp"].stringValue
}
}

}
protocol ConsentHistoryWrapper {
var iD : String? { get }
var log : String? { get }
var orgID : String? { get }
var purposeID : String? { get }
var timeStamp : String? { get }
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
import Foundation
import SwiftyJSON

class ConsentHistoryData{

var consentHistory : [ConsentHistory]!
var links : Link!
var unReadCount : Int!
class ConsentHistoryData {
var consentHistory : [ConsentHistory]?
var links : Link?
var unReadCount : Int?

/**
* Instantiate the instance using the passed json values to set the properties values
Expand All @@ -22,7 +21,7 @@ class ConsentHistoryData{
let consentHistoryArray = json["ConsentHistory"].arrayValue
for consentHistoryJson in consentHistoryArray{
let value = ConsentHistory(fromJson: consentHistoryJson)
consentHistory.append(value)
consentHistory?.append(value)
}
unReadCount = json["UnReadCount"].intValue
let linksJson = json["Links"]
Expand All @@ -31,5 +30,10 @@ class ConsentHistoryData{
links = Link(fromJson: linksJson)
}
}
}

protocol ConsentHistoryDataWrapper {
var consentHistory : [ConsentHistoryWrapper]? { get }
var links : Link? { get }
var unReadCount : Int? { get }
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ extension BBConsentHistoryViewController: WebServiceTaskManagerProtocol {
self.histories = [ConsentHistory]()
}
if serviceManager.isLoadMore {
self.histories?.append(contentsOf: data.consentHistory)

self.histories?.append(contentsOf: data.consentHistory ?? [])
} else {
self.histories = data.consentHistory
if (self.histories?.count ?? 0) < 1 {
Expand Down

0 comments on commit d2ebc85

Please sign in to comment.