2016-02-12 14:03:00 +00:00
|
|
|
# coding=utf-8
|
2016-02-12 13:02:37 +00:00
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from django.db import models
|
|
|
|
|
2016-02-12 14:03:00 +00:00
|
|
|
|
|
|
|
class Order(models.Model):
|
2016-02-12 16:08:41 +00:00
|
|
|
# TODO: Revoir les max_length et null (difficile d'affirmer une limite précise avec le XML)
|
2016-02-14 16:27:22 +00:00
|
|
|
# TODO: Faire des sous-modèles pour gérer de plus d'informations venant du XML comme les adresses,
|
|
|
|
# le tracking ou le panier
|
2016-02-12 14:03:00 +00:00
|
|
|
marketplace = models.CharField(max_length=10)
|
|
|
|
idFlux = models.IntegerField()
|
2016-02-14 15:55:16 +00:00
|
|
|
order_id = models.CharField(max_length=20, primary_key=True)
|
2016-02-12 16:08:41 +00:00
|
|
|
order_mrid = models.CharField(max_length=20)
|
|
|
|
order_refid = models.CharField(max_length=20)
|
2016-02-14 20:40:28 +00:00
|
|
|
order_external_id = models.CharField(max_length=20, null=True, blank=True)
|
2016-02-12 14:03:00 +00:00
|
|
|
# Colonne unique pour le order_purchase_date et order_purchase_heure because DateTime
|
2016-02-14 20:40:28 +00:00
|
|
|
order_purchase = models.DateTimeField(null=True, blank=True)
|
2016-02-12 14:03:00 +00:00
|
|
|
order_amount = models.FloatField()
|
2016-02-14 20:40:28 +00:00
|
|
|
order_tax = models.FloatField(null=True, blank=True)
|
2016-02-12 14:03:00 +00:00
|
|
|
order_shipping = models.FloatField()
|
|
|
|
order_commission = models.FloatField()
|
|
|
|
order_processing_fee = models.FloatField()
|
2016-02-14 20:40:28 +00:00
|
|
|
order_comments = models.TextField(null=True, blank=True)
|
|
|
|
customer_id = models.CharField(max_length=20, null=True, blank=True)
|
|
|
|
order_ip = models.GenericIPAddressField(null=True, blank=True)
|
2016-02-12 14:03:00 +00:00
|
|
|
order_items = models.IntegerField()
|