diff --git a/barker/alembic/versions/34fe3d061c5f_devices1.py b/barker/alembic/versions/34fe3d061c5f_finish_import.py similarity index 100% rename from barker/alembic/versions/34fe3d061c5f_devices1.py rename to barker/alembic/versions/34fe3d061c5f_finish_import.py diff --git a/barker/barker/routers/customer.py b/barker/barker/routers/customer.py index c641936..e7427a1 100644 --- a/barker/barker/routers/customer.py +++ b/barker/barker/routers/customer.py @@ -33,7 +33,7 @@ def save( user: UserToken = Security(get_user, scopes=["customers"]), ): try: - item = Customer(company=data.company, name=data.name, phone=data.phone, address=data.address) + item = Customer(name=data.name, phone=data.phone, address=data.address) db.add(item) db.commit() return customer_info(item) @@ -57,7 +57,6 @@ def update( ): try: item: Customer = db.query(Customer).filter(Customer.id == id_).first() - item.company = data.company item.name = data.name item.phone = data.phone item.address = data.address @@ -119,10 +118,9 @@ def show_id( def customer_info(item: Optional[Customer]): if item is None: - return {"name": "", "company": "", "address": "", "phone": ""} + return {"name": "", "address": "", "phone": ""} return { "id": item.id, - "company": item.company, "name": item.name, "address": item.address, "phone": item.phone, diff --git a/barker/barker/routers/guest_book.py b/barker/barker/routers/guest_book.py index 565f1eb..226f539 100644 --- a/barker/barker/routers/guest_book.py +++ b/barker/barker/routers/guest_book.py @@ -39,7 +39,6 @@ def save( customer: Customer = db.query(Customer).filter(Customer.phone == data.phone).first() if customer is None: customer = Customer( - company=data.company, name=data.name, phone=data.phone, address=data.address, @@ -47,7 +46,6 @@ def save( db.add(customer) else: customer.name = data.name or customer.name - customer.company = data.company or customer.company customer.address = data.address or customer.address item = GuestBook(pax=data.pax, customer=customer) db.add(item) @@ -73,7 +71,6 @@ def update( ): try: item: GuestBook = db.query(GuestBook).filter(GuestBook.id == id_).first() - item.customer.company = data.company item.customer.name = data.name item.customer.phone = data.phone item.customer.address = data.address @@ -155,7 +152,6 @@ def show_list( { "id": item.id, "serial": i + 1, - "company": item.customer.company, "name": item.customer.name, "phone": item.customer.phone, "pax": item.pax, @@ -180,7 +176,6 @@ def guest_book_info(item: Optional[GuestBook]): if item is not None: return { "id": item.id, - "company": item.customer.company, "name": item.customer.name, "phone": item.customer.phone, "pax": item.pax, @@ -188,4 +183,4 @@ def guest_book_info(item: Optional[GuestBook]): "date": item.date.strftime("%d-%b-%Y %H:%M"), } else: - return {"company": "", "name": "", "phone": "", "pax": 0, "address": ""} + return {"name": "", "phone": "", "pax": 0, "address": ""} diff --git a/barker/barker/schemas/customer.py b/barker/barker/schemas/customer.py index 7beb2d8..341f59a 100644 --- a/barker/barker/schemas/customer.py +++ b/barker/barker/schemas/customer.py @@ -9,7 +9,6 @@ from . import to_camel class CustomerIn(BaseModel): name: str = Field(..., min_length=1) - company: str phone: str = Field(..., min_length=1) address: str diff --git a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html index e1d6b0c..6f2483b 100644 --- a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html +++ b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.html @@ -44,18 +44,6 @@ -
- - Company - - -