fields for the new task order

This commit is contained in:
dandds
2018-12-14 13:19:22 -05:00
parent 6d92755a7f
commit c5580733ba
7 changed files with 308 additions and 51 deletions

View File

@@ -173,3 +173,39 @@ FUNDING_TYPES = [
]
TASK_ORDER_SOURCES = [("MANUAL", "Manual"), ("EDA", "EDA")]
APP_MIGRATION = [
("on_premise", "Yes, migrating from an on-premise data center"),
("cloud", "Yes, migrating from another cloud provider "),
("none", "Not planning to migrate any applications "),
("not_sure", "Not Sure"),
]
PROJECT_COMPLEXITY = [
("storage", "Storage "),
("data_analytics", "Data Analytics "),
("conus", "CONUS Only Access "),
("oconus", "OCONUS Access "),
("tactical_edge", "Tactical Edge Access "),
("not_sure", "Not Sure "),
("other", "Other"),
]
DEV_TEAM = [
("government", "Government"),
("civilians", "Civilians"),
("military", "Military "),
("contractor", "Contractor "),
("other", "Other"),
]
TEAM_EXPERIENCE = [
("none", "No previous experience"),
("planned", "Researched or planned a cloud build or migration"),
("built_1", "Built or Migrated 1-2 applications"),
("built_3", "Built or Migrated 3-5 applications"),
(
"built_many",
"Built or migrated many applications, or consulted on several such projects",
),
]

View File

@@ -1,12 +1,96 @@
from wtforms.fields import StringField
from wtforms.fields import (
DateField,
IntegerField,
RadioField,
SelectField,
SelectMultipleField,
StringField,
TextAreaField,
)
from .forms import CacheableForm
from .data import (
SERVICE_BRANCHES,
APP_MIGRATION,
PROJECT_COMPLEXITY,
DEV_TEAM,
TEAM_EXPERIENCE,
)
class TaskOrderForm(CacheableForm):
clin_0001 = StringField("CLIN 0001")
clin_0003 = StringField("CLIN 0003")
clin_1001 = StringField("CLIN 1001")
clin_1003 = StringField("CLIN 1003")
clin_2001 = StringField("CLIN 2001")
clin_2003 = StringField("CLIN 2003")
scope = TextAreaField(
"Cloud Project Scope",
description="The name of your office or organization. You can add multiple applications to your portfolio. Your task orders are used to pay for these applications and their environments",
)
defense_component = SelectField(
"Department of Defense Component",
description="Your team's plan for using the cloud, such as migrating an existing application or creating a prototype.",
choices=SERVICE_BRANCHES,
)
app_migration = RadioField(
"App Migration",
description="Do you plan to migrate existing application(s) to the cloud?",
choices=APP_MIGRATION,
default="",
)
native_apps = RadioField(
"Native Apps",
description="Do you plan to develop application(s) natively in the cloud? ",
choices=[("yes", "Yes"), ("no", "No"), ("not_sure", "Not Sure")],
)
complexity = SelectMultipleField(
"Project Complexity",
description="Which of these describes how complex your team's use of the cloud will be? (Select all that apply.)",
choices=PROJECT_COMPLEXITY,
default="",
)
complexity_other = StringField("?")
dev_team = SelectMultipleField(
"Development Team",
description="Which people or teams will be completing the development work for your cloud applications?",
choices=DEV_TEAM,
default="",
)
dev_team_other = StringField("?")
team_experience = RadioField(
"Team Experience",
description="How much experience does your team have with development in the cloud?",
choices=TEAM_EXPERIENCE,
default="",
)
start_date = DateField(
"Period of Performance",
description="Select a start and end date for your Task Order to be active. Please note, this will likely be revised once your Task Order has been approved.",
)
end_date = DateField("Period of Performance")
clin_01 = IntegerField(
"CLIN 01 : Unclassified Cloud Offerings",
description="UNCLASSIFIED Infrastructure as a Service (IaaS) and Platform as a Service (PaaS) offerings. ",
)
clin_02 = IntegerField(
"CLIN 02: Classified Cloud Offerings",
description="CLASSIFIED Infrastructure as a Service (IaaS) and Platform as a Service (PaaS) offerings. ",
)
clin_03 = IntegerField(
"CLIN 03: Unclassified Cloud Support and Assistance",
description="UNCLASSIFIED technical guidance from the cloud service provider, including architecture, configuration of IaaS and PaaS, integration, troubleshooting assistance, and other services.",
)
clin_04 = IntegerField(
"CLIN 04: Classified Cloud Support and Assistance",
description="CLASSIFIED technical guidance from the cloud service provider, including architecture, configuration of IaaS and PaaS, integration, troubleshooting assistance, and other services.",
)
ko_first_name = StringField("First Name")
ko_last_name = StringField("Last Name")
ko_email = StringField("Email")
ko_dod_id = StringField("DOD ID")
cor_first_name = StringField("First Name")
cor_last_name = StringField("Last Name")
cor_email = StringField("Email")
cor_dod_id = StringField("DOD ID")
so_first_name = StringField("First Name")
so_last_name = StringField("Last Name")
so_email = StringField("Email")
so_dod_id = StringField("DOD ID")
number = StringField("Task Order Number")
loa = StringField("Line of Accounting (LOA)")

View File

@@ -1,4 +1,5 @@
from sqlalchemy import Column, Integer, String, ForeignKey, Date
from sqlalchemy.types import ARRAY
from sqlalchemy.orm import relationship
from atst.models import Base, types, mixins
@@ -8,14 +9,6 @@ class TaskOrder(Base, mixins.TimestampsMixin):
__tablename__ = "task_orders"
id = types.Id()
number = Column(String, unique=True)
clin_0001 = Column(Integer)
clin_0003 = Column(Integer)
clin_1001 = Column(Integer)
clin_1003 = Column(Integer)
clin_2001 = Column(Integer)
clin_2003 = Column(Integer)
expiration_date = Column(Date)
workspace_id = Column(ForeignKey("workspaces.id"))
workspace = relationship("Workspace")
@@ -23,23 +16,43 @@ class TaskOrder(Base, mixins.TimestampsMixin):
user_id = Column(ForeignKey("users.id"))
creator = relationship("User")
scope = Column(String) # Cloud Project Scope
defense_component = Column(String) # Department of Defense Component
app_migration = Column(String) # App Migration
native_apps = Column(String) # Native Apps
complexity = Column(ARRAY(String)) # Project Complexity
complexity_other = Column(String)
dev_team = Column(ARRAY(String)) # Development Team
dev_team_other = Column(String)
team_experience = Column(String) # Team Experience
start_date = Column(Date) # Period of Performance
end_date = Column(Date)
clin_01 = Column(Integer) # CLIN 01 : Unclassified Cloud Offerings
clin_02 = Column(Integer) # CLIN 02: Classified Cloud Offerings
clin_03 = Column(Integer) # CLIN 03: Unclassified Cloud Support and Assistance
clin_04 = Column(Integer) # CLIN 04: Classified Cloud Support and Assistance
ko_first_name = Column(String) # First Name
ko_last_name = Column(String) # Last Name
ko_email = Column(String) # Email
ko_dod_id = Column(String) # DOD ID
cor_first_name = Column(String) # First Name
cor_last_name = Column(String) # Last Name
cor_email = Column(String) # Email
cor_dod_id = Column(String) # DOD ID
so_first_name = Column(String) # First Name
so_last_name = Column(String) # Last Name
so_email = Column(String) # Email
so_dod_id = Column(String) # DOD ID
number = Column(String, unique=True) # Task Order Number
loa = Column(ARRAY(String)) # Line of Accounting (LOA)
@property
def budget(self):
return sum(
filter(
None,
[
self.clin_0001,
self.clin_0003,
self.clin_1001,
self.clin_1003,
self.clin_2001,
self.clin_2003,
],
)
filter(None, [self.clin_01, self.clin_02, self.clin_03, self.clin_04])
)
def __repr__(self):
return "<TaskOrder(number='{}', budget='{}', expiration_date='{}', id='{}')>".format(
self.number, self.budget, self.expiration_date, self.id
return "<TaskOrder(number='{}', budget='{}', end_date='{}', id='{}')>".format(
self.number, self.budget, self.end_date, self.id
)