Skip to content

Commit 93d0831

Browse files
committed
feature(1.0) New based models for AP + Concerto 1.0 switch
Signed-off-by: Jerome Simeon <[email protected]>
1 parent b56718a commit 93d0831

File tree

11 files changed

+215
-381
lines changed

11 files changed

+215
-381
lines changed

build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ function isCompatible(concertoVersion, modelText) {
299299
}
300300
}
301301
else {
302-
console.log(`✋ Skipped ${file} due to incompatability.`);
302+
console.log(`✋ Skipped ${file} due to incompatibility.`);
303303
}
304304
}; // for
305305

package-lock.json

Lines changed: 45 additions & 283 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"npm": ">=5"
88
},
99
"dependencies": {
10-
"@accordproject/concerto-core": "^0.82.11",
11-
"@accordproject/concerto-tools": "^0.82.11",
10+
"@accordproject/concerto-core": "1.0.0-alpha.3",
11+
"@accordproject/concerto-tools": "1.0.0-alpha.3",
1212
"adm-zip": "^0.4.16",
1313
"bulma": "^0.7.5",
1414
"fs-extra": "^6.0.1",

src/accordproject/contract.cto

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
// requires: concerto-core:>= 1.0.0-alpha.3
16+
17+
namespace org.accordproject.contract
18+
19+
/**
20+
* Contract Data
21+
* -- Describes the structure of contracts and clauses
22+
*/
23+
24+
/* A party to a contract */
25+
participant Party identified by partyId {
26+
o String partyId
27+
}
28+
29+
/* A contract is a asset -- This contains the contract data */
30+
abstract asset ContractData identified by contractId {
31+
o String contractId
32+
--> Party[] parties optional
33+
}
34+
35+
/* A clause is an asset -- This contains the clause data */
36+
abstract asset ClauseData identified by clauseId {
37+
o String clauseId
38+
}

src/accordproject/obligation.cto

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
// requires: concerto-core:>= 1.0.0-alpha.3
16+
17+
namespace org.accordproject.obligation
18+
19+
import org.accordproject.runtime.Obligation from https://concerto-1-0--accordproject-models.netlify.com/accordproject/runtime.cto
20+
import org.accordproject.money.MonetaryAmount from https://concerto-1-0--accordproject-models.netlify.com/[email protected]
21+
22+
/**
23+
* Useful Obligations
24+
* -- Predefined obligations for general use in Accord Project templates
25+
*/
26+
27+
event PaymentObligation extends Obligation {
28+
o MonetaryAmount amount
29+
o String description
30+
}
31+
32+
event NotificationObligation extends Obligation {
33+
o String title
34+
o String message
35+
}

src/accordproject/runtime.cto

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
// requires: concerto-core:>= 1.0.0-alpha.3
16+
17+
namespace org.accordproject.runtime
18+
19+
import org.accordproject.contract.Party from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto
20+
import org.accordproject.contract.ContractData from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto
21+
22+
/**
23+
* Runtime API
24+
* -- Describes input and output of calls to a contract's clause
25+
*/
26+
27+
/* A request is a transaction */
28+
transaction Request {
29+
}
30+
31+
/* A response is a transaction */
32+
transaction Response {
33+
}
34+
35+
/* An Error is a concept */
36+
abstract concept ErrorResponse {
37+
}
38+
39+
/* An event that represents an obligation that needs to be fulfilled */
40+
abstract event Obligation {
41+
/* A back reference to the governing contract that emitted this obligation */
42+
--> ContractData contractData
43+
44+
/* The party that is obligated */
45+
--> Party promisor
46+
47+
/* The party that receives the performance */
48+
--> Party promisee
49+
50+
/* The time before which the obligation is fulfilled */
51+
o DateTime deadline optional
52+
}
53+
54+
/* A contract state is an asset -- The runtime state of the contract */
55+
asset ContractState {
56+
--> Obligation[] obligations // Should we allow for a standard way to store obligations on the contract in the state?
57+
}

src/cicero/[email protected]

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/docusign/[email protected]

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
// requires: concerto-core:>= 1.0.0-20210215133932
14+
// requires: concerto-core:>= 1.0.0-alpha.3
1515

1616
/**
1717
* Based on https://www.docusign.net/api/3.0/schema/dsx.xsd
1818
*/
1919
namespace com.docusign.connect
2020

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

2424
enum EnvelopeStatusCode {

src/payment/[email protected]

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
// requires: concerto-core:>= 1.0.0-20210215133932
14+
// requires: concerto-core:>= 1.0.0-alpha.3
1515
namespace org.accordproject.payment
1616

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

2019
/**
2120
* A request that indicates that a payment has been received

src/signature/[email protected]

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* You may obtain a copy of the License at
5+
*
6+
* http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* Unless required by applicable law or agreed to in writing, software
9+
* distributed under the License is distributed on an "AS IS" BASIS,
10+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
* See the License for the specific language governing permissions and
12+
* limitations under the License.
13+
*/
14+
15+
// requires: concerto-core:>= 1.0.0-alpha.3
16+
namespace org.accordproject.signature.block
17+
18+
import org.accordproject.contract.ClauseData from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto
19+
import org.accordproject.contract.Party from https://concerto-1-0--accordproject-models.netlify.com/accordproject/contract.cto
20+
21+
/**
22+
* An abstract clause for a party scoped signature block
23+
*/
24+
abstract asset SignatureClause extends ClauseData {
25+
@Pdf("style", "background")
26+
@ContractEditor("readOnly", true, "opacity", 0)
27+
--> Party signatory
28+
}

0 commit comments

Comments
 (0)