add expiration_date to manual task order form
This commit is contained in:
parent
f984c95060
commit
a2e8caf23b
@ -0,0 +1,28 @@
|
|||||||
|
"""add expiration date to task order
|
||||||
|
|
||||||
|
Revision ID: 4f4defb7b440
|
||||||
|
Revises: 2572be7fb7fc
|
||||||
|
Create Date: 2018-09-17 15:22:33.240310
|
||||||
|
|
||||||
|
"""
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '4f4defb7b440'
|
||||||
|
down_revision = '2572be7fb7fc'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.add_column('task_order', sa.Column('expiration_date', sa.Date(), nullable=True))
|
||||||
|
# ### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
# ### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_column('task_order', 'expiration_date')
|
||||||
|
# ### end Alembic commands ###
|
@ -1,5 +1,6 @@
|
|||||||
import re
|
import re
|
||||||
from wtforms.fields.html5 import EmailField
|
import pendulum
|
||||||
|
from wtforms.fields.html5 import DateField, EmailField
|
||||||
from wtforms.fields import StringField, FileField
|
from wtforms.fields import StringField, FileField
|
||||||
from wtforms.validators import InputRequired, Required, Email, Regexp
|
from wtforms.validators import InputRequired, Required, Email, Regexp
|
||||||
from flask_wtf.file import FileAllowed
|
from flask_wtf.file import FileAllowed
|
||||||
@ -11,6 +12,7 @@ from atst.domain.task_orders import TaskOrders
|
|||||||
from .fields import NewlineListField, SelectField
|
from .fields import NewlineListField, SelectField
|
||||||
from .forms import ValidatedForm
|
from .forms import ValidatedForm
|
||||||
from .data import FUNDING_TYPES
|
from .data import FUNDING_TYPES
|
||||||
|
from .validators import DateRange
|
||||||
|
|
||||||
|
|
||||||
PE_REGEX = re.compile(
|
PE_REGEX = re.compile(
|
||||||
@ -166,6 +168,20 @@ class ExtendedFinancialForm(BaseFinancialForm):
|
|||||||
|
|
||||||
funding_type_other = StringField("If other, please specify")
|
funding_type_other = StringField("If other, please specify")
|
||||||
|
|
||||||
|
expiration_date = DateField(
|
||||||
|
"Task Order Expiration Date",
|
||||||
|
description="Please enter the expiration date for the Task Order",
|
||||||
|
validators=[
|
||||||
|
Required(),
|
||||||
|
DateRange(
|
||||||
|
lower_bound=pendulum.duration(days=0),
|
||||||
|
upper_bound=pendulum.duration(years=100),
|
||||||
|
message="Must be a date in the future.",
|
||||||
|
),
|
||||||
|
],
|
||||||
|
format="%m/%d/%Y",
|
||||||
|
)
|
||||||
|
|
||||||
clin_0001 = StringField(
|
clin_0001 = StringField(
|
||||||
"<dl><dt>CLIN 0001</dt> - <dd>Unclassified IaaS and PaaS Amount</dd></dl>",
|
"<dl><dt>CLIN 0001</dt> - <dd>Unclassified IaaS and PaaS Amount</dd></dl>",
|
||||||
validators=[InputRequired()],
|
validators=[InputRequired()],
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
from sqlalchemy import Column, Integer, String, ForeignKey, Enum as SQLAEnum
|
from sqlalchemy import Column, Integer, String, ForeignKey, Enum as SQLAEnum, Date
|
||||||
from sqlalchemy.orm import relationship
|
from sqlalchemy.orm import relationship
|
||||||
|
|
||||||
from atst.models import Base
|
from atst.models import Base
|
||||||
@ -32,6 +32,7 @@ class TaskOrder(Base):
|
|||||||
clin_1003 = Column(Integer)
|
clin_1003 = Column(Integer)
|
||||||
clin_2001 = Column(Integer)
|
clin_2001 = Column(Integer)
|
||||||
clin_2003 = Column(Integer)
|
clin_2003 = Column(Integer)
|
||||||
|
expiration_date = Column(Date())
|
||||||
|
|
||||||
attachment_id = Column(ForeignKey("attachments.id"))
|
attachment_id = Column(ForeignKey("attachments.id"))
|
||||||
pdf = relationship("Attachment")
|
pdf = relationship("Attachment")
|
||||||
|
@ -146,5 +146,6 @@ def view_request_details(request_id=None):
|
|||||||
"requests/details.html",
|
"requests/details.html",
|
||||||
data=data,
|
data=data,
|
||||||
request=request,
|
request=request,
|
||||||
|
financial_review=financial_review,
|
||||||
requires_fv_action=requires_fv_action,
|
requires_fv_action=requires_fv_action,
|
||||||
)
|
)
|
||||||
|
@ -155,6 +155,8 @@
|
|||||||
{{ DefinitionReviewField("If other, please specify", "task_order", "funding_type_other") }}
|
{{ DefinitionReviewField("If other, please specify", "task_order", "funding_type_other") }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{{ DefinitionReviewField("Task Order Expiration Date", "task_order", "expiration_date") }}
|
||||||
|
|
||||||
{{ DefinitionReviewField("<dl><dt>CLIN 0001</dt> - <dd>Unclassified IaaS and PaaS Amount</dd></dl>", "task_order", "clin_0001", filter="dollars") }}
|
{{ DefinitionReviewField("<dl><dt>CLIN 0001</dt> - <dd>Unclassified IaaS and PaaS Amount</dd></dl>", "task_order", "clin_0001", filter="dollars") }}
|
||||||
|
|
||||||
{{ DefinitionReviewField("<dl><dt>CLIN 0003</dt> - <dd>Unclassified Cloud Support Package</dd></dl>", "task_order", "clin_0003", filter="dollars") }}
|
{{ DefinitionReviewField("<dl><dt>CLIN 0003</dt> - <dd>Unclassified Cloud Support Package</dd></dl>", "task_order", "clin_0003", filter="dollars") }}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
{% from "components/alert.html" import Alert %}
|
{% from "components/alert.html" import Alert %}
|
||||||
{% from "components/text_input.html" import TextInput %}
|
{% from "components/text_input.html" import TextInput %}
|
||||||
{% from "components/options_input.html" import OptionsInput %}
|
{% from "components/options_input.html" import OptionsInput %}
|
||||||
|
{% from "components/date_input.html" import DateInput %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
@ -72,6 +73,8 @@
|
|||||||
{{ TextInput(f.funding_type_other) }}
|
{{ TextInput(f.funding_type_other) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
{{ DateInput(f.expiration_date, placeholder='MM / DD / YYYY', validation='date', tooltip='Please enter the expiration date for the task order only and do not include options that you may choose to exercise in the future.') }}
|
||||||
|
|
||||||
{{ TextInput(
|
{{ TextInput(
|
||||||
f.clin_0001,
|
f.clin_0001,
|
||||||
validation='dollars'
|
validation='dollars'
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
|
import datetime
|
||||||
import pytest
|
import pytest
|
||||||
import alembic.config
|
import alembic.config
|
||||||
import alembic.command
|
import alembic.command
|
||||||
@ -124,6 +125,7 @@ def extended_financial_verification_data(pdf_upload):
|
|||||||
return {
|
return {
|
||||||
"funding_type": "RDTE",
|
"funding_type": "RDTE",
|
||||||
"funding_type_other": "other",
|
"funding_type_other": "other",
|
||||||
|
"expiration_date": "1/1/{}".format(datetime.date.today().year + 1),
|
||||||
"clin_0001": "50000",
|
"clin_0001": "50000",
|
||||||
"clin_0003": "13000",
|
"clin_0003": "13000",
|
||||||
"clin_1001": "30000",
|
"clin_1001": "30000",
|
||||||
|
@ -170,6 +170,11 @@ class TaskOrderFactory(Base):
|
|||||||
funding_type = FundingType.PROC
|
funding_type = FundingType.PROC
|
||||||
funding_type_other = None
|
funding_type_other = None
|
||||||
number = "toABC123"
|
number = "toABC123"
|
||||||
|
expiration_date = factory.LazyFunction(
|
||||||
|
lambda: datetime.date(
|
||||||
|
datetime.date.today().year + random.randrange(1, 15), 1, 1
|
||||||
|
)
|
||||||
|
)
|
||||||
clin_0001 = random.randrange(100, 100000)
|
clin_0001 = random.randrange(100, 100000)
|
||||||
clin_0003 = random.randrange(100, 100000)
|
clin_0003 = random.randrange(100, 100000)
|
||||||
clin_1001 = random.randrange(100, 100000)
|
clin_1001 = random.randrange(100, 100000)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user