Skip to content

Commit

Permalink
Added stopping and stopped for tender complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
kroman0 committed Mar 29, 2016
1 parent 8450f8c commit 06c4099
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions docs/source/complaints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,20 @@ Tender Conditions Claims/Complaints
}
subgraph cluster_complaint {
label = "complaint";
pending; satisfied; accepted;
pending; satisfied; accepted; stopping;
}
claim -> answered;
satisfied -> resolved;
edge[style=dashed];
answered -> {pending,resolved};
draft -> {claim,pending};
claim -> pending;
{accepted,draft,claim,answered,pending} -> cancelled;
{draft,claim,answered,pending} -> cancelled;
accepted -> stopping;
edge[style=bold];
pending -> {accepted,invalid};
accepted -> {declined,satisfied};
accepted -> {declined,satisfied,stopped};
stopping -> stopped;
edge[label="auction" style=dotted];
answered -> {declined,resolved,invalid};
}
Expand Down
2 changes: 1 addition & 1 deletion openprocurement/tender/openua/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ class Options:
'embedded': (blacklist('owner_token', 'owner') + schematics_embedded_role),
'view': (blacklist('owner_token', 'owner') + schematics_default_role),
}
status = StringType(choices=['draft', 'claim', 'answered', 'pending', 'accepted', 'invalid', 'resolved', 'declined', 'cancelled', 'satisfied'], default='draft')
status = StringType(choices=['draft', 'claim', 'answered', 'pending', 'accepted', 'invalid', 'resolved', 'declined', 'cancelled', 'satisfied', 'stopping', 'stopped'], default='draft')
acceptance = BooleanType()
dateAccepted = IsoDateTimeType()
rejectReason = StringType(choices=['lawNonСompliance', 'noPaymentReceived', 'buyerViolationsСorrected'])
Expand Down
8 changes: 7 additions & 1 deletion openprocurement/tender/openua/views/complaint.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ def patch(self):
return
data = self.request.validated['data']
# complaint_owner
if self.request.authenticated_role == 'complaint_owner' and self.context.status in ['draft', 'claim', 'answered', 'pending', 'accepted'] and data.get('status', self.context.status) == 'cancelled':
if self.request.authenticated_role == 'complaint_owner' and self.context.status in ['draft', 'claim', 'answered', 'pending'] and data.get('status', self.context.status) == 'cancelled':
apply_patch(self.request, save=False, src=self.context.serialize())
self.context.dateCanceled = get_now()
elif self.request.authenticated_role == 'complaint_owner' and self.context.status == 'accepted' and data.get('status', self.context.status) == 'stopping':
apply_patch(self.request, save=False, src=self.context.serialize())
self.context.dateCanceled = get_now()
elif self.request.authenticated_role == 'complaint_owner' and tender.status == 'active.tendering' and self.context.status == 'draft' and data.get('status', self.context.status) == self.context.status:
Expand Down Expand Up @@ -157,6 +160,9 @@ def patch(self):
elif self.request.authenticated_role == 'aboveThresholdReviewers' and self.context.status == 'accepted' and data.get('status', self.context.status) in ['declined', 'satisfied']:
apply_patch(self.request, save=False, src=self.context.serialize())
self.context.dateDecision = get_now()
elif self.request.authenticated_role == 'aboveThresholdReviewers' and self.context.status in ['accepted', 'stopping'] and data.get('status', self.context.status) == 'stopped':
apply_patch(self.request, save=False, src=self.context.serialize())
self.context.dateCanceled = get_now()
else:
self.request.errors.add('body', 'data', 'Can\'t update complaint')
self.request.errors.status = 403
Expand Down

0 comments on commit 06c4099

Please sign in to comment.