Check to make sure clins complete as part of checking if TO is complete

This commit is contained in:
leigh-mil
2019-07-29 15:50:50 -04:00
parent c5ec2c296f
commit 299804ade2
5 changed files with 30 additions and 1 deletions

View File

@@ -37,6 +37,19 @@ class CLIN(Base, mixins.TimestampsMixin):
JEDICLINType.JEDI_CLIN_3,
]
@property
def is_completed(self):
return all(
[
self.number,
self.start_date,
self.end_date,
self.obligated_amount,
self.jedi_clin_type,
len(self.loas),
]
)
def to_dictionary(self):
return {
c.name: getattr(self, c.name)

View File

@@ -92,9 +92,13 @@ class TaskOrder(Base, mixins.TimestampsMixin):
def has_ended(self):
return self.start_date is not None and Clock.today() >= self.end_date
@property
def clins_are_completed(self):
return all([len(self.clins), (clin.is_completed for clin in self.clins)])
@property
def is_completed(self):
return all([self.pdf, self.number, len(self.clins)])
return all([self.pdf, self.number, self.clins_are_completed])
@property
def is_signed(self):