Example #1
0
class EmployeeSalary(db.Document):
    _id = db.StringField(required=True)
    employeeSalary = db.FloatField(required=True)
    apprasialsOverTheYears = db.ListField(db.EmbeddedDocumentField(ApprasialsandAllowance), default=None)
    allowancesOverTheYears = db.ListField(db.EmbeddedDocumentField(ApprasialsandAllowance), default=None)
    employeePF = db.IntField(required=True)
    employeeAllowances = db.FloatField(required=True)
Example #2
0
class Teams(db.Document):
    _id = db.StringField(primary_key=True, default=generateUniqueId("T"))
    teamName = db.StringField(unique=True, required=True)
    teamLead = db.StringField(required=True)
    teamMembers = db.ListField(required=True, unique=True)
    projectsDone = db.ListField(required=True, unique=True)
    currentProject = db.StringField()

    meta = {
        "indexes": ["teamLead"]
    }
Example #3
0
class Projects(db.Document):
    _id = db.StringField(primary_key=True, default=generateUniqueId("P"))
    projectName = db.StringField(required=True, max_length=64)
    projectFrom = db.StringField(required=True)
    projectDeadLine = db.DateTimeField(required=True)
    startDate = db.DateTimeField(required=True)
    endDate = db.DateTimeField(default=None)
    doneBy = db.ListField(required=True, unique=True)
Example #4
0
class EmployeeWorkDetails(db.Document):
    _id = db.StringField(required=True)
    departmentId = db.StringField(required=True)
    position = db.ListField(unique=True)
    teamId = db.StringField(required=True)
    teamLeader = db.BooleanField(default=False)
    departmentHead = db.BooleanField(default=False)
    manager = db.BooleanField(default=False)
class EmployeeAttendance(db.Document):
    _id = db.StringField(required=True)
    employeeAttendance = db.ListField(
        db.EmbeddedDocumentField(AttendanceBluePrint))
    meta = {
        "indexes": [
            "employeeAttendance.year", "employeeAttendance.month",
            "employeeAttendance.week.weekNo"
        ]
    }
class EmployeePersonal(db.Document):
    _id = db.StringField(required=True)
    employeeDOB = db.DateTimeField(required=True)
    employeeMobileNo = db.ListField(required=True)
    employeeAddress = db.StringField(required=True, max_length=120)
    employeeJoindate = db.DateTimeField(required=True)

    meta = {
        "indexes": ["employeeJoindate"]
    }

    def calculateYears(self, born):
        today = date.today()
        return today.year - born.year - ((today.month, today.day) < (born.month, born.day))
class AttendanceBluePrint(db.EmbeddedDocument):
    year = db.StringField(required=True, default=getYears())
    month = db.StringField(required=True, default=getMonths())
    week = db.ListField(db.EmbeddedDocumentField(WeeklyUpdate), required=True)
class WeeklyUpdate(db.EmbeddedDocument):
    weekNo = db.StringField(required=True, default=getWeeks())
    weeklyAttendance = db.ListField(db.EmbeddedDocumentField(DaysOfTheWeek),
                                    required=True)
    meta = {"indexes": ["weekNo"]}
class EmployeeTeamDetails(db.Document):
    _id = db.StringField(required=True)
    teamsWorked = db.ListField(db.EmbeddedDocumentField(EmployeePastTeams),
                               default=None)
    projectsWorked = db.ListField()
    departmentHead = db.BooleanField(default=False)