mirror of
https://github.com/GSA/notifications-api.git
synced 2026-04-02 08:30:50 -04:00
Merge pull request #357 from GSA/notify-api-141
notify-api-141 add agreement to models.py
This commit is contained in:
6
Pipfile
6
Pipfile
@@ -10,14 +10,14 @@ arrow = "==1.2.3"
|
||||
asn1crypto = "==1.5.1"
|
||||
async-timeout = "==4.0.2"
|
||||
attrs = "==21.4.0"
|
||||
awscli = "~=1.24"
|
||||
awscli = "==1.29.15"
|
||||
bcrypt = "==3.2.2"
|
||||
beautifulsoup4 = "==4.12.2"
|
||||
billiard = "==3.6.4.0"
|
||||
bleach = "==4.1.0"
|
||||
blinker = "~=1.4"
|
||||
boto3 = "~=1.23"
|
||||
botocore = "~=1.26"
|
||||
boto3 = "==1.28.15"
|
||||
botocore = "==1.31.15"
|
||||
cachetools = "==5.1.0"
|
||||
celery = {version = "==5.2.7", extras = ["redis"]}
|
||||
certifi = ">=2022.12.7"
|
||||
|
||||
40
Pipfile.lock
generated
40
Pipfile.lock
generated
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "3ac420f9a597b613f634b150e444d1d1c590f82f53ad6798ba222821c7a48d43"
|
||||
"sha256": "771698f3584d862a08000cd130212c7e5144ecdc61ad56ef1a77a47bd62ed049"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
@@ -66,11 +66,11 @@
|
||||
},
|
||||
"awscli": {
|
||||
"hashes": [
|
||||
"sha256:9e13f8d0a56329910de76abfbb00bdeb07e7011e5cfaa269a9b76dc4387468bb",
|
||||
"sha256:ae1c248265d3baedecc33cd6295a4aaf1bbb32137669f7766390c7b7023223cb"
|
||||
"sha256:87747ef7af86d3c929510fcc5e22559662b77b81891af9efc4a5d5ff4b0fd9f3",
|
||||
"sha256:d2ce17d09886340aedcde9cbbf58f23a237b255adb62f89d7dae68a09f7a238e"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.29.18"
|
||||
"version": "==1.29.15"
|
||||
},
|
||||
"bcrypt": {
|
||||
"hashes": [
|
||||
@@ -123,19 +123,19 @@
|
||||
},
|
||||
"boto3": {
|
||||
"hashes": [
|
||||
"sha256:87ecac82d2a68430c0292b7946512c8b1f01ea6971b43dc5832582fcb176c0dd",
|
||||
"sha256:f2ec3e6f173fe8d141d512ea7d90138db5a58af130773e26ce8e72bdbfd2cddc"
|
||||
"sha256:84b7952858e9319968b0348d9894a91a6bb5f31e81a45c68044d040a12362abe",
|
||||
"sha256:a6e711e0b6960c3a5b789bd30c5a18eea7263f2a59fc07f85efa5e04804e49d2"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.28.18"
|
||||
"version": "==1.28.15"
|
||||
},
|
||||
"botocore": {
|
||||
"hashes": [
|
||||
"sha256:909db57f5d6ca765fc9dc9dcae962a87566d0123da1d2bd5be32432493d5785e",
|
||||
"sha256:c4c01fae2ba32c242ce62175cad719aa49415618560d6e215ed76dab91991dc5"
|
||||
"sha256:b3a0f787f275711875476cbe12a0123b2e6570b2f505e2fa509dcec3c5410b57",
|
||||
"sha256:b46d1ce4e0cf42d28fdf61ce0c999904645d38b51cb809817a361c0cec16d487"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.31.18"
|
||||
"version": "==1.31.15"
|
||||
},
|
||||
"cachetools": {
|
||||
"hashes": [
|
||||
@@ -870,7 +870,7 @@
|
||||
"sha256:04505ade687dc26dc4284b1ad19a83be2f2afe83e7a828ace0c72f3a1df72aac",
|
||||
"sha256:9dffbe1d8acf91e3de75f3b544e4842382fc06c6babe903ac9acb74dc6e08d88"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"markers": "python_full_version >= '3.7.0'",
|
||||
"version": "==3.0.39"
|
||||
},
|
||||
"psycopg2-binary": {
|
||||
@@ -1114,7 +1114,7 @@
|
||||
"sha256:78f9a9bf4e7be0c5ded4583326e7461e3a3c5aae24073648b4bdfa797d78c9d2",
|
||||
"sha256:9d689e6ca1b3038bc82bf8d23e944b6b6037bc02301a574935b2dd946e0353b9"
|
||||
],
|
||||
"markers": "python_version < '4.0' and python_full_version >= '3.5.0'",
|
||||
"markers": "python_version >= '3.5' and python_version < '4'",
|
||||
"version": "==4.7.2"
|
||||
},
|
||||
"s3transfer": {
|
||||
@@ -1519,19 +1519,19 @@
|
||||
},
|
||||
"boto3": {
|
||||
"hashes": [
|
||||
"sha256:87ecac82d2a68430c0292b7946512c8b1f01ea6971b43dc5832582fcb176c0dd",
|
||||
"sha256:f2ec3e6f173fe8d141d512ea7d90138db5a58af130773e26ce8e72bdbfd2cddc"
|
||||
"sha256:84b7952858e9319968b0348d9894a91a6bb5f31e81a45c68044d040a12362abe",
|
||||
"sha256:a6e711e0b6960c3a5b789bd30c5a18eea7263f2a59fc07f85efa5e04804e49d2"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.28.18"
|
||||
"version": "==1.28.15"
|
||||
},
|
||||
"botocore": {
|
||||
"hashes": [
|
||||
"sha256:909db57f5d6ca765fc9dc9dcae962a87566d0123da1d2bd5be32432493d5785e",
|
||||
"sha256:c4c01fae2ba32c242ce62175cad719aa49415618560d6e215ed76dab91991dc5"
|
||||
"sha256:b3a0f787f275711875476cbe12a0123b2e6570b2f505e2fa509dcec3c5410b57",
|
||||
"sha256:b46d1ce4e0cf42d28fdf61ce0c999904645d38b51cb809817a361c0cec16d487"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==1.31.18"
|
||||
"version": "==1.31.15"
|
||||
},
|
||||
"cachecontrol": {
|
||||
"extras": [
|
||||
@@ -2229,7 +2229,7 @@
|
||||
"sha256:4659bc2a667783e7a15d190f6fccf8b2486685b6dba4c19c3876314769c57526",
|
||||
"sha256:b4fa3a7a0be38243123cf9d1f3518da10c51bdb165a2b2985566247f9155a7d3"
|
||||
],
|
||||
"markers": "python_version >= '3.6'",
|
||||
"markers": "python_full_version >= '3.6.0'",
|
||||
"version": "==32.0.1"
|
||||
},
|
||||
"pluggy": {
|
||||
@@ -2442,7 +2442,7 @@
|
||||
"sha256:146a90b3b6b47cac4a73c12866a499e9817426423f57c5a66949c086191a8808",
|
||||
"sha256:fb9d6c0a0f643c99eed3875b5377a184132ba9be4d61516a55273d3554d75a39"
|
||||
],
|
||||
"markers": "python_version >= '3.7'",
|
||||
"markers": "python_full_version >= '3.7.0'",
|
||||
"version": "==13.5.2"
|
||||
},
|
||||
"s3transfer": {
|
||||
|
||||
@@ -1977,3 +1977,33 @@ class WebauthnCredential(db.Model):
|
||||
'created_at': self.created_at.strftime(DATETIME_FORMAT),
|
||||
'updated_at': get_dt_string_or_none(self.updated_at),
|
||||
}
|
||||
|
||||
|
||||
class Agreement(db.Model):
|
||||
__tablename__ = "agreements"
|
||||
id = db.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4, unique=False)
|
||||
type = db.Column(db.String(3), nullable=False, unique=True, index=True)
|
||||
partner_name = db.Column(db.String(255), nullable=False, unique=True, index=True)
|
||||
status = db.Column(db.String(255), nullable=False, unique=True, index=True)
|
||||
start_time = db.Column(db.DateTime, nullable=True)
|
||||
end_time = db.Column(db.DateTime, nullable=True)
|
||||
url = db.Column(db.String(255), nullable=False, unique=True, index=True)
|
||||
budget_amount = db.Column(db.Float, nullable=True)
|
||||
organization_id = db.Column(
|
||||
UUID(as_uuid=True),
|
||||
db.ForeignKey('organization.id'),
|
||||
nullable=True,
|
||||
)
|
||||
|
||||
def serialize(self):
|
||||
return {
|
||||
"id": str(self.id),
|
||||
"type": self.type,
|
||||
"partner_name": self.partner_name,
|
||||
"status": self.status,
|
||||
"start_time": self.start_time.strftime(DATETIME_FORMAT),
|
||||
"end_time": self.end_time.strftime(DATETIME_FORMAT),
|
||||
"budget_amount": self.budget_amount,
|
||||
"organization_id": self.organization_id
|
||||
|
||||
}
|
||||
|
||||
37
migrations/versions/0398_agreements_table.py
Normal file
37
migrations/versions/0398_agreements_table.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0010_events_table
|
||||
Revises: 0009_created_by_for_jobs
|
||||
Create Date: 2016-04-26 13:08:42.892813
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0398_agreements_table'
|
||||
down_revision = '0397_rename_organisation_2'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import postgresql
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('agreements',
|
||||
sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.Column('type', sa.String(length=3), nullable=False),
|
||||
sa.Column('partner_name', sa.String(length=255), nullable=False),
|
||||
sa.Column('status', sa.String(length=255), nullable=False),
|
||||
sa.Column('start_time', sa.DateTime(), nullable=False),
|
||||
sa.Column('end_time', sa.DateTime(), nullable=False),
|
||||
sa.Column('url', sa.String(length=255), nullable=False),
|
||||
sa.Column('budget_amount', sa.Float(), nullable=False),
|
||||
sa.Column('organization_id', postgresql.UUID(as_uuid=True), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('agreements')
|
||||
### end Alembic commands ###
|
||||
Reference in New Issue
Block a user