Skip to content

Commit

Permalink
rating fields added
Browse files Browse the repository at this point in the history
  • Loading branch information
quasisamurai committed Jan 24, 2019
1 parent 55c77d0 commit ce25f24
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions blockchain/source/contracts/Orders.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ contract Orders is Administratable {
struct Order {
OrderInfo info;
OrderParams params;
uint[] ratingInfo;
uint[] slaInfo;
}

struct OrderInfo {
Expand All @@ -46,6 +48,13 @@ contract Orders is Administratable {
uint dealID;
}

struct RatingInfo {
uint counterpartyRating;
uint supplierVolume;
uint workerRating;
}


mapping(uint => Order) orders;

uint ordersAmount = 0;
Expand Down Expand Up @@ -116,6 +125,14 @@ contract Orders is Administratable {
return orders[orderID].info.blacklist;
}

function GetOrderRatingInfo(uint orderID, uint index) public view returns (uint) {
return orders[orderID].ratingInfo[index];
}

function GetOrderSlaInfo(uint orderID, uint index) public view returns (uint) {
return orders[orderID].slaInfo[index];
}

function SetOrderBlacklist(uint orderID, address newBlacklist) public onlyOwner {
orders[orderID].info.blacklist = newBlacklist;
}
Expand Down Expand Up @@ -168,6 +185,11 @@ contract Orders is Administratable {
orders[orderID].params.dealID = _dealID;
}

function SetOrderRatingInfo(uint orderID, uint index, uint _value) public onlyOwner {
orders[orderID].ratingInfo[index] = _value;
}


// Cummulative Order actions. Those are in fact only helpers.
function Write(
OrderType _orderType,
Expand Down

0 comments on commit ce25f24

Please sign in to comment.