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)
|
|
|
|
# TODO: Pas de PRIMARY KEY, du coup, le sync fera des doublons
|
2016-02-12 14:03:00 +00:00
|
|
|
marketplace = models.CharField(max_length=10)
|
|
|
|
idFlux = models.IntegerField()
|
2016-02-12 16:08:41 +00:00
|
|
|
order_id = models.CharField(max_length=20)
|
|
|
|
order_mrid = models.CharField(max_length=20)
|
|
|
|
order_refid = models.CharField(max_length=20)
|
|
|
|
order_external_id = models.CharField(max_length=20, null=True)
|
2016-02-12 14:03:00 +00:00
|
|
|
# Colonne unique pour le order_purchase_date et order_purchase_heure because DateTime
|
2016-02-12 16:08:41 +00:00
|
|
|
order_purchase = models.DateTimeField(null=True)
|
2016-02-12 14:03:00 +00:00
|
|
|
order_amount = models.FloatField()
|
2016-02-12 16:08:41 +00:00
|
|
|
order_tax = models.FloatField(null=True)
|
2016-02-12 14:03:00 +00:00
|
|
|
order_shipping = models.FloatField()
|
|
|
|
order_commission = models.FloatField()
|
|
|
|
order_processing_fee = models.FloatField()
|
2016-02-12 16:08:41 +00:00
|
|
|
order_comments = models.TextField(null=True)
|
|
|
|
customer_id = models.CharField(max_length=20, null=True)
|
|
|
|
order_ip = models.GenericIPAddressField(null=True)
|
2016-02-12 14:03:00 +00:00
|
|
|
order_items = models.IntegerField()
|