def _get_dms_auto_mappings()

in backend/bms_app/wave/services/waves.py [0:0]


    def _get_dms_auto_mappings(self):
        query = db.session.query(SourceDB)\
            .outerjoin(Config) \
            .with_entities(SourceDB, Config.is_configured) \
            .filter(SourceDB.wave_id == self.wave_id) \
            .filter(SourceDB.db_engine == SourceDBEngine.POSTGRES)

        mappings = [] 
        for source_db, is_configured in query:
            mapping = {
                'server': source_db.server,
                'db_id': source_db.id,
                'db_name': source_db.db_name,
                'is_deployable': source_db.is_deployable,
                'is_dms_auto_mapping': True,
                'db_engine': source_db.db_engine.value,
                'operation_type': None, # TODO: get last operation type
                'operation_status': '',
                'operation_id': None, # TODO: get last operation id
                'is_configured': is_configured if is_configured is not None else False,
            }
            mappings.append(mapping)
        
        return mappings