Skip to content

Add promotion to api_tariff models

Administrator requested to merge feature/update-product-with-promotions into master

Related to: https://gitlab.com/coopdevs/pymasmovil/-/merge_requests/97

To apply this change, a new migration file must be migrated, and tariff modifications must be uploaded to the db:

python manage.py migrate
psql

Once inside the DB:

delete from api_tariffs where product_code in ('SE_SC_REC_MOBILE_T_UNL_10240', 'SE_SC_REC_MOBILE_T_UNL_23552');

And then, out again:

python manage.py importcsv --mappings='' --model='api.tariffs' --delimiter=',' api/fixtures/tariffs.csv

Fragment of new order-item with promotion:

"promotions": [
      {
        "OrderId": "8023H000000ZegGQAS",
        "ExternalIDXenaRC": "P00037",
        "ExternalIDXenaNRC": null,
        "Duracion_promocion": "999",
        "name": "Promocion 2GB",
        "id": "01t3H0000001uOVQAY"
      }
    ],
    "productName": "Tarifa CM LA MAGNIFICA 9",
    "productId": "01t3H000000t0YxQAI",
     ...
]
Edited by Administrator

Merge request reports

Loading