github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/blockapps-ba-master/server/lib/project/contracts/Project.sol (about)

     1  import "../../common/ErrorCodes.sol";
     2  import "./ProjectState.sol";
     3  
     4  /*
     5  
     6  {
     7      created: '2017-05-09T16:47:49.016Z',
     8      buyer: 'buyer1',
     9      name: 'T-Shirts with logo',
    10      description: 'The T-Shirts with our company\'s logo on the chest, Qty: 50',
    11      priceDesired: 800.10,
    12      desiredDeliveryDate: '2017-05-20T16:47:49.016Z',
    13      addressStreet: '109 S 5th street',
    14      addresscity: 'Brooklyn',
    15      addressstate: 'New York',
    16      addresszip: '11249',
    17      spec: 'Lorem ipsum dolor sit amet, eam molestie singulis referrentur',
    18      state: 'OPEN',
    19      deliveredDate: null // filled when the 'RECEIVED' button clicked
    20    }
    21  */
    22  
    23  /**
    24   * Project data contract
    25   */
    26  contract Project is ErrorCodes, ProjectState {
    27    // NOTE: members must be public to be indexed for search
    28    string public name;
    29    string public buyer;
    30    string public description;
    31    string public spec;
    32    uint public price; // in cents
    33  
    34    uint public created; // date
    35    uint public targetDelivery; // date
    36    uint public delivered; // date
    37  
    38    string public addressStreet;
    39    string public addressCity;
    40    string public addressState;
    41    string public addressZip;
    42  
    43    ProjectState public state;
    44  
    45    function Project(
    46      string _name,
    47      string _buyer,
    48      string _description,
    49      string _spec,
    50      uint _price,
    51      uint _created,
    52      uint _targetDelivery
    53    ) {
    54      name = _name;
    55      buyer = _buyer;
    56      description = _description;
    57      spec = _spec;
    58      price = _price;
    59      created = _created;
    60      targetDelivery = _targetDelivery;
    61  
    62      state = ProjectState.OPEN;
    63    }
    64  
    65    function setShippingAddress(
    66      string _addressStreet,
    67      string _addressCity,
    68      string _addressState,
    69      string _addressZip
    70    ) {
    71      addressStreet = _addressStreet;
    72      addressCity = _addressCity;
    73      addressState = _addressState;
    74      addressZip = _addressZip;
    75    }
    76  
    77    function getState() returns (ProjectState) {
    78      return state;
    79    }
    80  
    81    function setState(ProjectState _state) {
    82      state = _state;
    83    }
    84  }