new_contents: # -*- coding: utf-8 -*-
  # Generated by Django 1.11.20 on 2019-04-09 20:13
  from __future__ import absolute_import
  from __future__ import unicode_literals
  
  from decimal import Decimal
  
  from django.db import migrations
  
  from corehq.apps.sms.models import INCOMING, OUTGOING
  from corehq.apps.smsbillables.models import SmsGatewayFee
  from corehq.messaging.smsbackends.sislog.models import SQLSislogBackend
  
  
  def update_sislog_vodacom_mozambique_fees(apps, schema_editor):
      mzn, _ = apps.get_model('accounting', 'Currency').objects.get_or_create(code='MZN')
      sms_gateway_fee_class = apps.get_model('smsbillables', 'SmsGatewayFee')
      sms_gateway_fee_criteria_class = apps.get_model('smsbillables', 'SmsGatewayFeeCriteria')
  
      country_code = 258
      for prefix in ['84', '85']:
          SmsGatewayFee.create_new(
              SQLSislogBackend.get_api_id(),
              INCOMING,
              Decimal('2.0'),
              country_code=country_code,
              prefix=prefix,
              currency=mzn,
              fee_class=sms_gateway_fee_class,
              criteria_class=sms_gateway_fee_criteria_class,
          )
  
          SmsGatewayFee.create_new(
              SQLSislogBackend.get_api_id(),
              OUTGOING,
              Decimal('0.35'),
              country_code=country_code,
              prefix=prefix,
              currency=mzn,
              fee_class=sms_gateway_fee_class,
              criteria_class=sms_gateway_fee_criteria_class,
          )
  
  
  class Migration(migrations.Migration):
  
      dependencies = [
          ('smsbillables', '0019_deactivate_hardcoded_twilio_gateway_fees'),
      ]
  
      operations = [
          migrations.RunPython(update_sislog_vodacom_mozambique_fees),
      ]
  
subject: update SISLOG Mozambique Vodacom gateway fees