136 Commits

Author SHA1 Message Date
leigh-mil
17864cc060 Add migration to change environment_roles role column from string to
enum type.
Fix tests and functions affected by the column type change.
2020-01-14 13:12:29 -05:00
leigh-mil
da398bf1ff Add status labels to portfolio managers table.
Update PortfolioRole.display_status() to return same type of data as
ApplicationRole.display_status().
2020-01-10 10:25:55 -05:00
graham-dds
aabedbcac4 Make PoP start and end dates inclusive.
Also removes the clock class.

Makes PoP date ranges inclusive such that a task order with:
-  a start date on or after the current date
and
- an end date on or before the current date
should be considered valid.

This commit also removes the Clock class. This class had two methods as
shortcuts for common uses of pendlum functions. But it wasn't being used
in very many places, and it took up about the same space as

    from pendulum import today()
    ...
    today(tz="UTC").date()

If we want to add this back in, it might be a good idea to extend it for
other time functions we have sprinkled around, like the random date
functions in our tests
2020-01-06 12:29:59 -05:00
leigh-mil
614514d6a2 Update tables to match business logic 2019-12-02 14:46:11 -05:00
graham-dds
7a0dc4d264 Add properties to portfolio model
1. Funding duration

Returns a tuple of the earliest period of performance start date and
latest period of performance end date for all active task order in a  portfolio.

2. Days to funding expiration
Returns the numbei of days between today and the lastest
period performance end date of all active task orders

3. Active task orders
Returns a list of a portfolio's active task orders a
2019-11-25 13:12:35 -05:00
leigh-mil
8aa302357b Move label display logic into the Label macro 2019-11-20 12:09:46 -05:00
leigh-mil
58a0b2dd9d Move display status logic to be a property of an ApplicationRole 2019-11-20 12:08:41 -05:00
leigh-mil
e5f83d2456 Update relationship between Environment and EnvironmentRole so only environment roles that are not deleted are included 2019-11-07 11:53:37 -05:00
leigh-mil
e64900245d Remove baseline_info column from environments table 2019-10-30 14:46:33 -04:00
graham-dds
a1c672d89f Conditionally skip tests related to audit log 2019-10-21 11:36:53 -04:00
richard-dds
96c1fcbe85
Merge branch 'master' into revert-user-deletion 2019-10-15 17:06:06 -04:00
leigh-mil
91ce3dda9e Disable the App Role when revoking an invite. 2019-10-15 14:25:21 -04:00
richard-dds
1bce0a1f01 Revert user deletion job 2019-10-14 16:51:19 -04:00
richard-dds
79c8e4fc63
Merge pull request #1062 from dod-ccpo/env-provisioning-task
Environment provisioning background jobs
2019-09-16 09:58:18 -04:00
graham-dds
2af0a2ecaf Update existing tests for new CLIN logic
- Factory adds total_amount field, which is always greater than obligated
field
- add total_amount field on tests that create TOs manually
- update tests that calculate total_contract_amount and
total_obligated_amount
2019-09-12 16:11:12 -04:00
richard-dds
365a50efce Add Environments.provisioning_status 2019-09-11 11:43:10 -04:00
richard-dds
f6cb6f2a31 Change Environment.creator relation from ApplicationRole to User 2019-09-11 11:42:59 -04:00
graham-dds
41bbbe8a39 add a sorted_clins property for clin sorting logic
CLINS have a special ordering:
 - First, they are sorted by the last three digits
 - Then, they are sorted by the first digit

Trying to add CLIN sorting logic to the relationship field in the task
order proved to be more challenging than expected. So, a separate
property was defined in order to access the clins in sorted order.
2019-09-04 12:35:56 -04:00
graham-dds
38ba8b7e5f LOAs are so out of this codebase 2019-08-30 09:57:23 -05:00
leigh-mil
96a2520e0c Don't use domain methods in tests 2019-08-19 10:39:16 -04:00
leigh-mil
2776926dea Move custom audit log logic into the User class 2019-08-19 10:25:26 -04:00
leigh-mil
0d6f7aa3cc Do not create AuditEvent if updating the User.last_login 2019-08-16 16:41:58 -04:00
dandds
9fc6514d80 Clean up defunct upload and CRL logic.
- Applies our previous CSP namespacing pattern to the upload classes.
- Removes code and config for previous uploader implementation.
- Removes Attachment model's ability to upload files directly and
  adjusts tests that expected that behavior.
2019-08-08 13:20:27 -04:00
leigh-mil
299804ade2 Check to make sure clins complete as part of checking if TO is complete 2019-07-29 15:50:50 -04:00
George Drummond
0f0a559dfa
TO Review Page 2019-06-12 09:43:00 -04:00
richard-dds
48d4b466b1 Formatting 2019-06-10 15:16:26 -04:00
richard-dds
c4d02bb026 Remove unused imports 2019-06-10 15:16:26 -04:00
richard-dds
e84e61bbad Update seed script with TOs of various statuses 2019-06-10 15:15:39 -04:00
richard-dds
0f4d17a94a Implemen TaskOrder.is_completed 2019-06-10 15:15:39 -04:00
richard-dds
8ecf112c48 Implement new CLIN-based TO statuses 2019-06-10 15:15:08 -04:00
richard-dds
7b8ccbf145 Implement TO start_date and end_date 2019-06-10 15:15:08 -04:00
dandds
c90e574e83
Merge pull request #869 from dod-ccpo/filter-app-environment-roles
Filter out deleted application environment roles
2019-06-05 10:50:06 -04:00
Montana
f462c3bd5e Add unit tests 2019-06-05 09:40:33 -04:00
dandds
82e048387e Filter out deleted application environment roles 2019-06-05 09:34:55 -04:00
dandds
c085db23d7 New invitation backend for portfolio invitations.
Portfolio invitations do not associate a user entity until the
invitation has been accepted. User info, including DOD ID, is held on
the invitation itself. When a user accepts and invitation, their user
entry is associated with the corresponding `portfolio_role` entry.

The same change will be applied to `application_role` and application
invitations. For now, small changes have been made to
application-related methods so that that flow works as-is.
2019-06-03 15:57:49 -04:00
leigh-mil
7bec073f78 Delete things related to deleted columns and table 2019-05-31 13:07:03 -04:00
dandds
df06d1b62f Use application_role_id on environment_roles.
In the future, an `application_invitation1 will not refer to a `user` until
someone accepts the invitation; they'll only reference an
`application_role`. When a user is invited to an application, the
inviter can specify the environments the invitee should have access to.
For this to be possible, an `environment_role` should reference an
`application_role`, because no `user` entity will be known at that time.

In addition to updating all the models and domain methods necessary for
this change, this commit deletes unused code and tests that were
dependent on `environment_roles` having a `user_id` foreign key.
2019-05-31 11:21:20 -04:00
dandds
96ae1bba9d
Merge pull request #845 from dod-ccpo/app-settings-role-id
Use role ID for app settings table
2019-05-28 11:43:56 -04:00
dandds
129f5e3031 Rewrite function that builds form data for app environment roles form.
- Adds a property to ApplicationRole model so that it knows its related
  EnvironmentRole models.
- Rewrite the form data builder in the routes file so that it loops the
  application members and their environment roles to build the data
  structure.
2019-05-24 13:34:53 -04:00
leigh-mil
8980b04f7e Filter the roles relationship on applications to remove deleted roles 2019-05-23 11:07:54 -04:00
dandds
c4ad7b4378 Make portfolio invitation specific to portfolio
- add a base domain class
- extract shared model code to mixin
- rename invitation classes
- invitation model relationship to portfolio_role name is now more
  generic "role"
2019-04-30 14:41:55 -04:00
Montana
94e3dc637a Remove has_member function from application model 2019-04-30 10:27:15 -04:00
Montana
1222220452 Do not add member to application when adding to environment 2019-04-29 15:05:59 -04:00
Montana
19a09b792e Use user.id to check if user is in application 2019-04-29 13:38:17 -04:00
Montana
fec4687c02 Check for member in application function, not user function 2019-04-29 11:06:37 -04:00
Montana
6822680bc8 Ensure that a member is an application member before adding the user to an environment 2019-04-29 11:06:37 -04:00
Montana
c9deaeec72 Add is_app_member() to user model 2019-04-29 11:06:37 -04:00
leigh-mil
c085f27af8 Update env roles by environment 2019-04-25 10:47:39 -04:00
dandds
0bde431a70 extend soft delete functionality to app and env roles 2019-04-15 15:58:38 -04:00
dandds
0348af7ce7 record soft deletion in audit log for applications and environments 2019-04-15 15:58:38 -04:00