1

As per this contract can some explain about the what input the user will provide and explain about the transporter type when he select option 1 then what input should we give. please explain about the each option in transporter type.

function loadConsingment(
        address pid, //Package or Batch ID
        uint transportertype,
        address cid
        ) public {
        require(
            UsersDetails[msg.sender].role == roles.transporter,
            "Only Transporter can call this function"
        );
        require(
            transportertype > 0,
            "Transporter Type must be define"
        );

        if(transportertype == 1) {  // Supplier to Manufacturer
            RawMatrials(pid).pickPackage(msg.sender);
        } else if(transportertype == 2) {   // Manufacturer to Wholesaler OR Manufacturer to Distributer
            Madicine(pid).pickPac kage(msg.sender);
        } else if(transportertype == 3) {   // Wholesaler to Distributer
            MadicineW_D(cid).pickWD(pid,msg.sender);
        } else if(transportertype == 4) {   // Distrubuter to Pharma
            MadicineD_P(cid).pickDP(pid,msg.sender);
        }
    }
  • You need to describe what RawMaterials and the fields mean otherwise is impossible to try to explain the code – Jaime Apr 24 at 7:40
  • In supply chain there are some role 1. supplier, 2. transporter, 3. manufacturer, 4. wholesaler, 5. distributer, 6.pharma – Ajeet Kumar Apr 24 at 9:37
  • In supply chain there are some role 1. supplier, 2. transporter, 3. manufacturer, 4. wholesaler, 5. distributer, 6.pharma. Supplier create the package (eg. medicine or any product) which supplier wants to send. function createRawPackage(bytes32 Des, bytes32 FN, bytes32 Loc, uint Quant, address Shpr, address Rcvr). as the package get created it generate the Batch ID for this package. Cid is transporter address and transporter type is option where to where the user wants to send the package. – Ajeet Kumar Apr 24 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.