Ejemplo n.º 1
0
 def all_bills_type_by_department_id(cls, department_id):
     # get all bill-types of particular department
     billtypes = Database.find(billTypeConstant.COLLECTION,
                               {'department_id': department_id})
     return billtypes
Ejemplo n.º 2
0
 def all(cls, department_id):
     # get all bill-types from department
     return [
         cls(**elem) for elem in Database.find(
             billTypeConstant.COLLECTION, {'department_id': department_id})
     ]
Ejemplo n.º 3
0
 def get_all(cls, company_id):
     # get all departments of the company
     departments = Database.find(departmentConstant.COLLECTION,
                                 {'company_id': company_id})
     return departments
Ejemplo n.º 4
0
 def all(cls, company_id):
     return [
         cls(**elem) for elem in Database.find(
             departmentConstant.COLLECTION, {"company_id": company_id})
     ]
Ejemplo n.º 5
0
 def all_bills_for_manager_filter(cls, manager_id, filter_type):
     return Database.find(billConstant.COLLECTION, {
         'manager_id': manager_id,
         'status': filter_type
     })
Ejemplo n.º 6
0
 def all_bills(cls, department_id, status):
     return Database.find(billConstant.COLLECTION, {
         'department_id': department_id,
         'status': status
     })
Ejemplo n.º 7
0
 def all_bills_for_employee_filter(cls, employee_id, filter_type):
     return Database.find(billConstant.COLLECTION, {
         'employee_id': employee_id,
         'status': filter_type
     })
Ejemplo n.º 8
0
 def all_bills_for_manager(cls, manager_id):
     return Database.find(billConstant.COLLECTION,
                          {'manager_id': manager_id})
Ejemplo n.º 9
0
 def get_by_id(cls, company_id):
     # given the company ID, it returns the employee details of that company
     return Database.find(employeeConstants.COLLECTION,{"company_id":company_id})
Ejemplo n.º 10
0
 def all_bills_for_employee(cls, employee_id):
     return Database.find(billConstant.COLLECTION,
                          {'employee_id': employee_id})
Ejemplo n.º 11
0
 def all(cls):
     # to get all employees
     return [cls(**elem) for elem in Database.find(employeeConstants.COLLECTION, {})]
Ejemplo n.º 12
0
 def get_by_department_id(cls, department_id):
     # to get employees of particular department
     return Database.find(employeeConstants.COLLECTION, {'department_id': department_id})
Ejemplo n.º 13
0
 def get_by_department_id(cls, department_id):
     # to get managers of particular department
     managers = Database.find(managerConstants.COLLECTION,
                              {'department_id': department_id})
     return managers
Ejemplo n.º 14
0
 def all(cls):
     # to get all managers
     return [
         cls(**elem)
         for elem in Database.find(managerConstants.COLLECTION, {})
     ]
Ejemplo n.º 15
0
 def get_by_id(cls, company_id):
     # given the company ID, it returns the manager details of that company
     return Database.find(managerConstants.COLLECTION,
                          {'company_id': company_id})