Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/a184446326538140_questions_dateA…
Browse files Browse the repository at this point in the history
…nswered'
  • Loading branch information
kroman0 committed Oct 5, 2016
2 parents 5d64dff + 28de2a3 commit 8da9ffc
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 97 deletions.
Binary file modified docs/source/locale/uk/LC_MESSAGES/acceleration.mo
Binary file not shown.
Binary file modified docs/source/locale/uk/LC_MESSAGES/authentication.mo
Binary file not shown.
Binary file modified docs/source/locale/uk/LC_MESSAGES/errors.mo
Binary file not shown.
Binary file modified docs/source/locale/uk/LC_MESSAGES/standard/bid.mo
Binary file not shown.
42 changes: 2 additions & 40 deletions docs/source/locale/uk/LC_MESSAGES/standard/bid.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ msgid ""
msgstr ""
"Project-Id-Version: openprocurement.api 0.3\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-21 15:42+0300\n"
"PO-Revision-Date: 2016-09-21 16:20+0200\n"
"POT-Creation-Date: 2016-10-05 09:58+0300\n"
"PO-Revision-Date: 2016-10-05 10:43+0200\n"
"Last-Translator: Zoriana Zaiats <sorenabell@quintagroup.com>\n"
"Language-Team: Ukrainian <info@quintagroup.com>\n"
"MIME-Version: 1.0\n"
Expand All @@ -16,140 +16,102 @@ msgstr ""
"=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
"X-Generator: Lokalize 2.0\n"

#: ../../source/standard/bid.rst:8
msgid "Bid"
msgstr "Bid"

#: ../../source/standard/bid.rst:11 ../../source/standard/bid.rst:59
#: ../../source/standard/bid.rst:77
msgid "Schema"
msgstr "Схема"

#: ../../source/standard/bid.rst:14
msgid "List of :ref:`Organization` objects"
msgstr "Список об’єктів :ref:`Organization` "

#: ../../source/standard/bid.rst:17 ../../source/standard/bid.rst:94
msgid "string, :ref:`date`, auto-generated"
msgstr "рядок, :ref:`date`, генерується автоматично"

#: ../../source/standard/bid.rst:20
msgid "uid, auto-generated"
msgstr "uid, генерується автоматично"

#: ../../source/standard/bid.rst:23 ../../source/standard/bid.rst:89
msgid "string"
msgstr "рядок"

#: ../../source/standard/bid.rst:25
msgid "Possible values are:"
msgstr "Можливі значення:"

#: ../../source/standard/bid.rst:27
msgid "`draft`"
msgstr "`draft`"

#: ../../source/standard/bid.rst:28
msgid "`active`"
msgstr "`active`"

#: ../../source/standard/bid.rst:31 ../../source/standard/bid.rst:80
msgid ":ref:`Value`, required"
msgstr ":ref:`Value`, обов’язково"

#: ../../source/standard/bid.rst:33 ../../source/standard/bid.rst:82
msgid "Validation rules:"
msgstr "Правила валідації:"

#: ../../source/standard/bid.rst:35
msgid "`amount` should be less than `Tender.value.amout`"
msgstr "Значення `amount` повинно бути меншим за `Tender.value.amout`"

#: ../../source/standard/bid.rst:36
msgid "`currency` should either be absent or match `Tender.value.currency`"
msgstr ""
"Значення `currency` повинно бути або відсутнім, або співпадати з "
"`Tender.value.currency`"

#: ../../source/standard/bid.rst:37
msgid ""
"`valueAddedTaxIncluded` should either be absent or match "
"`Tender.value.valueAddedTaxIncluded`"
msgstr ""
"Значення `valueAddedTaxIncluded` повинно бути або відсутнім, або "
"співпадати з `Tender.value.valueAddedTaxIncluded`"

#: ../../source/standard/bid.rst:40
msgid "List of :ref:`Document` objects"
msgstr "Список об’єктів :ref:`Document`"

#: ../../source/standard/bid.rst:43
msgid "List of :ref:`Parameter` objects"
msgstr "Список об’єктів :ref:`Parameter`"

#: ../../source/standard/bid.rst:46
msgid "List of :ref:`LotValue` objects"
msgstr "Список об’єктів :ref:`LotValue`"

#: ../../source/standard/bid.rst:49 ../../source/standard/bid.rst:97
msgid "url"
msgstr "URL-адреса"

#: ../../source/standard/bid.rst:51 ../../source/standard/bid.rst:99
msgid "A web address for participation in auction."
msgstr "Веб-адреса для участі в аукціоні."

#: ../../source/standard/bid.rst:56
msgid "Parameter"
msgstr "Parameter"

#: ../../source/standard/bid.rst:62
msgid "string, required"
msgstr "рядок, обов’язковий"

#: ../../source/standard/bid.rst:64
msgid "Code of the feature."
msgstr "Код критерію."

#: ../../source/standard/bid.rst:67
msgid "float, required"
msgstr "float, обов’язково"

#: ../../source/standard/bid.rst:69
msgid "Value of the feature."
msgstr "Значення критерію."

#: ../../source/standard/bid.rst:74
msgid "LotValue"
msgstr "LotValue"

#: ../../source/standard/bid.rst:84
msgid "`amount` should be less than `Lot.value.amout`"
msgstr "`amount` повинно бути меншим, ніж `Lot.value.amount`"

#: ../../source/standard/bid.rst:85
msgid "`currency` should either be absent or match `Lot.value.currency`"
msgstr ""
"`currency` повинно або бути відсутнім, або відповідати "
"`Lot.value.currency`"

#: ../../source/standard/bid.rst:86
msgid ""
"`valueAddedTaxIncluded` should either be absent or match "
"`Lot.value.valueAddedTaxIncluded`"
msgstr ""
"`valueAddedTaxIncluded` повинно або бути відсутнім, або відповідати "
"`Lot.value.valueAddedTaxIncluded`"

#: ../../source/standard/bid.rst:91
msgid "Id of related :ref:`lot`."
msgstr "ID пов’язаного :ref:`lot`."

#: ../../source/standard/bid.rst:27
msgid "`draft`"
msgstr "`draft` - чернетка"

#: ../../source/standard/bid.rst:28
msgid "`active`"
msgstr "`active` - активна ставка"

Binary file modified docs/source/locale/uk/LC_MESSAGES/standard/contract.mo
Binary file not shown.
Binary file modified docs/source/locale/uk/LC_MESSAGES/standard/document.mo
Binary file not shown.
Binary file modified docs/source/locale/uk/LC_MESSAGES/standard/item.mo
Binary file not shown.
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/question.mo
Binary file not shown.
54 changes: 20 additions & 34 deletions docs/source/locale/uk/LC_MESSAGES/standard/question.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,88 +3,74 @@ 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-03-09 15:02+0200\n"
"POT-Creation-Date: 2016-10-05 10:42+0300\n"
"PO-Revision-Date: 2016-10-05 10:43+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"
"Generated-By: Babel 2.3.4\n"
"Language: uk\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"
"X-Generator: Lokalize 2.0\n"

#: ../../source/standard/question.rst:7
msgid "Question"
msgstr "Question"

#: ../../source/standard/question.rst:10
msgid "Schema"
msgstr "Схема"

#: ../../source/standard/question.rst:21
msgid "string, required"
msgstr "рядок, обов’язковий"

#: ../../source/standard/question.rst:26 ../../source/standard/question.rst:36
#: ../../source/standard/question.rst:41 ../../source/standard/question.rst:50
msgid "string"
msgstr "рядок"
msgid "uid, auto-generated"
msgstr "uid, генерується автоматично"

#: ../../source/standard/question.rst:16
msgid ":ref:`Organization`, required"
msgstr ":ref:`Organization`, обов’язково"

#: ../../source/standard/question.rst:18
msgid ""
"Who is asking a question (contactPoint - person, identification - "
"organization that person represents)."
msgstr ""
"Хто задає питання (contactPoint - людина, identification - організація, яку "
"ця людина представляє)."
"Хто задає питання (contactPoint - людина, identification - організація, "
"яку ця людина представляє)."

msgid "string, required"
msgstr "рядок, обов’язковий"

#: ../../source/standard/question.rst:23
msgid "Title of the question."
msgstr "Назва запитання."

#: ../../source/standard/question.rst:28
msgid "string"
msgstr "рядок"

msgid "Description of the question."
msgstr "Опис запитання."

#: ../../source/standard/question.rst:33
msgid "string, :ref:`date`, auto-generated"
msgstr "рядок, :ref:`date`, генерується автоматично"

msgid "Date of posting."
msgstr "Дата публікації."

#: ../../source/standard/question.rst:38
msgid "Date when answer has been provided."
msgstr "Дата, коли було надано відповідь."

msgid "Answer for the question asked."
msgstr "Відповідь на задане питання."

#: ../../source/standard/question.rst:43
msgid "Possible values are:"
msgstr "Можливі значення:"

#: ../../source/standard/question.rst:45
msgid "`tender`"
msgstr "`tender`"

#: ../../source/standard/question.rst:46
msgid "`item`"
msgstr "`item`"

#: ../../source/standard/question.rst:47
msgid "`lot`"
msgstr "`lot`"

#: ../../source/standard/question.rst:52
msgid "Id of related :ref:`lot` or :ref:`item`."
msgstr "ID пов’язаних :ref:`lot` або :ref:`item`."

#: ../../source/standard/question.rst:13
msgid "uid, auto-generated"
msgstr "uid, генерується автоматично"

#: ../../source/standard/question.rst:31
msgid "string, :ref:`date`, auto-generated"
msgstr "рядок, :ref:`date`, генерується автоматично"

Binary file modified docs/source/locale/uk/LC_MESSAGES/standard/tender.mo
Binary file not shown.
Binary file modified docs/source/locale/uk/LC_MESSAGES/tutorial.mo
Binary file not shown.
29 changes: 6 additions & 23 deletions docs/source/locale/uk/LC_MESSAGES/tutorial.po
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#
# Zoriana Zaiats <sorenabell@quintagroup.com>, 2016.
msgid ""
msgstr ""
"Project-Id-Version: openprocurement.api 0.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-21 15:42+0300\n"
"PO-Revision-Date: 2016-09-21 16:20+0200\n"
"POT-Creation-Date: 2016-10-05 09:58+0300\n"
"PO-Revision-Date: 2016-10-05 10:44+0200\n"
"Last-Translator: Zoriana Zaiats <sorenabell@quintagroup.com>\n"
"Language-Team: Ukrainian <info@quintagroup.com>\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -269,11 +270,11 @@ msgstr ""

#: ../../source/tutorial.rst:190
msgid "Bidder can register a bid in `draft` status:"
msgstr "Учасник може зареєструвати ставку у статусі `draft` (чернетка):"
msgstr "Учасник може зареєструвати пропозицію у статусі `draft` (чернетка):"

#: ../../source/tutorial.rst:195
msgid "And activate a bid:"
msgstr "І активувати пропозицію:"
msgstr "Та активувати пропозицію:"

#: ../../source/tutorial.rst:200
msgid "And upload proposal document:"
Expand Down Expand Up @@ -420,7 +421,7 @@ msgstr "Тепер переглянемо знову усі документи

#: ../../source/tutorial.rst:302
msgid "Set contract signature date"
msgstr "Встановити дату підписання договору"
msgstr "Встановити дату підписання угоди"

#: ../../source/tutorial.rst:304
msgid ""
Expand Down Expand Up @@ -510,22 +511,4 @@ msgstr "Завантаження нової версії документа"
msgid "Activating the request and cancelling tender"
msgstr "Активація запиту та скасування закупівлі"

#: ../../source/tutorial.rst:190
msgid "Bidder can register a bid in `draft` status:"
msgstr "Учасник може зареєструвати ставку у статусі `draft` (чернетка):"

#: ../../source/tutorial.rst:195
msgid "And activate a bid:"
msgstr "І активувати ставку:"

#: ../../source/tutorial.rst:302
msgid "Set contract signature date"
msgstr "Встановити дату підписання договору"

#: ../../source/tutorial.rst:304
msgid ""
"There is a possibility to set custom contract signature date. If the date is"
" not set it will be generated on contract registration."
msgstr ""
"Є можливість встановити дату підписання договору. Якщо дата не"
" встановлена, то вона буде згенерована під час реєстрації договору."
5 changes: 5 additions & 0 deletions docs/source/standard/question.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ Schema

Date of posting.

:dateAnswered:
string, :ref:`date`, auto-generated

Date when answer has been provided.

:answer:
string

Expand Down
1 change: 1 addition & 0 deletions src/openprocurement/api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ class Options:
answer = StringType() # only tender owner can post answer
questionOf = StringType(required=True, choices=['tender', 'item', 'lot'], default='tender')
relatedItem = StringType(min_length=1)
dateAnswered = IsoDateTimeType()

def validate_relatedItem(self, data, relatedItem):
if not relatedItem and data.get('questionOf') in ['item', 'lot']:
Expand Down
4 changes: 4 additions & 0 deletions src/openprocurement/api/tests/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ def test_patch_tender_question(self):
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']["answer"], "answer")
self.assertIn('dateAnswered', response.json['data'])

response = self.app.patch_json('/tenders/{}/questions/some_id'.format(self.tender_id), {"data": {"answer": "answer"}}, status=404)
self.assertEqual(response.status, '404 Not Found')
Expand All @@ -195,6 +196,7 @@ def test_patch_tender_question(self):
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']["answer"], "answer")
self.assertIn('dateAnswered', response.json['data'])

self.set_status('active.tendering')

Expand Down Expand Up @@ -346,11 +348,13 @@ def test_patch_tender_question(self):
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']["answer"], "answer")
self.assertIn('dateAnswered', response.json['data'])

response = self.app.get('/tenders/{}/questions/{}'.format(self.tender_id, question['id']))
self.assertEqual(response.status, '200 OK')
self.assertEqual(response.content_type, 'application/json')
self.assertEqual(response.json['data']["answer"], "answer")
self.assertIn('dateAnswered', response.json['data'])


def suite():
Expand Down
1 change: 1 addition & 0 deletions src/openprocurement/api/views/question.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ def patch(self):
self.request.errors.add('body', 'data', 'Can update question only in active lot status')
self.request.errors.status = 403
return
self.context.dateAnswered = get_now()
if apply_patch(self.request, src=self.request.context.serialize()):
self.LOGGER.info('Updated tender question {}'.format(self.request.context.id),
extra=context_unpack(self.request, {'MESSAGE_ID': 'tender_question_patch'}))
Expand Down

0 comments on commit 8da9ffc

Please sign in to comment.