53 lines
1.7 KiB
Python
53 lines
1.7 KiB
Python
from pony.orm import db_session
|
|
from ITPlanning import db
|
|
|
|
|
|
class filldatabase:
|
|
@staticmethod
|
|
@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
|
|
@db_session
|
|
def create_service_category():
|
|
return db.Service_category(
|
|
name="install",
|
|
duration=45,
|
|
free_order=False,
|
|
description="test Service_category",
|
|
)
|
|
|
|
@staticmethod
|
|
@db_session
|
|
def create_service():
|
|
service_category = filldatabase.create_service_category()
|
|
return db.Service(
|
|
name="install", max_appointement=1, service_category=service_category
|
|
)
|
|
|
|
@staticmethod
|
|
@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
|
|
@db_session
|
|
def create_ticket():
|
|
pass
|
|
|
|
@staticmethod
|
|
@db_session
|
|
def create_Planner():
|
|
pass
|