Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
WSL0809 committed Jun 21, 2024
2 parents cb47f73 + ef3f1de commit c078ce2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion api/get_all_clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class ClientGet(BaseModel):
room: Union[str, None]
due_date: Union[str, None]
transaction_price: Union[float, None]
id_number: Union[str, None]


class GetAllClientsResp(BaseModel):
Expand All @@ -63,7 +64,7 @@ def get_clients(db: Session, name: Optional[str], page: int, limit: int):
base_query = """
SELECT c.id, c.status, c.name, c.tel, c.age, c.scheduled_date, c.check_in_date, c.hospital_for_childbirth,
c.contact_name, c.contact_tel, c.meal_plan_id, c.recovery_plan_id, c.mode_of_delivery,
c.assigned_baby_nurse, c.room, c.due_date, c.transaction_price,
c.assigned_baby_nurse, c.room, c.due_date, c.transaction_price, c.id_number,
COALESCE(json_agg(b.*) FILTER (WHERE b.baby_id IS NOT NULL), '[]') AS babies
FROM client c
LEFT JOIN baby b ON c.id = b.client_id
Expand Down
2 changes: 2 additions & 0 deletions api/get_all_rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


class GetAllRoomsResp(BaseModel):
client_id: Union[int, None]
room_number: str
name: Union[str, None]
baby_nurse_name: Union[str, None]
Expand Down Expand Up @@ -41,6 +42,7 @@ def get_all_room_info(current_user: User = Depends(get_current_active_user), db:
sql = text(
"""
SELECT room_number,
client.id AS client_id,
client.name AS name,
client.meal_plan_seller AS meal_plan_seller,
client.recovery_plan_seller AS recovery_plan_seller,
Expand Down
11 changes: 9 additions & 2 deletions log_config.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
version: 1
formatters:
default:
format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
access:
"()": uvicorn.logging.AccessFormatter
fmt: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'

handlers:
console:
class: logging.StreamHandler
formatter: default
stream: ext://sys.stdout
access_console:
class: logging.StreamHandler
formatter: access
stream: ext://sys.stdout

loggers:
uvicorn:
handlers: [console]
Expand All @@ -19,5 +26,5 @@ loggers:
propagate: False
uvicorn.access:
level: INFO
handlers: [console]
handlers: [access_console]
propagate: False

0 comments on commit c078ce2

Please sign in to comment.