Skip to content

Commit

Permalink
feature(1.0) New based models for AP + Concerto 1.0 switch
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <[email protected]>
  • Loading branch information
jeromesimeon committed Apr 1, 2021
1 parent b56718a commit 93d0831
Show file tree
Hide file tree
Showing 11 changed files with 215 additions and 381 deletions.
2 changes: 1 addition & 1 deletion build.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ function isCompatible(concertoVersion, modelText) {
}
}
else {
console.log(`✋ Skipped ${file} due to incompatability.`);
console.log(`✋ Skipped ${file} due to incompatibility.`);
}
}; // for

Expand Down
328 changes: 45 additions & 283 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"npm": ">=5"
},
"dependencies": {
"@accordproject/concerto-core": "^0.82.11",
"@accordproject/concerto-tools": "^0.82.11",
"@accordproject/concerto-core": "1.0.0-alpha.3",
"@accordproject/concerto-tools": "1.0.0-alpha.3",
"adm-zip": "^0.4.16",
"bulma": "^0.7.5",
"fs-extra": "^6.0.1",
Expand Down
38 changes: 38 additions & 0 deletions src/accordproject/contract.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// requires: concerto-core:>= 1.0.0-alpha.3

namespace org.accordproject.contract

/**
* Contract Data
* -- Describes the structure of contracts and clauses
*/

/* A party to a contract */
participant Party identified by partyId {
o String partyId
}

/* A contract is a asset -- This contains the contract data */
abstract asset ContractData identified by contractId {
o String contractId
--> Party[] parties optional
}

/* A clause is an asset -- This contains the clause data */
abstract asset ClauseData identified by clauseId {
o String clauseId
}
35 changes: 35 additions & 0 deletions src/accordproject/obligation.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// requires: concerto-core:>= 1.0.0-alpha.3

namespace org.accordproject.obligation

import org.accordproject.runtime.Obligation from https://concerto-1-0--accordproject-models.netlify.com/accordproject/runtime.cto
import org.accordproject.money.MonetaryAmount from https://concerto-1-0--accordproject-models.netlify.com/[email protected]

/**
* Useful Obligations
* -- Predefined obligations for general use in Accord Project templates
*/

event PaymentObligation extends Obligation {
o MonetaryAmount amount
o String description
}

event NotificationObligation extends Obligation {
o String title
o String message
}
57 changes: 57 additions & 0 deletions src/accordproject/runtime.cto
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// requires: concerto-core:>= 1.0.0-alpha.3

namespace org.accordproject.runtime

import org.accordproject.contract.Party from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto
import org.accordproject.contract.ContractData from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto

/**
* Runtime API
* -- Describes input and output of calls to a contract's clause
*/

/* A request is a transaction */
transaction Request {
}

/* A response is a transaction */
transaction Response {
}

/* An Error is a concept */
abstract concept ErrorResponse {
}

/* An event that represents an obligation that needs to be fulfilled */
abstract event Obligation {
/* A back reference to the governing contract that emitted this obligation */
--> ContractData contractData

/* The party that is obligated */
--> Party promisor

/* The party that receives the performance */
--> Party promisee

/* The time before which the obligation is fulfilled */
o DateTime deadline optional
}

/* A contract state is an asset -- The runtime state of the contract */
asset ContractState {
--> Obligation[] obligations // Should we allow for a standard way to store obligations on the contract in the state?
}
83 changes: 0 additions & 83 deletions src/cicero/[email protected]

This file was deleted.

4 changes: 2 additions & 2 deletions src/docusign/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// requires: concerto-core:>= 1.0.0-20210215133932
// requires: concerto-core:>= 1.0.0-alpha.3

/**
* Based on https://www.docusign.net/api/3.0/schema/dsx.xsd
*/
namespace com.docusign.connect

import org.accordproject.cicero.runtime.Request from https://models.accordproject.org/cicero/runtime@0.2.0.cto
import org.accordproject.runtime.Request from https://concerto-1-0--accordproject-models.netlify.com/accordproject/runtime.cto
import org.accordproject.binary.BinaryResource from https://models.accordproject.org/binary.cto

enum EnvelopeStatusCode {
Expand Down
5 changes: 2 additions & 3 deletions src/payment/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// requires: concerto-core:>= 1.0.0-20210215133932
// requires: concerto-core:>= 1.0.0-alpha.3
namespace org.accordproject.payment

import org.accordproject.cicero.runtime.Request from https://models.accordproject.org/cicero/[email protected]
import org.accordproject.cicero.contract.AccordContract from https://models.accordproject.org/cicero/contract.cto
import org.accordproject.runtime.Request from https://concerto-1-0--accordproject-models.netlify.com/accordproject/runtime.cto

/**
* A request that indicates that a payment has been received
Expand Down
28 changes: 28 additions & 0 deletions src/signature/[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// requires: concerto-core:>= 1.0.0-alpha.3
namespace org.accordproject.signature.block

import org.accordproject.contract.ClauseData from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto
import org.accordproject.contract.Party from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto

/**
* An abstract clause for a party scoped signature block
*/
abstract asset SignatureClause extends ClauseData {
@Pdf("style", "background")
@ContractEditor("readOnly", true, "opacity", 0)
--> Party signatory
}
12 changes: 5 additions & 7 deletions src/signature/[email protected]
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// requires: concerto-core:>= 1.0.0-20210215133932
// requires: concerto-core:>= 1.0.0-alpha.3
namespace org.accordproject.signature

import org.accordproject.cicero.runtime.Request from https://models.accordproject.org/cicero/[email protected]
import org.accordproject.cicero.contract.AccordContract from https://models.accordproject.org/cicero/contract.cto
import org.accordproject.cicero.contract.AccordClause from https://models.accordproject.org/cicero/contract.cto
import org.accordproject.cicero.contract.AccordParty from https://models.accordproject.org/cicero/contract.cto
import org.accordproject.runtime.Request from https://concerto-1-0--accordproject-models.netlify.com/accordproject/runtime.cto
import org.accordproject.contract.ContractData from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto

/**
* A request that indicates that a contract has been signed by all parties
*/
transaction ContractSigned extends Request {
--> AccordContract contract
}
--> ContractData contract
}

0 comments on commit 93d0831

Please sign in to comment.