def serialize_as_explanation(self, transaction_url, project_url):
        attachment = Attachment(self.filename)

        result = {
            'bank_transaction_explanation': {
                'bank_transaction': transaction_url,
                'description': self.description,
                'category': self.guessed_category,
                'gross_value': str(0 - self.amount),  # Required
                'project': project_url,
                'dated_on': self.date.isoformat(),
                'rebill_type': None,
                'attachment': attachment.serialize(),
            }
        }
        # LOG.info(json.dumps(result, indent=4))

        return result
    def serialize_as_expense(self, user_url, project_url):
        attachment = Attachment(self.filename)

        result = {
            'expense': {
                'user': user_url,  # Required
                'category': self.guessed_category,
                'gross_value': str(0 - self.amount),  # Required
                'currency': 'GBP',
                'description': self.description,  # Required
                'dated_on': self.date.isoformat(),  # Required
                'manual_sales_tax_amount': '0.00',
                'project': project_url,
                'rebill_type': None,
                'attachment': attachment.serialize(),
            }
        }
        return result