-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1009 from bcgov/dev-AS-FOIMOD-3073
FOIMOD-3073 - Fees - Remaining Balance Check
- Loading branch information
Showing
20 changed files
with
528 additions
and
114 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
"""empty message | ||
Revision ID: 9d45ce57481e | ||
Revises: 18a45d1b33cc | ||
Create Date: 2024-06-06 10:19:45.739225 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
from sqlalchemy.dialects import postgresql | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '9d45ce57481e' | ||
down_revision = '18a45d1b33cc' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table('PDFStitchJobAttributes', | ||
sa.Column('attributesid', sa.Integer(), autoincrement=True, nullable=False), | ||
sa.Column('pdfstitchjobid', sa.Integer(), primary_key=True, autoincrement=True, nullable=False), | ||
sa.Column('version', sa.Integer(), nullable=False), | ||
sa.Column('ministryrequestid', sa.Integer(), nullable=False), | ||
sa.Column('attributes', postgresql.JSON(astext_type=sa.Text()), nullable=False), | ||
sa.Column('createdat', sa.TIMESTAMP, nullable=False, server_default=sa.func.now()), | ||
sa.Column('createdby', sa.String(length=120), nullable=True), | ||
sa.PrimaryKeyConstraint('attributesid'), | ||
sa.ForeignKeyConstraint(['pdfstitchjobid', 'version'], ['PDFStitchJob.pdfstitchjobid', 'PDFStitchJob.version'], ) | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_table('PDFStitchJobAttributes') | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
from .db import db, ma | ||
from datetime import datetime as datetime2 | ||
from sqlalchemy.dialects.postgresql import JSON | ||
from sqlalchemy import func, and_ | ||
from .default_method_result import DefaultMethodResult | ||
from .DocumentDeleted import DocumentDeleted | ||
from .DocumentMaster import DocumentMaster | ||
import logging | ||
|
||
|
||
class PDFStitchJobAttributes(db.Model): | ||
__tablename__ = "PDFStitchJobAttributes" | ||
# Defining the columns | ||
attributesid = db.Column(db.Integer, primary_key=True, autoincrement=True) | ||
pdfstitchjobid = db.Column(db.Integer, db.ForeignKey("PDFStitchJob.pdfstitchjobid")) | ||
version = db.Column(db.Integer, db.ForeignKey("PDFStitchJob.version")) | ||
ministryrequestid = db.Column(db.Integer, nullable=False) | ||
attributes = db.Column(JSON, unique=False, nullable=False) | ||
createdat = db.Column(db.DateTime, default=datetime2.now, nullable=False) | ||
createdby = db.Column(db.String(120), nullable=False) | ||
|
||
|
||
@classmethod | ||
def insert(cls, row): | ||
try: | ||
db.session.add(row) | ||
db.session.commit() | ||
return DefaultMethodResult( | ||
True, | ||
"PDF Stitch Job Attributes recorded for ministryrequestid: {0}".format( | ||
row.ministryrequestid | ||
), | ||
row.pdfstitchjobid, | ||
) | ||
except Exception as ex: | ||
logging.error(ex) | ||
finally: | ||
db.session.close() | ||
|
||
@classmethod | ||
def getpdfstitchjobattributesbyid(cls, requestid): | ||
try: | ||
pdfstitchjobattributesschema = PDFStitchJobAttributesSchema(many=False) | ||
query = db.session.query(PDFStitchJobAttributes).filter( | ||
PDFStitchJobAttributes.ministryrequestid == requestid | ||
).first() | ||
return pdfstitchjobattributesschema.dump(query) | ||
except Exception as ex: | ||
logging.error(ex) | ||
finally: | ||
db.session.close() | ||
|
||
|
||
|
||
|
||
class PDFStitchJobAttributesSchema(ma.Schema): | ||
class Meta: | ||
fields = ( | ||
"attributesid", | ||
"pdfstitchjobid", | ||
"version", | ||
"ministryrequestid", | ||
"attributes", | ||
"createdat", | ||
"createdby", | ||
) |
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
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
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
3 changes: 2 additions & 1 deletion
3
computingservices/ZippingServices/models/redlineresponsenotificationmessage.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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
class redlineresponsenotificationmessage(object): | ||
def __init__(self, ministryrequestid, serviceid, errorflag, createdby) -> None: | ||
def __init__(self, ministryrequestid, serviceid, errorflag, createdby,feeoverridereason) -> None: | ||
self.ministryrequestid = ministryrequestid | ||
self.serviceid = serviceid | ||
self.errorflag = errorflag | ||
self.createdby = createdby | ||
self.feeoverridereason=feeoverridereason |
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.