ciclos

commit bac27eb88f51100b15190c77e88d1f22f1c31735

Author: Pedro Lucas Porcellis <pedrolucasporcellis@gmail.com>

Add Configuration

 src/types/configuration.py | 18 ++++++++++++++++++


diff --git a/src/types/configuration.py b/src/types/configuration.py
new file mode 100644
index 0000000000000000000000000000000000000000..e345e3ea97327b011c31314f8eb57c56f3d2905e
--- /dev/null
+++ b/src/types/configuration.py
@@ -0,0 +1,18 @@
+from . import db
+from datetime import datetime as dt
+
+class Configuration(db.Model):
+  __tablename__ = "configurations"
+  id = db.Column(db.Integer, primary_key = True)
+  purchase_duration = db.Column(db.Float, nullable = False)
+  purchase_duration_type = db.Column(db.String(256), server_default = 'days')
+  delivery_duration = db.Column(db.Float, nullable = False)
+  delivery_duration_type = db.Column(db.String(256), server_default = 'days')
+  created_at = db.Column(db.DateTime, default = dt.now)
+  updated_at = db.Column(db.DateTime, default = dt.now)
+
+  def __init__(self, purchase_duration, purchase_duration_type, delivery_duration, delivery_duration_type):
+    self.purchase_duration = purchase_duration
+    self.purchase_duration_type = purchase_duration_type
+    self.delivery_duration = delivery_duration
+    self.delivery_duration_type = delivery_duration_type