class EmployeeDetails(db.Model, UserMixin): __tablename__ = 'PRD_EMPLOYEE_DETAILS' id = db.Column(db.Integer, primary_key=True) EMP_NAME = db.Column(db.Unicode(30)) LOGIN_USR_ID = db.Column(db.Unicode(50), unique=True, index=True) LOGIN_PASSWORD = db.Column(db.Unicode(120)) USR_LEVEL_ID = db.Column(db.Integer, db.ForeignKey('PRD_USER_LEVEL.USR_LEVEL_ID'), nullable=False) USR_STATUS_ID = db.Column(db.Integer, db.ForeignKey('PRD_USER_STATUS.USR_STATUS_ID'), nullable=False) CREATED_AT = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) CREATED_BY = db.Column(db.Unicode(20)) def __init__(self, EMP_NAME, LOGIN_USR_ID, LOGIN_PASSWORD, USR_LEVEL_ID, USR_STATUS_ID): self.EMP_NAME = EMP_NAME self.LOGIN_USR_ID = LOGIN_USR_ID self.LOGIN_PASSWORD = generate_password_hash(LOGIN_PASSWORD) self.USR_LEVEL_ID = USR_LEVEL_ID self.USR_STATUS_ID = USR_STATUS_ID def __repr__(self): return f"User Name: {self.EMP_NAME} and Email: {self.LOGIN_USR_ID} and User Level ID: {self.USR_LEVEL_ID} and UserStatus ID: {self.USR_STATUS_ID}"
class BusinessInfo(db.Model): __tablename__ = 'PRD_BUSINESS_INFO' BUSINESS_INFO_KEY = db.Column(db.Integer, primary_key=True) LOGIN_USR_ID = db.Column(db.Unicode(50), unique=True, index=True) REVIEW_TASK_ID = db.Column(db.Integer, db.ForeignKey('PRD_REVIEW_TASK.REVIEW_TASK_ID'), nullable=False) CREATED_AT = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) CREATED_BY = db.Column(db.Unicode(20)) def __init__(self, LOGIN_USR_ID, REVIEW_TASK_ID): self.LOGIN_USR_ID = LOGIN_USR_ID self.REVIEW_TASK_ID = REVIEW_TASK_ID def __repr__(self): return f"Business Info Id: {self.BUSINESS_INFO_KEY} and Logged In User: {self.LOGIN_USR_ID} and Review Task ID: {self.REVIEW_TASK_ID}"
class UserStatus(db.Model): __tablename__ = 'PRD_USER_STATUS' USR_STATUS_ID = db.Column(db.Integer, primary_key=True) USR_STATUS = db.Column(db.Unicode(20)) def __init__(self, USR_STATUS): self.USR_STATUS = USR_STATUS def __repr__(self): return f"User Status ID: {self.USR_STATUS_ID} and User Status is: {self.USR_STATUS}"
class UserLevel(db.Model): __tablename__ = 'PRD_USER_LEVEL' USR_LEVEL_ID = db.Column(db.Integer, primary_key=True) USR_LEVEL = db.Column(db.Unicode(20)) def __init__(self, USR_LEVEL): self.USR_LEVEL = USR_LEVEL def __repr__(self): return f"User Level ID: {self.USR_LEVEL_ID} and User Level is: {self.USR_LEVEL}"
class Frequency(db.Model): __tablename__ = 'PRD_FREQUENCY' FREQUENCY_ID = db.Column(db.Integer, primary_key=True) FREQUENCY_TYPE = db.Column(db.Unicode(20)) def __init__(self, FREQUENCY_TYPE): self.FREQUENCY_TYPE = FREQUENCY_TYPE def __repr__(self): return f"Frequency ID: {self.FREQUENCY_ID} Frequency Type is: {self.FREQUENCY_TYPE}"
class ReviewTask(db.Model): __tablename__ = 'PRD_REVIEW_TASK' REVIEW_TASK_ID = db.Column(db.Integer, primary_key=True) REVIEW_TASK = db.Column(db.Unicode(50)) def __init__(self, REVIEW_TASK): self.REVIEW_TASK = REVIEW_TASK def __repr__(self): return f"Review Task ID: {self.REVIEW_TASK_ID} and Review Task is: {self.REVIEW_TASK}"
class TestingType(db.Model): __tablename__ = 'PRD_TESTING_TYPE' TYPE_ID = db.Column(db.Integer, primary_key=True) TESTING_TYPE = db.Column(db.Unicode(50)) def __init__(self, TESTING_TYPE): self.TESTING_TYPE = TESTING_TYPE def __repr__(self): return f"Type ID: {self.TYPE_ID} and Testing Type is: {self.TESTING_TYPE}"
class ChecklistDetails(db.Model): __tablename__ = 'PRD_CHECKLIST_DETAILS' CHECKLIST_ID = db.Column(db.Integer, primary_key=True) CHECKLIST_NAME = db.Column(db.Unicode(50)) TYPE_ID = db.Column(db.Integer, db.ForeignKey('PRD_TESTING_TYPE.TYPE_ID'), nullable=False) def __init__(self, CHECKLIST_NAME, TYPE_ID): self.CHECKLIST_NAME = CHECKLIST_NAME self.TYPE_ID = TYPE_ID def __repr__(self): return f"Checklist Name: {self.CHECKLIST_NAME} and Type Id: {self.TYPE_ID}"