Giter Site home page Giter Site logo

insurechain's People

Contributors

adridadou avatar drgorb avatar lukasz-zygmanski avatar lzygmanski avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

insurechain's Issues

Make address changes reactive

when the user selects a different address in Metamask, the current user (displayed on top left) should change and the active role should change as well.

register

request registration in the system

fix race condition with web3 injection

the application loads before web3 can be injected. the appController (or some other piece) have to be modified, in order to wait until everything is loaded before starting

User details page

home page contains user details page appears:

  • retailers

    • name
    • list of insurances registered with status
    • balances
      • total warranties sold
      • total payments made
      • total amount in claims
      • total to pay (warranties sold - payments made - claims)
  • insurance

    • name
    • list of accepted retailers
    • balances by retailer and total
      • total warranties sold
      • total payments made
      • total amount in claims
      • total to pay (warranties sold - payments made - claims)
      • input for payment amount and button to register the paymet from the retailer

function to get insurances for retailer

solidity

  • function insuranceCount(address retailer) returns (uint)
  • function getInsuranceForRetailer(address retailer, uint index) returns (string, address, InsuranceStatus)

javascript

  • use in getRegisteredInsurances

Smart contract - getWarrantyPrice

Write a function that calculates the warranty price according to:

  • The product price
  • The warranty duration

Bonus: Make this method upgradable

determine current user with web3.eth.accounts

the metamask plugin injects the web3 object into the page. By calling web3.eth.accounts you get an array with exactly one entry which corresponds to the currently selected account in metamask.

When the application opens, it should check the role for the currently active account and set the permissions accordingly

register roles for each authorized address

each user must have a role in order to access the functions which are not public. the role is determined by the address.

Each address should get a list of roles it can use

UX to buy a new warranty

Creation form
fields needed:

  • EAN 13
  • Serial Number
  • Product price
  • Manufacturer warranty end date
  • Extended warranty end date
  • Warranty price (Readonly, comes from the smart contract)
  • InsuranceId (may be hidden but is needed)

list warranties

the warranties should be listable in total and by insurance

add a warrantyCount to both InsureChain and InsuranceManager.insurances
add a getWarrantyByIndex(uint idx) to InusreChain
add a getWarrantyByIndex(address insuranceAddress, uint idx) to InusreChain

seed data on contract change

each time the contract is deployed all the data is lost.

we need a script which creates an initial state of the contract after the deployment.

Warranty details view

Search fields:

  • EAN 13
  • Serial Number

Should show:

  • Product Info
  • If a warranty exists or not
  • What is the extended warranty start date and end date

Retailer / Insurance accounting

  • Update the balance when an insurance is being sold
  • Update the balance when the retailer sends money to the insurance
  • Update the balance when someone returns a product
  • Update the balance when a product has been replaced
  • Update the balance when a product has been repaired

( makes it two different values to handle this )

Display events

each action on the smart-contract which requires external intervention will trigger an event which should be displayed to the user. The events are generated by the smart-contract and handled by the angular service.

we need a way to send the events to the right users. A kind of internal Messaging Service to the application.

If the event happens while the application is offline, the event will be picked up when the application starts.

already received events have to be persisted between restarts of the application until they have been handled.

Warranty structure

Warranty structure:
Fields:

  • EAN13
  • SerialNumber
  • PoliceNumber
  • InsuranceId
  • RetailerId
  • Status
  • warranty price
  • start date
  • end date

Search fields:

  • EAN13 + Serial Number
  • List by retailerId + insuranceId

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.