Contract redefinition - GiInfo/SXP GitHub Wiki

What we had

The previous version of Sxp allowed to create a contract but this was not complete, the user could therefore have the possibility to add parties to the contract and defenie between each party a clausse.

What we did

In the first moment we have tried to choose an adequate design that will represent all the useful information of a contract. we have added some labels to filter displaying of contracts, the user can select category to show, for example, if we click to the "signed contract" all the finalized contracts will be displayed.

We have made it easier for the user to predefinish certaint modality, which he can modify or delete as he wishes.

We have added the following parameters in the ContratEnity class

  • implementing (string array)
  • termination (string array)
  • exchanges (string array) and we stopped using the "clauses" parameter. The exchanges parameter is a string array. Each string represents the fields content of an exchange, separated by #, that is to say from#what#to#when#how#details.

In the javascript page, Contracts.js, we renamed the directive "clause" into "exchange", just like the html page.

We have 2 arrays for the parties : one contains objects with key (id) and value (name), the other one contains string for the id. In the same way, we have 2 arrays for the exchanges : one contains objects with from, what, to, when, how, details parameters; the other one contains string looking like from#what#to#when#how#details. The functions buildExchanges and buildExchangesStr allow us to build one thanks to the other. We have the same thing for the users list and the items list.

We wrote the functions updateItems to update the items according to the user selected in the From field.

We wrote the function checkClauses and checkExchanges to check whether the different fields has been filled.

We added the delete and update functions for the new parameters : implementing and termination modalities. We added multiple functions to make implementing and termination modalities alterable.

We wrote some default modalities in the addContract controller, and exchange modes in the editContract and addContract controllers.

What can still be done

Some things are improved. we used an Array String for the exchange slab, which is not practical because we cut the fields with "#" each time, so a data structure that is adequate for the exchange cliff would be needed.