Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ktarasz committed Feb 17, 2016
2 parents ec775dd + 860cc83 commit 549fe03
Show file tree
Hide file tree
Showing 18 changed files with 118 additions and 68 deletions.
8 changes: 8 additions & 0 deletions docs/source/acceleration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. _acceleration:

Acceleration mode for sandbox
=============================

Acceleration mode was developed to enable Open UA procedures testing in the sandbox and to reduce time frames of these procedures.

In order to use acceleration mode you should set `quick, accelerator=1440` as text value for `procurementMethodDetails` during tender creation. The number 1440 shows that restrictions and time frames will be reduced in 1440 times. For example, `tenderingPeriod` for the Open UA procedure should be at least 15 days. When using the acceleration mode with `1440` value, tenderingPeriod can be as short as 15 minutes (15 days = 21600 min; 21600/1440 = 15 min). This mode will work only in the **sandbox**.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Contents:
tutorial
standard/index
complaints
acceleration
reference

Indices and tables
Expand Down
Binary file added docs/source/locale/uk/LC_MESSAGES/acceleration.mo
Binary file not shown.
61 changes: 61 additions & 0 deletions docs/source/locale/uk/LC_MESSAGES/acceleration.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#
msgid ""
msgstr ""
"Project-Id-Version: openprocurement.tender.openua 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-17 09:46+0200\n"
"PO-Revision-Date: 2016-02-17 09:53+0200\n"
"Last-Translator: Zoriana Zaiats <sorenabell@quintagroup.com>\n"
"Language-Team: Ukrainian <info@quintagroup.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: uk\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<"
"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 1.5\n"

#: ../../source/acceleration.rst:4
msgid "Acceleration mode for sandbox"
msgstr "Режим прискорення в пісочниці"

#: ../../source/acceleration.rst:6
msgid ""
"Acceleration mode was developed to enable Open UA procedures testing in the "
"sandbox and to reduce time frames of these procedures."
msgstr ""
"Для зменшення термінів і забезпечення можливості тестування процедур на "
"пісочниці доступний режим прискорення."

#: ../../source/acceleration.rst:8
msgid ""
"In order to use acceleration mode you should set `quick, accelerator=1440` "
"as text value for `procurementMethodDetails` during tender creation. The "
"number 1440 shows that restrictions and time frames will be reduced in 1440 "
"times. For example, `tenderingPeriod` for the Open UA procedure should be at"
" least 15 days. When using the acceleration mode with `1440` value, "
"tenderingPeriod can be as short as 15 minutes (15 days = 21600 min; "
"21600/1440 = 15 min). This mode will work only in the **sandbox**."
msgstr ""
"При створенні тендера достатньо встановити `procurementMethodDetails` "
"текстове значення `quick, accelerator=1440`. Число 1440 показує, що часові "
"обмеження та терміни скорочуються в 1440 раз. Для прикладу, `tenderingPeriod` "
"для відкритої української процедури повинен бути не менше ніж 15 днів. При "
"використанні режиму прискорення із значенням `1440`, tenderingPeriod може "
"тривати не менше ніж 15 хв (15 днів = 21600 хв; 21600/1440 = 15 хв). Даний "
"механізм діє лише на **пісочниці**."

#~ msgid ""
#~ "Acceleration mode was developed to enable Open EU procedures testing in the "
#~ "sandbox and to reduce time frames of these procedures."
#~ msgstr ""

#~ msgid ""
#~ "In order to use acceleration mode you should set 'quick, accelerator=1440' "
#~ "as text value for 'procurementMethodDetails' during tender creation. The "
#~ "number 1440 shows that restrictions and time frames will be reduced in 1440 "
#~ "times. For example, 'tenderingPeriod' for the Open UA procedure should be at"
#~ " least 15 days. When using the acceleration mode with 1440 value, "
#~ "tenderingPeriod can be as short as 15 minutes (15 days = 21600 min; "
#~ "21600/1440 = 15 min). This mode will work only in the **sandbox**."
#~ msgstr ""
Binary file modified docs/source/locale/uk/LC_MESSAGES/index.mo
Binary file not shown.
21 changes: 10 additions & 11 deletions docs/source/locale/uk/LC_MESSAGES/index.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.2.0\n"
"Language: uk\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"Generated-By: Babel 2.2.0\n"
"X-Generator: Poedit 1.8.5\n"

#: ../../source/index.rst:9
Expand All @@ -28,27 +27,27 @@ msgstr "Вітаємо на сайті документації по openprocure
#: ../../source/index.rst:11
msgid ""
"Please report any problems or suggestions for improvement either via the "
"`mailing list <http://groups.google.com/group/open-procurement-general>`_ or "
"the `issue tracker <https://github.com/openprocurement/openprocurement.tender."
"openua/issues>`_."
"`mailing list <http://groups.google.com/group/open-procurement-general>`_ or"
" the `issue tracker "
"<https://github.com/openprocurement/openprocurement.tender.openua/issues>`_."
msgstr ""
"Будь ласка повідомляйте про всі проблеми та поради покращень або через "
"`розсилку <http://groups.google.com/group/open-procurement-general>`_ , або "
"через `issue tracker <https://github.com/openprocurement/openprocurement.api/"
"issues>`_."
"через `issue tracker "
"<https://github.com/openprocurement/openprocurement.api/issues>`_."

#: ../../source/index.rst:16
msgid "Contents:"
msgstr "Зміст:"

#: ../../source/index.rst:29
#: ../../source/index.rst:30
msgid "Indices and tables"
msgstr "Індекси та таблиці"

#: ../../source/index.rst:31
#: ../../source/index.rst:32
msgid ":ref:`genindex`"
msgstr ":ref:`genindex`"

#: ../../source/index.rst:32
#: ../../source/index.rst:33
msgid ":ref:`search`"
msgstr ":ref:`search`"
Binary file modified docs/source/locale/uk/LC_MESSAGES/standard/document.mo
Binary file not shown.
11 changes: 7 additions & 4 deletions docs/source/locale/uk/LC_MESSAGES/standard/document.po
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
# Zoriana Zaiats <sorenabell@quintagroup.com>, 2016.
msgid ""
msgstr ""
"Project-Id-Version: openprocurement.api 0.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-11-24 18:25+0200\n"
"PO-Revision-Date: 2016-01-27 15:59+0200\n"
"PO-Revision-Date: 2016-02-16 15:32+0200\n"
"Last-Translator: Zoriana Zaiats <sorenabell@quintagroup.com>\n"
"Language-Team: Ukrainian <info@quintagroup.com>\n"
"Language-Team: Ukrainian <support@quintagroup.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: uk\n"
"X-Generator: Poedit 1.8.5\n"
"X-Generator: Lokalize 1.5\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<"
"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#: ../../source/standard/document.rst:9
msgid "Document"
Expand Down Expand Up @@ -234,7 +237,7 @@ msgid ""
"to start implementation. This may be a link to a downloadable document, to "
"a web page, or to an official gazette in which the notice is contained."
msgstr ""
"Офіційне повідомлення, що містить деталі підписання доовору та початку його "
"Офіційне повідомлення, що містить деталі підписання договору та початку його "
"реалізації. Це може бути посилання на документ, веб-сторінку, чи на "
"офіційний бюлетень, де розміщено повідомлення."

Expand Down
Binary file modified docs/source/locale/uk/LC_MESSAGES/standard/lot.mo
Binary file not shown.
Binary file modified docs/source/locale/uk/LC_MESSAGES/standard/organization.mo
Binary file not shown.
14 changes: 9 additions & 5 deletions docs/source/locale/uk/LC_MESSAGES/standard/organization.po
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#
# Zoriana Zaiats <sorenabell@quintagroup.com>, 2016.
msgid ""
msgstr ""
"Project-Id-Version: openprocurement.api 0.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-11-24 18:25+0200\n"
"PO-Revision-Date: 2016-01-27 16:00+0200\n"
"PO-Revision-Date: 2016-02-16 15:46+0200\n"
"Last-Translator: Zoriana Zaiats <sorenabell@quintagroup.com>\n"
"Language-Team: Ukrainian <info@quintagroup.com>\n"
"Language-Team: Ukrainian <support@quintagroup.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: uk\n"
"X-Generator: Poedit 1.8.5\n"
"X-Generator: Lokalize 1.5\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<"
"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#: ../../source/standard/organization.rst:9
msgid "Organization"
Expand Down Expand Up @@ -101,7 +104,7 @@ msgstr "email"

#: ../../source/standard/organization.rst:157
msgid "url"
msgstr "url"
msgstr "URL-адреса"

#: ../../source/standard/organization.rst:29
msgid ":ref:`Address`, required"
Expand Down Expand Up @@ -129,7 +132,8 @@ msgid ""
msgstr ""
"Дозволеними є коди зі `спику кодів \"Organisation Registration Agency\" "
"Стандарту IATI <http://iatistandard.org/codelists/"
"OrganisationRegistrationAgency/>`_ з додаванням коду `UA-EDR` для організацій, "
"OrganisationRegistrationAgency/>`_ з додаванням коду `UA-EDR` для "
"організацій, "
"зареєстрованих в Україні (ЄДРПОУ та ІПН)."

#: ../../source/standard/organization.rst:17
Expand Down
Binary file modified docs/source/locale/uk/LC_MESSAGES/standard/tender.mo
Binary file not shown.
25 changes: 16 additions & 9 deletions docs/source/locale/uk/LC_MESSAGES/standard/tender.po
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#
# Zoriana Zaiats <sorenabell@quintagroup.com>, 2016.
msgid ""
msgstr ""
"Project-Id-Version: openprocurement.api 0.10\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-11-24 18:25+0200\n"
"PO-Revision-Date: 2016-01-27 16:01+0200\n"
"PO-Revision-Date: 2016-02-16 17:20+0200\n"
"Last-Translator: Zoriana Zaiats <sorenabell@quintagroup.com>\n"
"Language-Team: Ukrainian <info@quintagroup.com>\n"
"Language-Team: Ukrainian <support@quintagroup.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: uk\n"
"X-Generator: Poedit 1.8.5\n"
"X-Generator: Lokalize 1.5\n"
"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<"
"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"

#: ../../source/standard/tender.rst:8
msgid "Tender"
Expand All @@ -31,7 +34,7 @@ msgstr "періодичність закупівлі (щороку, щоква

#: ../../source/standard/tender.rst:20
msgid "item being procured"
msgstr "елемент, що закуповується"
msgstr "товар, що закуповується"

#: ../../source/standard/tender.rst:21
msgid "some other info"
Expand Down Expand Up @@ -71,7 +74,8 @@ msgid ""
"items wherever possible. Items should not be duplicated, but a quantity of 2 "
"specified instead."
msgstr ""
"|ocdsDescription| Товари та послуги, що будуть закуплені, поділені на спискові "
"|ocdsDescription| Товари та послуги, що будуть закуплені, поділені на "
"спискові "
"елементи, де це можливо. Елементи не повинні дублюватись, замість цього "
"вкажіть кількість 2."

Expand Down Expand Up @@ -139,7 +143,8 @@ msgstr "Період, коли проводиться аукціон."
msgid ""
"|ocdsDescription| The date or period on which an award is anticipated to be "
"made."
msgstr "|ocdsDescription| Дата або період, коли очікується визначення переможця."
msgstr ""
"|ocdsDescription| Дата або період, коли очікується визначення переможця."

#: ../../source/standard/tender.rst:163
msgid "Status of the Tender."
Expand Down Expand Up @@ -180,7 +185,8 @@ msgstr "Значення `amount` повинно бути меншим за `Ten
#: ../../source/standard/tender.rst:100
msgid "`currency` should either be absent or match `Tender.value.currency`"
msgstr ""
"Значення `currency` повинно бути або відсутнім, або співпадати з `Tender.value."
"Значення `currency` повинно бути або відсутнім, або співпадати з "
"`Tender.value."
"currency`"

#: ../../source/standard/tender.rst:101
Expand Down Expand Up @@ -237,7 +243,7 @@ msgstr "Кваліфікація переможця (кваліфікація)"

#: ../../source/standard/tender.rst:155
msgid "Standstill period (standstill)"
msgstr "Пропозиції розглянуто (розглянуто)"
msgstr "Період блокування (блокування)"

#: ../../source/standard/tender.rst:157
msgid "Unsuccessful tender (unsuccessful)"
Expand Down Expand Up @@ -297,7 +303,8 @@ msgstr ""
"учасників закупівлі, їхні пропозиції та інша кваліфікаційна документація."

#: ../../source/standard/tender.rst:122
msgid "Period when bids can be submitted. At least `endDate` has to be provided."
msgid ""
"Period when bids can be submitted. At least `endDate` has to be provided."
msgstr ""
"Період, коли подаються пропозиції. Повинна бути вказана хоча б `endDate` дата."

Expand Down
3 changes: 3 additions & 0 deletions openprocurement/tender/openua/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,9 @@ def next_check(self):
return min(checks).isoformat() if checks else None

def invalidate_bids_data(self):
if self.auctionPeriod and self.auctionPeriod.startDate:
self.auctionPeriod.startDate = None
[setattr(i.auctionPeriod, 'startDate', None) for i in self.lots if i.auctionPeriod and i.auctionPeriod.startDate]
for bid in self.bids:
if bid.status != "deleted":
bid.status = "invalid"
18 changes: 2 additions & 16 deletions openprocurement/tender/openua/tests/lot.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,20 +115,6 @@ def test_create_tender_lot_invalid(self):
self.assertEqual(lots[0]['minimalStep']['currency'], "UAH")
self.assertEqual(lots[0]['minimalStep']['amount'], 100)

response = self.app.post_json(request_path, {'data': {
'title': 'lot title',
'description': 'lot description',
'value': {'amount': '500.0'},
'minimalStep': {'amount': '100.0'},
'auctionPeriod': {'startDate': '2014-10-31T00:00:00', 'endDate': '2015-10-01T00:00:00'}
}}, status=422)
self.assertEqual(response.status, '422 Unprocessable Entity')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['status'], 'error')
self.assertEqual(response.json['errors'], [
{u'description': [u'period should begin after tenderPeriod'], u'location': u'body', u'name': u'auctionPeriod'}
])

response = self.app.patch_json('/tenders/{}'.format(self.tender_id), {"data": {"items": [{'relatedLot': '0' * 32}]}}, status=422)
self.assertEqual(response.status, '422 Unprocessable Entity')
self.assertEqual(response.content_type, 'application/json')
Expand Down Expand Up @@ -710,7 +696,7 @@ def test_create_tender_bidder_invalid(self):
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['status'], 'error')
self.assertEqual(response.json['errors'], [
{u'description': [u'This field is required.'], u'location': u'body', u'name': u'parameters'},
{u'description': [u'All features parameters is required.'], u'location': u'body', u'name': u'parameters'},
{u'description': [u'This field is required.'], u'location': u'body', u'name': u'lotValues'}
])

Expand Down Expand Up @@ -767,7 +753,7 @@ def test_create_tender_bidder_invalid(self):
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['status'], 'error')
self.assertEqual(response.json['errors'], [
{u'description': [u'This field is required.'], u'location': u'body', u'name': u'parameters'}
{u'description': [u'All features parameters is required.'], u'location': u'body', u'name': u'parameters'}
])

response = self.app.post_json(request_path, {'data': {'tenderers': [test_tender_ua_data["procuringEntity"]], 'lotValues': [{"value": {"amount": 500}, 'relatedLot': self.lot_id}], 'parameters': [{"code": "code_item", "value": 0.01}]}}, status=422)
Expand Down
13 changes: 1 addition & 12 deletions openprocurement/tender/openua/tests/tender.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,16 +395,6 @@ def test_create_tender_invalid(self):
# ])

now = get_now()
test_tender_ua_data['auctionPeriod'] = {'startDate': now.isoformat(), 'endDate': now.isoformat()}
response = self.app.post_json(request_path, {'data': test_tender_ua_data}, status=422)
del test_tender_ua_data['auctionPeriod']
self.assertEqual(response.status, '422 Unprocessable Entity')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['status'], 'error')
self.assertEqual(response.json['errors'], [
{u'description': [u'period should begin after tenderPeriod'], u'location': u'body', u'name': u'auctionPeriod'}
])

test_tender_ua_data['awardPeriod'] = {'startDate': now.isoformat(), 'endDate': now.isoformat()}
response = self.app.post_json(request_path, {'data': test_tender_ua_data}, status=422)
del test_tender_ua_data['awardPeriod']
Expand Down Expand Up @@ -867,11 +857,11 @@ def test_patch_tender_ua(self):
dateModified = tender.pop('dateModified')
self.tender_id = tender['id']
self.go_to_enquiryPeriod_end()

response = self.app.patch_json('/tenders/{}?acc_token={}'.format(tender['id'], owner_token), {'data': {"value": {
"amount": 501,
"currency": u"UAH"
}}}, status=403)

self.assertEqual(response.status, '403 Forbidden')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['errors'][0]["description"], "tenderPeriod should be extended by 7 days")
Expand All @@ -893,7 +883,6 @@ def test_patch_tender_ua(self):
self.assertEqual(response.json['data']['tenderPeriod']['endDate'], tenderPeriod_endDate.isoformat())
self.assertEqual(response.json['data']['enquiryPeriod']['endDate'], enquiryPeriod_endDate.isoformat())


def test_dateModified_tender(self):
response = self.app.get('/tenders')
self.assertEqual(response.status, '200 OK')
Expand Down
10 changes: 0 additions & 10 deletions openprocurement/tender/openua/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,5 @@ def validate_patch_tender_ua_data(request):
request.errors.add('body', 'item', 'Can\'t change enquiryPeriod')
request.errors.status = 403
return None
if 'tenderPeriod' in data:
data["auctionPeriod"] = {'startDate': None}
if len(request.context.lots) > 0:
lots = list(data['lots']) if 'lots' in data else []
data['lots'] = []
for index, lot in enumerate(request.context.lots):
lot_data = lots[index] if lots else {}

lot_data['auctionPeriod'] = {'startDate': None}
data['lots'].append(lot_data)

return validate_data(request, request.tender.__class__, True, data)
1 change: 0 additions & 1 deletion openprocurement/tender/openua/views/tender.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def patch(self):
return
self.request.validated['tender'].initialize()
self.request.validated['data']["enquiryPeriod"] = self.request.validated['tender'].enquiryPeriod.serialize()
self.request.validated['data']["auctionPeriod"] = {'startDate': None}

apply_patch(self.request, save=False, src=self.request.validated['tender_src'])
if self.request.authenticated_role == 'chronograph':
Expand Down

0 comments on commit 549fe03

Please sign in to comment.