JairoDanielMT commited on
Commit
1347f84
1 Parent(s): e4afc96

Update routers/ventas.py

Browse files
Files changed (1) hide show
  1. routers/ventas.py +12 -3
routers/ventas.py CHANGED
@@ -29,7 +29,11 @@ def get_ventas():
29
  print(e)
30
  return []
31
 
32
-
 
 
 
 
33
  @router.post("/")
34
  def post_venta(venta: Ventas):
35
  try:
@@ -49,9 +53,14 @@ def post_venta(venta: Ventas):
49
  print(e)
50
  return []
51
 
52
-
 
 
 
 
 
53
  @router.put("/")
54
- def put_venta(venta: Ventas):
55
  try:
56
  with DatabaseConnection().get_connection() as conn:
57
  cursor = conn.cursor()
 
29
  print(e)
30
  return []
31
 
32
+ class VentasPOST(BaseModel):
33
+ Fecha:str
34
+ ID_Empleado:int
35
+ Total:float
36
+
37
  @router.post("/")
38
  def post_venta(venta: Ventas):
39
  try:
 
53
  print(e)
54
  return []
55
 
56
+ class VentasUpdate(BaseModel):
57
+ Fecha:str
58
+ ID_Empleado:str
59
+ Total:float
60
+ Id_Venta:int
61
+
62
  @router.put("/")
63
+ def put_venta(venta: VentasUpdate):
64
  try:
65
  with DatabaseConnection().get_connection() as conn:
66
  cursor = conn.cursor()