File size: 1,173 Bytes
ef1ad9e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from typing import Any

from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from sqlalchemy.orm import declarative_base

from app.models.base import Base
from app.utils.utility import to_dict


class IncomeAnalyticUpdation(Base):
    __tablename__ = "IncomeAnalyticUpdation"

    incomeAnalyticUpdationId = Column(Integer, primary_key=True)  # Primary key
    userProfileId = Column(Integer, ForeignKey("UserProfiles.userProfileId"))  # Foreign key to UserProfiles
    userId = Column(Integer, ForeignKey("Users.userId"))  # Foreign key to Users
    userEmploymentAndIncomeId = Column(
        Integer, ForeignKey("UserEmploymentAndIncomes.userEmploymentAndIncomeId")
    )  # Foreign key to UserEmploymentAndIncomes

    baseIncome = Column(Integer)
    baseIncomeCalculation = Column(String)
    OTIncome = Column(Integer)
    OTIncomeCalculation = Column(String)
    bonusIncome = Column(Integer)
    bonusIncomeCalculation = Column(String)
    otherIncome = Column(Integer)
    otherIncomeCalculation = Column(String)

    isNewUpdate = Column(Boolean)

    def dict(self) -> dict[str, Any]:
        return to_dict(self)