Skip to content

Commit

Permalink
Merge pull request #5443 from bcgov/main
Browse files Browse the repository at this point in the history
merge bug fix from main to dev
  • Loading branch information
nkan-aot2 authored Nov 18, 2024
2 parents 3aeec6b + 44593f0 commit 9098052
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions request-management-api/request_api/models/HistoricalRecords.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from flask.app import Flask
from sqlalchemy.sql.schema import ForeignKey, ForeignKeyConstraint
from .db import db, ma
from datetime import datetime
from sqlalchemy.orm import relationship,backref
from .default_method_result import DefaultMethodResult
from sqlalchemy.sql.expression import distinct
from sqlalchemy import or_,and_,text

class HistoricalRecords(db.Model):
# Name of the table in our database
__tablename__ = 'HistoricalRecords'

# Defining the columns
historicalrecordid = db.Column(db.Integer, primary_key=True,autoincrement=True)
recordfilename = db.Column(db.String(500), unique=False, nullable=False)
description = db.Column(db.String(500), unique=False, nullable=True)
axisrequestid = db.Column(db.String(120), unique=False, nullable=False)
s3uripath = db.Column(db.Text, unique=False, nullable=False)
attributes = db.Column(db.Text, unique=False, nullable=True)
iscorresponcedocument = db.Column(db.Boolean, unique=False, nullable=False)
displayfilename = db.Column(db.String(500), unique=False, nullable=True)

created_at = db.Column(db.DateTime, default=datetime.now)
createdby = db.Column(db.String(120), unique=False, nullable=True)

@classmethod
def getdocuments(cls,axisrequestid):
comment_schema = HistoricalRecordschema(many=True)
query = db.session.query(HistoricalRecords).filter_by(axisrequestid=axisrequestid).order_by(HistoricalRecords.attributes.desc(), HistoricalRecords.historicalrecordid.asc()).all()
return comment_schema.dump(query)



class HistoricalRecordschema(ma.Schema):
class Meta:
fields = ('historicalrecordid', 'recordfilename', 'description', 'axisrequestid', 's3uripath', 'attributes', 'iscorresponcedocument', 'displayfilename', 'created_at', 'createdby')

2 changes: 1 addition & 1 deletion request-management-api/request_api/utils/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class MinistryTeamWithKeycloackGroup(Enum):
ECC = "ECC Ministry Team"
JED = "JED Ministry Team"
COR = "COR Ministry Team"
HSG = "HSG Ministry Team",
HSG = "HSG Ministry Team"
LSB = "LSB Ministry Team"

@staticmethod
Expand Down

0 comments on commit 9098052

Please sign in to comment.