agreement-design-prototype 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/agreement-design.gemspec +2 -1
- data/build/build_models.rb +24 -9
- data/gen/data/data.json +1 -0
- data/gen/data/data.yaml +46 -0
- data/gen/data/fm_agreements.jsonlines +2 -0
- data/gen/data/fm_catalogue.jsonlines +1 -0
- data/gen/diagrams/metamodel.dot +45 -0
- data/gen/doc/data.md +44 -0
- data/gen/doc/metamodel.md +99 -57
- data/gen/images/metamodel.jpg +0 -0
- data/model/agreement.rb +95 -43
- data/model/fm.rb +56 -24
- data/model/geographic.rb +30 -0
- data/model/party.rb +14 -12
- data/out/test/data/datatest.json +1 -0
- data/out/test/diagrams/d.dot +16 -30
- data/out/test/doc/doctest.md +17 -19
- data/out/test/doc/modeldoctest.md +62 -0
- data/out/test/images/d.jpg +0 -0
- data/src/api.rb +33 -0
- data/src/data.rb +89 -0
- data/src/data_model.rb +102 -38
- data/src/diagram.rb +61 -95
- data/src/doc.rb +55 -151
- data/src/transform.rb +144 -0
- data/test/data_model_test.rb +43 -65
- data/test/data_test.rb +26 -0
- data/test/diagram_test.rb +2 -5
- data/test/doc_test.rb +15 -9
- data/test/test_model.rb +88 -0
- data/test/transform_test.rb +83 -0
- metadata +21 -5
- data/gen/diagrams/data_model.dot +0 -34
- data/gen/doc/frameworks.md +0 -19
- data/gen/images/data_model.jpg +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4be9d81a5edecf06009e29793a626e699d48f3c12a2d60003c8b18c857b287af
|
4
|
+
data.tar.gz: 28b6ebb6911ee923b868a76236f3ae3fc5fd9299eba00b6d139c35b47e072849
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67f906f47daded5e621a16ceda86a5a1218c87e4ebb808abb6a68e8c6d63cd54284717feff59e68072c12c9c448d612a2de8ad94af34ea48d6b3fe2b4cbee316
|
7
|
+
data.tar.gz: 3952efcaf70a5efaa8b6c1507d910ae4fad7812e99217ccc7d289295ac2d9a5b8899318003ff938ef918a93c8842917283bed46f3e7dd4d5c0f37456a0a199a6
|
data/README.md
CHANGED
@@ -15,3 +15,18 @@ This prototype
|
|
15
15
|
- possibly produces data domain descriptions, e.g. Ruby-on-Rails schema records
|
16
16
|
|
17
17
|
|
18
|
+
# Things to see
|
19
|
+
|
20
|
+
the [agreements](agreements/) directory defines our [agreements metamodel](model/agreement.rb) and our
|
21
|
+
[reference agreements and catalogues](model/fm.rb)
|
22
|
+
(example for fm given)
|
23
|
+
|
24
|
+
the build script generates [outputs](gen) including
|
25
|
+
|
26
|
+
- [data files](gen/data) showing the agreements and catalogue entries
|
27
|
+
- for instance, can bulk load [jsonlines](gen/data/fm_catalogue.jsonlines) for FM catalogue into search cluster
|
28
|
+
- a [picture](gen/images/metamodel.jpg) of the metamodel
|
29
|
+
- documentation for the agreements and metamodel
|
30
|
+
|
31
|
+
|
32
|
+
|
data/agreement-design.gemspec
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# agreement-design.gemspec
|
2
|
+
# TODO - split the gem for schema design from the one containing agreement models
|
2
3
|
Gem::Specification.new do |spec|
|
3
4
|
spec.name = "agreement-design-prototype"
|
4
|
-
spec.version = "0.0.
|
5
|
+
spec.version = "0.0.4"
|
5
6
|
spec.authors = ["CCS"]
|
6
7
|
spec.homepage = 'https://github.com/Crown-Commercial-Service/cmp-design-prototype/agreement-design'
|
7
8
|
spec.email = ["rubygems@humphries.tech"]
|
data/build/build_models.rb
CHANGED
@@ -1,16 +1,31 @@
|
|
1
1
|
require_relative "../src/diagram"
|
2
|
+
require_relative "../src/doc"
|
3
|
+
require_relative "../src/data"
|
2
4
|
require_relative "../model/agreement"
|
5
|
+
require_relative "../model/fm"
|
6
|
+
require_relative '../model/geographic'
|
3
7
|
|
4
|
-
path= File.join(File.dirname(__FILE__), '../', "gen")
|
8
|
+
path = File.join(File.dirname(__FILE__), '../', "gen")
|
5
9
|
|
6
|
-
|
7
|
-
|
8
|
-
diagram.describe Category, Parties
|
10
|
+
metamodels = [Agreements, Parties, Geographic, FM]
|
11
|
+
models = [Agreements::FM_Agreements, FM::FM_Catalogue, Geographic::NUTS]
|
9
12
|
|
10
|
-
|
11
|
-
|
13
|
+
diagram = Diagram.new(path, "metamodel")
|
14
|
+
diagram.describe *metamodels
|
12
15
|
|
13
|
-
doc=
|
14
|
-
|
15
|
-
doc.document Category::FM
|
16
|
+
doc = Document.new(path, "metamodel")
|
17
|
+
doc.document_metamodel *metamodels
|
16
18
|
|
19
|
+
doc = Document.new(path, "data")
|
20
|
+
doc.document *models
|
21
|
+
|
22
|
+
data= DataFile.new( path, "data", fmt: :json)
|
23
|
+
data.output *models
|
24
|
+
data= DataFile.new( path, "data", fmt: :yaml)
|
25
|
+
data.output *models
|
26
|
+
|
27
|
+
data= DataFile.new( path, "fm_agreements", fmt: :jsonlines)
|
28
|
+
data.output Agreements::FM_Agreements
|
29
|
+
|
30
|
+
data= DataFile.new( path, "fm_catalogue", fmt: :jsonlines)
|
31
|
+
data.output FM::FM_Catalogue
|
data/gen/data/data.json
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"agreement":[{"kind":"Framework","id":"FM","fwk_number":"RM8330","version":"0.1.0","description":"This agreement is for the provision of Facilities Management","start_date":"2018-10-01"},{"kind":"Lot","id":"FM lot 1","name":"low-to-mid value Facilities Management Lot","part_of_id":"FM","min_value":0,"max_value":70000000,"version":"0.1.0","item_type":[{"id":"FM.1a-C.3","scheme_id":"CCS","unit":"Currency","code":"CCS-building-area-method","keyword":["cleaning","washing","janitor"]}]}],"fm_offering":[{"supplier_id":"XYZ corp","name":"XYZ's nifty school cleaning service","agreement_id":"FM","location_id":["UK"],"sector":["Education"],"sc_cleared":"TRUE","item":[{"type":"FM.1a-C.3","value":3000}]}],"areacode":[{"name":"UK","subcode":[{"name":"UKC","description":"North East","subcode":[{"name":"UKC1","description":"Tees Valley and County Durham"}]},{"name":"UKL","description":"London"}]}]}
|
data/gen/data/data.yaml
ADDED
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
:agreement:
|
3
|
+
- :kind: :Framework
|
4
|
+
:id: FM
|
5
|
+
:fwk_number: RM8330
|
6
|
+
:version: 0.1.0
|
7
|
+
:description: This agreement is for the provision of Facilities Management
|
8
|
+
:start_date: 2018-10-01
|
9
|
+
- :kind: :Lot
|
10
|
+
:id: FM lot 1
|
11
|
+
:name: low-to-mid value Facilities Management Lot
|
12
|
+
:part_of_id: FM
|
13
|
+
:min_value: 0
|
14
|
+
:max_value: 70000000
|
15
|
+
:version: 0.1.0
|
16
|
+
:item_type:
|
17
|
+
- :id: FM.1a-C.3
|
18
|
+
:scheme_id: :CCS
|
19
|
+
:unit: :Currency
|
20
|
+
:code: CCS-building-area-method
|
21
|
+
:keyword:
|
22
|
+
- cleaning
|
23
|
+
- washing
|
24
|
+
- janitor
|
25
|
+
:fm_offering:
|
26
|
+
- :supplier_id: XYZ corp
|
27
|
+
:name: XYZ's nifty school cleaning service
|
28
|
+
:agreement_id: FM
|
29
|
+
:location_id:
|
30
|
+
- :UK
|
31
|
+
:sector:
|
32
|
+
- :Education
|
33
|
+
:sc_cleared: 'TRUE'
|
34
|
+
:item:
|
35
|
+
- :type: FM.1a-C.3
|
36
|
+
:value: 3000
|
37
|
+
:areacode:
|
38
|
+
- :name: :UK
|
39
|
+
:subcode:
|
40
|
+
- :name: :UKC
|
41
|
+
:description: North East
|
42
|
+
:subcode:
|
43
|
+
- :name: :UKC1
|
44
|
+
:description: Tees Valley and County Durham
|
45
|
+
- :name: :UKL
|
46
|
+
:description: London
|
@@ -0,0 +1,2 @@
|
|
1
|
+
{"kind":"Framework","id":"FM","fwk_number":"RM8330","version":"0.1.0","description":"This agreement is for the provision of Facilities Management","start_date":"2018-10-01"}
|
2
|
+
{"kind":"Lot","id":"FM lot 1","name":"low-to-mid value Facilities Management Lot","part_of_id":"FM","min_value":0,"max_value":70000000,"version":"0.1.0","item_type":[{"id":"FM.1a-C.3","scheme_id":"CCS","unit":"Currency","code":"CCS-building-area-method","keyword":["cleaning","washing","janitor"]}]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"supplier_id":"XYZ corp","name":"XYZ's nifty school cleaning service","agreement_id":"FM","location_id":["UK"],"sector":["Education"],"sc_cleared":"TRUE","item":[{"type":"FM.1a-C.3","value":3000}]}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
strict digraph {
|
2
|
+
subgraph cluster_Agreements {
|
3
|
+
node [shape=plaintext margin=0];
|
4
|
+
label=Agreements;
|
5
|
+
"ItemType" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>ItemType</TD></TH><TR><TD ALIGN="LEFT">-id</TD></TR><TR><TD ALIGN="LEFT">-scheme_id</TD></TR><TR><TD ALIGN="LEFT">-description</TD></TR><TR><TD ALIGN="LEFT">-keyword</TD></TR><TR><TD ALIGN="LEFT">-uri</TD></TR><TR><TD ALIGN="LEFT">-code</TD></TR><TR><TD ALIGN="LEFT">-unit</TD></TR></table>>];
|
6
|
+
"Need" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>Need</TD></TH><TR><TD ALIGN="LEFT">-buyer_id</TD></TR><TR><TD ALIGN="LEFT">-kind</TD></TR><TR><TD ALIGN="LEFT">-unit</TD></TR></table>>];
|
7
|
+
"Agreement" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>Agreement</TD></TH><TR><TD ALIGN="LEFT">-kind</TD></TR><TR><TD ALIGN="LEFT">-id</TD></TR><TR><TD ALIGN="LEFT">-name</TD></TR><TR><TD ALIGN="LEFT">-version</TD></TR><TR><TD ALIGN="LEFT">-start_date</TD></TR><TR><TD ALIGN="LEFT">-end_date</TD></TR><TR><TD ALIGN="LEFT">-description</TD></TR><TR><TD ALIGN="LEFT">-fwk_number</TD></TR><TR><TD ALIGN="LEFT">-sf_typ</TD></TR><TR><TD ALIGN="LEFT">-sf_is</TD></TR><TR><TD ALIGN="LEFT">-part_of_id</TD></TR><TR><TD ALIGN="LEFT">-conforms_to_id</TD></TR><TR><TD ALIGN="LEFT">-item_type</TD></TR><TR><TD ALIGN="LEFT">-min_value</TD></TR><TR><TD ALIGN="LEFT">-max_value</TD></TR></table>>];
|
8
|
+
"Item" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>Item</TD></TH><TR><TD ALIGN="LEFT">-type</TD></TR><TR><TD ALIGN="LEFT">-unit</TD></TR><TR><TD ALIGN="LEFT">-value</TD></TR></table>>];
|
9
|
+
"Offering" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>Offering</TD></TH><TR><TD ALIGN="LEFT">-agreement_id</TD></TR><TR><TD ALIGN="LEFT">-supplier_id</TD></TR><TR><TD ALIGN="LEFT">-offerType</TD></TR><TR><TD ALIGN="LEFT">-name</TD></TR><TR><TD ALIGN="LEFT">-description</TD></TR><TR><TD ALIGN="LEFT">-item</TD></TR><TR><TD ALIGN="LEFT">-location_id</TD></TR><TR><TD ALIGN="LEFT">-sector</TD></TR></table>>];
|
10
|
+
"Catalogue" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>Catalogue</TD></TH><TR><TD ALIGN="LEFT">-offers</TD></TR></table>>];
|
11
|
+
"Involvement" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>Involvement</TD></TH><TR><TD ALIGN="LEFT">-agreement_id</TD></TR><TR><TD ALIGN="LEFT">-party_id</TD></TR><TR><TD ALIGN="LEFT">-role</TD></TR></table>>];
|
12
|
+
}
|
13
|
+
subgraph cluster_Parties {
|
14
|
+
node [shape=plaintext margin=0];
|
15
|
+
label=Parties;
|
16
|
+
"Party" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>Party</TD></TH><TR><TD ALIGN="LEFT">-id</TD></TR><TR><TD ALIGN="LEFT">-supplier_registration_completed</TD></TR><TR><TD ALIGN="LEFT">-buyer_registration_completed</TD></TR></table>>];
|
17
|
+
}
|
18
|
+
subgraph cluster_Geographic {
|
19
|
+
node [shape=plaintext margin=0];
|
20
|
+
label=Geographic;
|
21
|
+
"AreaCode" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>AreaCode</TD></TH><TR><TD ALIGN="LEFT">-name</TD></TR><TR><TD ALIGN="LEFT">-description</TD></TR><TR><TD ALIGN="LEFT">-subcode</TD></TR></table>>];
|
22
|
+
}
|
23
|
+
subgraph cluster_FM {
|
24
|
+
node [shape=plaintext margin=0];
|
25
|
+
label=FM;
|
26
|
+
"FM_Offering" [label=<<table BORDER="1" CELLBORDER="0" CELLSPACING="0"><TH><TD>FM_Offering</TD></TH><TR><TD ALIGN="LEFT">-agreement_id</TD></TR><TR><TD ALIGN="LEFT">-supplier_id</TD></TR><TR><TD ALIGN="LEFT">-offerType</TD></TR><TR><TD ALIGN="LEFT">-name</TD></TR><TR><TD ALIGN="LEFT">-description</TD></TR><TR><TD ALIGN="LEFT">-item</TD></TR><TR><TD ALIGN="LEFT">-location_id</TD></TR><TR><TD ALIGN="LEFT">-sector</TD></TR><TR><TD ALIGN="LEFT">-sc_cleared</TD></TR></table>>];
|
27
|
+
}
|
28
|
+
"Agreement" -> "Agreement" [label="part_of_id" arrowhead = "open" arrowtail = "none" ];
|
29
|
+
"Agreement" -> "Agreement" [label="conforms_to_id" arrowhead = "open" arrowtail = "none" ];
|
30
|
+
"Agreement" -> "ItemType" [label="{contains} item_type" arrowhead = "none" arrowtail = "diamond" ];
|
31
|
+
"Item" -> "ItemType" [label="type" arrowhead = "open" arrowtail = "none" ];
|
32
|
+
"Offering" -> "Agreement" [label="agreement_id" arrowhead = "open" arrowtail = "none" ];
|
33
|
+
"Offering" -> "Party" [label="supplier_id" arrowhead = "open" arrowtail = "none" ];
|
34
|
+
"Offering" -> "Item" [label="{contains} item" arrowhead = "none" arrowtail = "diamond" ];
|
35
|
+
"Offering" -> "AreaCode" [label="location_id" arrowhead = "open" arrowtail = "none" ];
|
36
|
+
"Catalogue" -> "Offering" [label="{contains} offers" arrowhead = "none" arrowtail = "diamond" ];
|
37
|
+
"Involvement" -> "Agreement" [label="agreement_id" arrowhead = "open" arrowtail = "none" ];
|
38
|
+
"Involvement" -> "Party" [label="party_id" arrowhead = "open" arrowtail = "none" ];
|
39
|
+
"AreaCode" -> "AreaCode" [label="{contains} subcode" arrowhead = "none" arrowtail = "diamond" ];
|
40
|
+
"FM_Offering" -> "Offering" [label="extends" arrowhead = "none" arrowtail = "normal" ];
|
41
|
+
"FM_Offering" -> "Agreement" [label="agreement_id" arrowhead = "open" arrowtail = "none" ];
|
42
|
+
"FM_Offering" -> "Party" [label="supplier_id" arrowhead = "open" arrowtail = "none" ];
|
43
|
+
"FM_Offering" -> "Item" [label="{contains} item" arrowhead = "none" arrowtail = "diamond" ];
|
44
|
+
"FM_Offering" -> "AreaCode" [label="location_id" arrowhead = "open" arrowtail = "none" ];
|
45
|
+
}
|
data/gen/doc/data.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
### FM
|
2
|
+
- kind Framework
|
3
|
+
- id FM
|
4
|
+
- fwk_number RM8330
|
5
|
+
- version 0.1.0
|
6
|
+
- description This agreement is for the provision of Facilities Management
|
7
|
+
- start_date 2018-10-01
|
8
|
+
### low-to-mid value Facilities Management Lot FM lot 1
|
9
|
+
- kind Lot
|
10
|
+
- id FM lot 1
|
11
|
+
- name low-to-mid value Facilities Management Lot
|
12
|
+
- part_of_id FM
|
13
|
+
- min_value 0
|
14
|
+
- max_value 70000000
|
15
|
+
- version 0.1.0
|
16
|
+
#### item_type FM.1a-C.3
|
17
|
+
- id FM.1a-C.3
|
18
|
+
- scheme_id CCS
|
19
|
+
- unit Currency
|
20
|
+
- code CCS-building-area-method
|
21
|
+
- keyword cleaning
|
22
|
+
- keyword washing
|
23
|
+
- keyword janitor
|
24
|
+
### XYZ's nifty school cleaning service
|
25
|
+
- supplier_id XYZ corp
|
26
|
+
- name XYZ's nifty school cleaning service
|
27
|
+
- agreement_id FM
|
28
|
+
- location_id UK
|
29
|
+
- sector Education
|
30
|
+
- sc_cleared TRUE
|
31
|
+
#### item
|
32
|
+
- type FM.1a-C.3
|
33
|
+
- value 3000
|
34
|
+
### UK
|
35
|
+
- name UK
|
36
|
+
#### UKC
|
37
|
+
- name UKC
|
38
|
+
- description North East
|
39
|
+
##### UKC1
|
40
|
+
- name UKC1
|
41
|
+
- description Tees Valley and County Durham
|
42
|
+
#### UKL
|
43
|
+
- name UKL
|
44
|
+
- description London
|
data/gen/doc/metamodel.md
CHANGED
@@ -1,98 +1,140 @@
|
|
1
|
-
|
2
|
-
##
|
3
|
-
Defines the
|
1
|
+
# Data model: Agreements
|
2
|
+
## ItemType
|
3
|
+
Defines the items that can be offered in any selected agreements
|
4
|
+
Agreements hava a number of items that can have values defining the agreement. The Items should
|
5
|
+
constrain the key quantifiable elements of an agreement award. A supplier may provide additional
|
6
|
+
variable facts in their Offer to supplement the description of how they support the agreement.
|
4
7
|
|
5
8
|
|attribute|type|multiplicity|description|
|
6
9
|
|---------|----|------------|-----------|
|
7
|
-
|id|String|1
|
8
|
-
|
|
10
|
+
|id|String|1|The code id, which must be unique across all schemes|
|
11
|
+
|scheme_id|(CPV,CPVS,UNSPSC,CPV,OKDP,OKPD,CCS)|1|The classiciation scheme id|
|
12
|
+
|description|String|1||
|
9
13
|
|keyword|String|*||
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
|uri|String|1| URI for the code within the scheme defining this type |
|
15
|
+
|code|String|1| Code within the scheme defining this type |
|
16
|
+
|unit|(Area,Currency)|1| define the units, if one units matches |
|
17
|
+
## Need
|
18
|
+
Defines a buyer's need which can be matched to agreement items and other details
|
19
|
+
The need matches closely to our definitions of agreements under 'items types' and their classification
|
20
|
+
schemes, but is not a one-to-one match.
|
17
21
|
|
18
22
|
|attribute|type|multiplicity|description|
|
19
23
|
|---------|----|------------|-----------|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
24
|
-
|
25
|
-
## Framework extends Category::Agreement
|
26
|
-
A kind of Framework used for calloffs, composed of Lots
|
24
|
+
|buyer_id|String|1|The buyer expressing the need|
|
25
|
+
|kind|(Budget,Location,Service)|1||
|
26
|
+
|unit|(Area,Currency)|1|The units typically used to express the need|
|
27
|
+
## Agreement
|
28
|
+
General definition of Commercial Agreements
|
27
29
|
|
28
30
|
|attribute|type|multiplicity|description|
|
29
31
|
|---------|----|------------|-----------|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
|kind|(Framework,Lot,Contract)|1|Kind of agreement, including :Framework, :Lot, :Contract|
|
33
|
+
|id|String|1|uuid of agreeement|
|
34
|
+
|name|String|1|uuid of agreeement|
|
32
35
|
|version|String|1|semantic version id of the form X.Y.Z|
|
33
36
|
|start_date|Date|1||
|
34
37
|
|end_date|Date|1||
|
35
|
-
|
|
36
|
-
|
37
|
-
|
38
|
+
|description|String|1|Describe the agreement|
|
39
|
+
|fwk_number|String|1|Framework (RM) number of related framework if required. @Example RM123|
|
40
|
+
|sf_typ|String|1|SalesForce data type|
|
41
|
+
|sf_is|String|1|SalesForce row id|
|
42
|
+
|part_of_id|String -> Agreements::Agreement|1|Agreement this is part of, applicable only to Lots|
|
43
|
+
|conforms_to_id|String -> Agreements::Agreement|1|Agreement this conforms to, such as a Contract conforming to a Framework|
|
44
|
+
|item_type|Agreements::ItemType|*|describe the items that can be offered under the agreement|
|
45
|
+
|min_value|Integer|0..1|Minimum value of award, in pounds sterling|
|
46
|
+
|max_value|Integer|0..1|Maximum value of award, in pounds sterling|
|
47
|
+
## Item
|
48
|
+
Specifies the value of an item that is being offered for an agreement
|
38
49
|
|
39
50
|
|attribute|type|multiplicity|description|
|
40
51
|
|---------|----|------------|-----------|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
Something offered to a buyer as part of a contract.Items are defined in Catalogues.
|
52
|
+
|type|String -> Agreements::ItemType|1| type of the item |
|
53
|
+
|unit|(Area,Currency)|1| define the units |
|
54
|
+
|value|Object|1|an object of the type matching type->units|
|
55
|
+
## Offering
|
56
|
+
Supplier offering against an item or items of an agreement.
|
57
|
+
This may be extended for different agreements. A supplier may provide additional
|
58
|
+
variable facts in their Offer to supplement the description of how they support the agreement.
|
49
59
|
|
50
60
|
|attribute|type|multiplicity|description|
|
51
61
|
|---------|----|------------|-----------|
|
52
|
-
|
|
53
|
-
|
|
62
|
+
|agreement_id|String -> Agreements::Agreement|1|The agreement this offering relates to|
|
63
|
+
|supplier_id|String -> Parties::Party|1||
|
64
|
+
|offerType|String|1|Name of the subclass of the Offering, supporting the Agreement|
|
65
|
+
|name|String|1||
|
54
66
|
|description|String|1||
|
55
|
-
|
|
67
|
+
|item|Agreements::Item|*|details of the item|
|
68
|
+
|location_id|String -> Geographic::AreaCode|1..*|Pick list of applicable regions. There must be at least one, even if it is just 'UK'|
|
69
|
+
|sector|(ALL,Education,CentralGov,WiderGov,Etc)|*|Pick list of applicable sectors.|
|
56
70
|
## Catalogue
|
57
|
-
|
71
|
+
A collection of supplier offerings against an item, for an agreement
|
58
72
|
|
59
73
|
|attribute|type|multiplicity|description|
|
60
74
|
|---------|----|------------|-----------|
|
61
|
-
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
75
|
+
|offers|Agreements::Offering|*|description of the item|
|
76
|
+
## Involvement
|
77
|
+
Involvement relationship between a party and an agreement
|
78
|
+
Technology strategy documents call this type 'interest' but perhaps this could
|
79
|
+
be confused with the accounting interest
|
66
80
|
|
67
81
|
|attribute|type|multiplicity|description|
|
68
82
|
|---------|----|------------|-----------|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
83
|
+
|agreement_id|String -> Agreements::Agreement|1|The agreement this interest relates to|
|
84
|
+
|party_id|String -> Parties::Party|1|The party this interest relates to|
|
85
|
+
|role|(AwardedSupplier,AwardedBuyer,SupplyingQuote,RequestingQuote,Etc)|1|The role of the party in the involvment|
|
86
|
+
# Codes
|
87
|
+
## CCS
|
88
|
+
CCS invented schemes
|
76
89
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
90
|
+
## Budget
|
91
|
+
What is the budget the buyer has for their need?
|
92
|
+
Match the budget to the value range of the agreement, and the value range of supplier offers.
|
93
|
+
Matching the budget will probably require evaluation of offer prices.
|
94
|
+
|
95
|
+
## Location
|
96
|
+
Where is the need?
|
97
|
+
Match location needs to locations of offers
|
98
|
+
|
99
|
+
## Service
|
100
|
+
What sort of things do they need?
|
101
|
+
Match the service to item types, their keywords, and offering titles.
|
102
|
+
|
103
|
+
# Data model: Parties
|
81
104
|
## Party
|
82
105
|
|
106
|
+
The party is used to identify buyers and suppliers. Since some organisations act as
|
107
|
+
both buyers and suppliers we use the same record for both, but most organisations will
|
108
|
+
be one or the other. The onvolvement of the party with an agreement determine the role in
|
109
|
+
that contenxt.
|
110
|
+
Details still to be added
|
83
111
|
|
84
112
|
|attribute|type|multiplicity|description|
|
85
113
|
|---------|----|------------|-----------|
|
86
114
|
|id|String|1|UUID or Salesforce ID?|
|
87
|
-
|
115
|
+
|supplier_registration_completed|Date|1||
|
116
|
+
|buyer_registration_completed|Date|1||
|
117
|
+
# Data model: Geographic
|
118
|
+
## AreaCode
|
88
119
|
|
89
120
|
|
90
121
|
|attribute|type|multiplicity|description|
|
91
122
|
|---------|----|------------|-----------|
|
92
|
-
|
|
93
|
-
|
94
|
-
|
123
|
+
|name|String|1||
|
124
|
+
|description|String|1||
|
125
|
+
|subcode|Geographic::AreaCode|*|UUID or Salesforce ID?|
|
126
|
+
# Data model: FM
|
127
|
+
## FM_Offering extends Agreements::Offering
|
128
|
+
An offer for FM elements
|
95
129
|
|
96
130
|
|attribute|type|multiplicity|description|
|
97
131
|
|---------|----|------------|-----------|
|
98
|
-
|
|
132
|
+
|agreement_id|String -> Agreements::Agreement|1|The agreement this offering relates to|
|
133
|
+
|supplier_id|String -> Parties::Party|1||
|
134
|
+
|offerType|String|1|Name of the subclass of the Offering, supporting the Agreement|
|
135
|
+
|name|String|1||
|
136
|
+
|description|String|1||
|
137
|
+
|item|Agreements::Item|*|details of the item|
|
138
|
+
|location_id|String -> Geographic::AreaCode|1..*|Pick list of applicable regions. There must be at least one, even if it is just 'UK'|
|
139
|
+
|sector|(ALL,Education,CentralGov,WiderGov,Etc)|*|Pick list of applicable sectors.|
|
140
|
+
|sc_cleared|String|1||
|
Binary file
|
data/model/agreement.rb
CHANGED
@@ -1,69 +1,121 @@
|
|
1
1
|
require_relative '../src/data_model'
|
2
2
|
require_relative 'party'
|
3
|
-
|
3
|
+
require_relative 'geographic'
|
4
4
|
include DataModel
|
5
5
|
|
6
|
-
domain :
|
6
|
+
domain :Agreements do
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
SECTOR = Selection(:ALL, :Education, :CentralGov, :WiderGov, :Etc)
|
9
|
+
UNITS = Selection(:Area, :Currency)
|
10
|
+
CLASSIFICATION_SCHEMES = Selection(:CPV, :CPVS, :UNSPSC, :CPV, :OKDP, :OKPD, :CCS)
|
11
|
+
code(:CCS, description: "CCS invented schemes")
|
12
|
+
|
13
|
+
datatype(:ItemType,
|
14
|
+
description:
|
15
|
+
"Defines the items that can be offered in any selected agreements
|
16
|
+
Agreements hava a number of items that can have values defining the agreement. The Items should
|
17
|
+
constrain the key quantifiable elements of an agreement award. A supplier may provide additional
|
18
|
+
variable facts in their Offer to supplement the description of how they support the agreement.") {
|
19
|
+
|
20
|
+
attribute :id, String, "The code id, which must be unique across all schemes"
|
21
|
+
attribute :scheme_id, CLASSIFICATION_SCHEMES, "The classiciation scheme id"
|
22
|
+
attribute :description, String
|
12
23
|
attribute :keyword, String, ZERO_TO_MANY
|
13
|
-
attribute :
|
14
|
-
attribute :
|
15
|
-
attribute :
|
16
|
-
|
17
|
-
|
24
|
+
attribute :uri, String, " URI for the code within the scheme defining this type "
|
25
|
+
attribute :code, String, " Code within the scheme defining this type "
|
26
|
+
attribute :unit, UNITS, " define the units, if one units matches "
|
27
|
+
}
|
28
|
+
|
29
|
+
CATEGORY_OF_NEED = Selection(:Budget, :Location, :Service)
|
30
|
+
code(:Budget, description:
|
31
|
+
"What is the budget the buyer has for their need?
|
32
|
+
Match the budget to the value range of the agreement, and the value range of supplier offers.
|
33
|
+
Matching the budget will probably require evaluation of offer prices.")
|
34
|
+
code(:Location, description:
|
35
|
+
"Where is the need?
|
36
|
+
Match location needs to locations of offers")
|
37
|
+
code(:Service, description:
|
38
|
+
"What sort of things do they need?
|
39
|
+
Match the service to item types, their keywords, and offering titles.")
|
40
|
+
|
41
|
+
datatype(:Need,
|
42
|
+
description:
|
43
|
+
" Defines a buyer's need which can be matched to agreement items and other details
|
44
|
+
The need matches closely to our definitions of agreements under 'items types' and their classification
|
45
|
+
schemes, but is not a one-to-one match.") {
|
46
|
+
attribute :buyer_id, String, "The buyer expressing the need"
|
47
|
+
attribute :kind, Selection(:Budget, :Location,)
|
48
|
+
attribute :kind, Selection(:Budget, :Location, :Service)
|
49
|
+
attribute :unit, UNITS, "The units typically used to express the need"
|
18
50
|
}
|
19
51
|
|
20
52
|
datatype(:Agreement,
|
21
53
|
description: "General definition of Commercial Agreements") {
|
22
|
-
|
23
|
-
|
54
|
+
|
55
|
+
# identify the agreement
|
56
|
+
attribute :kind, Selection(:Framework, :Lot, :Contract),
|
57
|
+
#TODO doc should enumeration selections
|
58
|
+
"Kind of agreement, including :Framework, :Lot, :Contract"
|
59
|
+
attribute :id, String, "uuid of agreeement"
|
60
|
+
attribute :name, String, "uuid of agreeement"
|
24
61
|
attribute :version, String, "semantic version id of the form X.Y.Z"
|
25
62
|
attribute :start_date, Date
|
26
63
|
attribute :end_date, Date
|
27
|
-
|
64
|
+
attribute :description, String, "Describe the agreement"
|
65
|
+
attribute :fwk_number, String, "Framework (RM) number of related framework if required. @Example RM123"
|
66
|
+
attribute :sf_typ, String, "SalesForce data type"
|
67
|
+
attribute :sf_is, String, "SalesForce row id"
|
28
68
|
|
29
|
-
|
30
|
-
|
31
|
-
attribute :
|
32
|
-
|
69
|
+
# structure of agreement
|
70
|
+
attribute :part_of_id, String, "Agreement this is part of, applicable only to Lots", links: :Agreement
|
71
|
+
attribute :conforms_to_id, String, "Agreement this conforms to, such as a Contract conforming to a Framework", links: :Agreement
|
72
|
+
attribute :item_type, :ItemType, ZERO_TO_MANY,
|
73
|
+
"describe the items that can be offered under the agreement"
|
74
|
+
|
75
|
+
# Qualifications
|
76
|
+
attribute :min_value, Integer, ZERO_OR_ONE, "Minimum value of award, in pounds sterling"
|
77
|
+
attribute :max_value, Integer, ZERO_OR_ONE, "Maximum value of award, in pounds sterling"
|
33
78
|
|
34
|
-
datatype(:Lot, extends: Category::Agreement) {
|
35
|
-
attribute :fwk_id, String, "Part of framework", links: Category::Framework
|
36
79
|
}
|
37
80
|
|
38
81
|
datatype(:Item,
|
39
|
-
description: "
|
40
|
-
|
41
|
-
attribute :
|
42
|
-
attribute :
|
43
|
-
attribute :description, String
|
44
|
-
attribute :value, String
|
82
|
+
description: "Specifies the value of an item that is being offered for an agreement") {
|
83
|
+
attribute :type, String, " type of the item ", links: :ItemType
|
84
|
+
attribute :unit, UNITS, " define the units "
|
85
|
+
attribute :value, Object, "an object of the type matching type->units"
|
45
86
|
}
|
46
87
|
|
47
|
-
datatype(:
|
48
|
-
description: "
|
49
|
-
|
50
|
-
|
51
|
-
attribute :agreement_id, String, links:
|
88
|
+
datatype(:Offering,
|
89
|
+
description: " Supplier offering against an item or items of an agreement.
|
90
|
+
This may be extended for different agreements. A supplier may provide additional
|
91
|
+
variable facts in their Offer to supplement the description of how they support the agreement. ") {
|
92
|
+
attribute :agreement_id, String, "The agreement this offering relates to", links: :Agreement
|
93
|
+
attribute :supplier_id, String, links: Parties::Party
|
94
|
+
attribute :offerType, String, "Name of the subclass of the Offering, supporting the Agreement"
|
95
|
+
attribute :name, String
|
96
|
+
attribute :description, String
|
97
|
+
attribute :item, :Item, ZERO_TO_MANY, "details of the item"
|
98
|
+
# Qualifications
|
99
|
+
attribute :location_id, String, ONE_TO_MANY,
|
100
|
+
"Pick list of applicable regions. There must be at least one, even if it is just 'UK'",
|
101
|
+
links: Geographic::AreaCode
|
102
|
+
attribute :sector, SECTOR, ZERO_TO_MANY,
|
103
|
+
"Pick list of applicable sectors."
|
52
104
|
}
|
53
105
|
|
54
|
-
datatype(:
|
55
|
-
|
56
|
-
attribute :
|
57
|
-
attribute :item_id, String, links: Category::Item
|
58
|
-
attribute :catalogue_id, String, links: Category::Catalogue
|
59
|
-
attribute :supplier_id, String, links: Parties::Supplier
|
60
|
-
attribute :description, String, "Description of the offer"
|
106
|
+
datatype(:Catalogue,
|
107
|
+
description: " A collection of supplier offerings against an item, for an agreement ") {
|
108
|
+
attribute :offers, :Offering, ZERO_TO_MANY, "description of the item"
|
61
109
|
}
|
62
110
|
|
63
|
-
datatype(:
|
64
|
-
description: "
|
65
|
-
|
111
|
+
datatype(:Involvement,
|
112
|
+
description: "Involvement relationship between a party and an agreement
|
113
|
+
Technology strategy documents call this type 'interest' but perhaps this could
|
114
|
+
be confused with the accounting interest") {
|
115
|
+
attribute :agreement_id, String, "The agreement this interest relates to", links: :Agreement
|
116
|
+
attribute :party_id, String, "The party this interest relates to", links: Parties::Party
|
117
|
+
attribute :role, Selection(:AwardedSupplier, :AwardedBuyer, :SupplyingQuote, :RequestingQuote, :Etc),
|
118
|
+
"The role of the party in the involvment"
|
66
119
|
}
|
67
120
|
|
68
|
-
end
|
69
|
-
|
121
|
+
end
|