-
Notifications
You must be signed in to change notification settings - Fork 10
/
PortAuthority.sol
40 lines (26 loc) · 1.4 KB
/
PortAuthority.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
pragma solidity ^0.4.19;
import "./Manager.sol";
contract portauthority is main { //this declares a complextype which will be used for variable later//
event departure(uint shipmentId); //we are creating a event for export//
event arrival(uint shipmentId);//we are creating a event for import //
function setshipmentId(uint orderId,uint _shipmentId) {
itemMap[orderId].shipmentId = _shipmentId;
}
function stateRequiredTimeToNextEntity(uint _orderId, uint _requiredTime){ // Give Estimate;
statsMap[_orderId].timeToNextEntity = _requiredTime;
}
function confirm_shipment (uint orderId) public returns (bool success) {
require(msg.sender==flowOfObject[orderId].Addresses[currentaddress[orderId]]);
departure(itemMap[orderId].shipmentId) ;
statsMap[orderId].checkPoint="successfully containers load into the ship"; // Updates currentStatusOfOrder.
statsMap[orderId].timeTheEventCalled=now;
return true;
}
function shipmentLoaded (uint orderId) public returns (bool success) {
arrival(itemMap[orderId].shipmentId);
statsMap[orderId].checkPoint="successfully containers load into the port"; // Updates currentStatusOfOrder.
statsMap[orderId].timeTheEventCalled=now;
transferPossesion(orderId);
return true;
}
}