itplanning/tests/assets/filldb.py

53 lines
1.7 KiB
Python
Raw Normal View History

2021-06-21 20:32:43 +00:00
from pony.orm import db_session
from ITPlanning import db
class filldatabase:
@staticmethod
2021-06-21 20:32:43 +00:00
@db_session
def create_Customer():
return db.Customer(
first_name="john",
last_name="DOE",
email="john@doe.fr",
localisation="batiment 1",
mobile_number="0602020020",
phone_number="0321323432",
)
@staticmethod
2021-06-21 20:32:43 +00:00
@db_session
def create_service_category():
return db.Service_category(
name="install",
duration=45,
free_order=False,
description="test Service_category",
)
@staticmethod
2021-06-21 20:32:43 +00:00
@db_session
def create_service():
service_category = filldatabase.create_service_category()
return db.Service(
name="install", max_appointement=1, service_category=service_category
)
@staticmethod
2021-06-21 20:32:43 +00:00
@db_session
def create_planning():
return db.Planning(
name="refresh1",
working_plan='{"monday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:k20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"tuesday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"wednesday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"thursday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]},"friday":{"start":"09:00","end":"18:00","breaks":[{"start":"11:20","end":"11:30"},{"start":"14:30","end":"15:00"}]}',
)
@staticmethod
2021-06-21 20:32:43 +00:00
@db_session
def create_ticket():
pass
@staticmethod
2021-06-21 20:32:43 +00:00
@db_session
def create_Planner():
pass