Skip to content

Commit

Permalink
Merge pull request #18 from ivanka-jakimchuk/Docs
Browse files Browse the repository at this point in the history
Docs: Describe the tutorial section
  • Loading branch information
leits committed May 23, 2018
2 parents 9b29de4 + 44e1fe5 commit 9f37dfd
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 15 deletions.
10 changes: 5 additions & 5 deletions docs/source/standard/item.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Schema
`itemClassificationScheme` to identify preferred classification lists,
including CAV and GSIN.

It is required for `classification.scheme` to be `CAV`. The
`classification.id` should be valid CAV code.
It is required for `classification.scheme` to be `CAV-PS` or `CPV`. The
`classification.id` should be valid `CAV-PS` or `CPV` code.

:additionalClassifications:
List of :ref:`Classification` objects, optional
Expand All @@ -42,7 +42,7 @@ Schema
This may also be used to present codes from an internal classification
scheme.

It is required to have at least one item with `ДКПП` as `scheme`.
E.g.`CPVS` and `DK018` can be chosen from the list.

:unit:
:ref:`Unit`, required
Expand Down Expand Up @@ -139,7 +139,7 @@ Schema
The classification code drawn from the selected scheme.

:description:
string, optional
string, required

|ocdsDescription|
A textual description or title for the code.
Expand All @@ -166,7 +166,7 @@ Schema
UN/CEFACT Recommendation 20 unit code.

:name:
string
string, optional

|ocdsDescription|
Name of the unit
20 changes: 16 additions & 4 deletions docs/source/standard/organization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,21 @@ Schema
List of :ref:`identifier` objects, optional

:address:
:ref:`Address`, required
:ref:`Address`, required for assetCustodian

:contactPoint:
:ref:`ContactPoint`, required
:ref:`ContactPoint`, required for assetCustodian

:kind:
string, optional

Type of the organizer.
Available only for assetCustodian.

Possible values:
- ``general`` - Organizer (general)
- ``special`` - Organizer that operates in certain spheres of economic activity
- ``other`` - Legal persons that are not organizers in the sense of the Law, but are state, utility, public enterprises, economic partnerships or associations of enterprises in which state or public utility share is 50 percent or more

.. index:: Company, id

Expand Down Expand Up @@ -138,13 +148,13 @@ Schema
The name of the contact person, department, or contact point, for correspondence relating to this contracting process.

:email:
email, optional
email

|ocdsDescription|
The e-mail address of the contact point/person.

:telephone:
string, required
string

|ocdsDescription|
The telephone number of the contact point/person. This should include the international dialling code.
Expand All @@ -160,3 +170,5 @@ Schema

|ocdsDescription|
A web address for the contact point/person.

Either `email` or `telephone` field has to be provided.
27 changes: 21 additions & 6 deletions docs/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ Error states that no `data` has been found in JSON body.
Creating asset
--------------


Let's create asset with the minimal (only required) data set:
Let's create asset with the minimal data set:

.. literalinclude:: tutorial/asset-post-2pc.http
:language: javascript

The object you're trying to add initially receives `draft` status. For the asset to be created within the Registry, it should be manually switched to `pending` status (2 Phase Commit mechanism):

.. literalinclude:: tutorial/asset-patch-2pc.http
:language: javascript

Expand Down Expand Up @@ -66,12 +67,13 @@ Let's see what listing of assets reveals us:

We do see the internal `id` of a asset (that can be used to construct full URL by prepending `http://lb.api-sandbox.registry.ea2.openprocurement.net/api/<api_version>/assets/`) and its `dateModified` datestamp.

The previous asset contained only required fields. Let's try creating asset with more data
(asset has status `created`):
Let's create another asset:

.. literalinclude:: tutorial/create-second-asset.http
:language: javascript

..........................................................

And again we have `201 Created` response code, `Location` header and body with extra `id`, `assetID`, and `dateModified` properties.

Let's check what asset registry contains:
Expand All @@ -91,7 +93,9 @@ Let's update asset description:

.. XXX body is empty for some reason (printf fails)
We see the added properies have merged with existing asset data. Additionally, the `dateModified` property was updated to reflect the last modification datestamp.
We see the added properties have merged with existing asset data. Additionally, the `dateModified` property was updated to reflect the last modification date stamp.

`Note` that the asset can be modified only within the rectification period (up to `rectificationPeriod.endDate`).

Checking the listing again reflects the new modification date:

Expand All @@ -101,7 +105,9 @@ Checking the listing again reflects the new modification date:
Deleting Asset
--------------

Let's delete asset. First you need to add canellationDetails document:
Let's delete asset.

Firstly, you need to add a document with the `documentType: canellationDetails`:

.. literalinclude:: tutorial/add_cancellation_document.http
:language: javascript
Expand All @@ -114,14 +120,23 @@ And now asset can be easily deleted:
Integration with lots
---------------------

As long as the lot is formed, the system should verify whether the asset can be attached to that lot. With the lot status being changed to `verification` the asset automatically reaches `verification` as well.

In case of the asset being available, its status becomes `active`.

.. literalinclude:: tutorial/attached-to-lot-asset-view.http
:language: javascript

If the lot is formed incorrectly, the asset will receive `pending` status.

.. literalinclude:: tutorial/detached-from-lot-asset-view.http
:language: javascript

As long as the lot status becomes either `pending.deleted` or `pending.dissolution`, the asset attached to that lot receives `pending` status.

..............................

As long as the lot receives `pending.sold` status, the asset attached to that lot becomes `complete`.

.. literalinclude:: tutorial/complete-asset-view.http
:language: javascript

0 comments on commit 9f37dfd

Please sign in to comment.