Exemple #1
0
 def transform(self) -> Transaction:
     trans_dict = {
         camel_to_snake(k): v
         for k, v in self.__dict__.items()
         if not k.startswith('_')
     }
     trans_dict['stp_id'] = trans_dict.pop('clave', None)
     trans_dict['monto'] = round(trans_dict['monto'] * 100)
     transaction = Transaction(**trans_dict)
     transaction.speid_id = base62_uuid('SR')()
     transaction.fecha_operacion = datetime.strptime(
         str(transaction.fecha_operacion), '%Y%m%d'
     ).date()
     return transaction
Exemple #2
0
 def transform(self):
     transaction = Transaction(**self.to_dict())
     transaction.fecha_operacion = datetime.today()
     transaction.estado = Estado.submitted
     return transaction