-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into test-rook-MD-mergemain
- Loading branch information
Showing
14 changed files
with
385 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
request-management-api/migrations/versions/932d6dae5570_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""empty message | ||
Revision ID: 932d6dae5570 | ||
Revises: b4da31675bd0 | ||
Create Date: 2024-02-05 14:00:56.263099 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '932d6dae5570' | ||
down_revision = 'd42a1cf67c5c' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.execute('insert into public."DocumentTypes"(document_type_name, description) VALUES (\'redline_redaction_summary\', \'Word template for redline redaction summary pdf\');commit;') | ||
op.execute('insert into public."DocumentTypes"(document_type_name, description) VALUES (\'responsepackage_redaction_summary\', \'Word template for response package redaction summary pdf\');commit;') | ||
|
||
op.execute('insert into public."DocumentTemplates"(extension, document_type_id) VALUES (\'docx\', (select document_type_id from public."DocumentTypes" where document_type_name=\'redline_redaction_summary\'));commit;') | ||
op.execute('insert into public."DocumentTemplates"(extension, document_type_id) VALUES (\'docx\', (select document_type_id from public."DocumentTypes" where document_type_name=\'responsepackage_redaction_summary\'));commit;') | ||
|
||
def downgrade(): | ||
op.execute('delete from public."DocumentTypes" where document_type_name = \'redline_redaction_summary\'') | ||
op.execute('delete from public."DocumentTypes" where document_type_name = \'responsepackage_redaction_summary\'') | ||
|
||
op.execute('delete from public."DocumentTemplates" where document_type_id = (select document_type_id from public."DocumentTypes" where document_type_name=\'redline_redaction_summary\')') | ||
op.execute('delete from public."DocumentTemplates" where document_type_id = (select document_type_id from public."DocumentTypes" where document_type_name=\'responsepackage_redaction_summary\')') | ||
|
35 changes: 35 additions & 0 deletions
35
request-management-api/migrations/versions/d42a1cf67c5c_.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""empty message | ||
Revision ID: d42a1cf67c5c | ||
Revises: b4da31675bd0 | ||
Create Date: 2024-02-08 12:40:33.968711 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'd42a1cf67c5c' | ||
down_revision = 'b4da31675bd0' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.create_table('UnopenedReport', | ||
sa.Column('id', sa.Integer(), primary_key=True, autoincrement=True, nullable=False), | ||
sa.Column('rawrequestid', sa.Integer(), nullable=False), | ||
sa.Column('date', sa.DateTime(), nullable=True), | ||
sa.Column('rank', sa.Integer(), nullable=False), | ||
sa.Column('potentialmatches', postgresql.JSON(astext_type=sa.Text()), nullable=True) | ||
) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.execute('DROP TABLE IF EXISTS public."UnopenedReport";') | ||
|
||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
request-management-api/request_api/models/UnopenedReport.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from .db import db, ma | ||
from .default_method_result import DefaultMethodResult | ||
from sqlalchemy.orm import relationship,backref | ||
from datetime import datetime | ||
from sqlalchemy import text | ||
from sqlalchemy.dialects.postgresql import JSON | ||
import json | ||
|
||
class UnopenedReport(db.Model): | ||
__tablename__ = 'UnopenedReport' | ||
# Defining the columns | ||
id = db.Column(db.Integer, primary_key=True,autoincrement=True) | ||
rawrequestid = db.Column(db.Text, unique=False, nullable=False) | ||
date = db.Column(db.Text, unique=False, nullable=False) | ||
rank = db.Column(db.Text, unique=False, nullable=False) | ||
potentialmatches = db.Column(JSON, unique=False, nullable=False) | ||
|
||
@classmethod | ||
def insert(cls, row): | ||
db.session.add(row) | ||
db.session.commit() | ||
return DefaultMethodResult(True,'Report Row added',row.rawrequestid) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.