Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BookingMyHrManagement
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chanachai
BookingMyHrManagement
Commits
d901add5
Commit
d901add5
authored
Mar 15, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inventory
parent
edcc5878
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
2 deletions
+24
-2
launch.json
API-Fast/.vscode/launch.json
+20
-0
inventory_lot_controller.cpython-312.pyc
...lers/__pycache__/inventory_lot_controller.cpython-312.pyc
+0
-0
inventory_lot_controller.py
API-Fast/src/controllers/inventory_lot_controller.py
+2
-2
equipment.cpython-312.pyc
API-Fast/src/models/__pycache__/equipment.cpython-312.pyc
+0
-0
equipment.py
API-Fast/src/models/equipment.py
+1
-0
equipment_schema.cpython-312.pyc
.../src/schemas/__pycache__/equipment_schema.cpython-312.pyc
+0
-0
equipment_schema.py
API-Fast/src/schemas/equipment_schema.py
+1
-0
No files found.
API-Fast/.vscode/launch.json
0 → 100644
View file @
d901add5
{
//
Use
IntelliSense
to
learn
about
possible
attributes.
//
Hover
to
view
descriptions
of
existing
attributes.
//
For
more
information
,
visit
:
https
:
//go.microsoft.com/fwlink/?linkid=
830387
"version"
:
"0.2.0"
,
"configurations"
:
[
{
"name"
:
"Python Debugger: FastAPI"
,
"type"
:
"debugpy"
,
"request"
:
"launch"
,
"module"
:
"uvicorn"
,
"args"
:
[
"src.main:app"
,
"--reload"
],
"jinja"
:
true
}
]
}
\ No newline at end of file
API-Fast/src/controllers/__pycache__/inventory_lot_controller.cpython-312.pyc
View file @
d901add5
No preview for this file type
API-Fast/src/controllers/inventory_lot_controller.py
View file @
d901add5
...
...
@@ -22,9 +22,9 @@ async def create_inventory_lot(db: AsyncSession, lot_in: InventoryLotCreate):
try
:
db
.
add
(
new_lot
)
# ปรับปรุง quantity ของ equipment ถ้าต้องการ
if
lot_in
.
action
==
InventoryAction
.
INBOUND
:
if
lot_in
.
action
==
'INBOUND'
:
equipment_db
.
quantity
+=
lot_in
.
quantity
elif
lot_in
.
action
in
[
InventoryAction
.
OUTBOUND
,
InventoryAction
.
SCRAP
,
InventoryAction
.
MAINTENANCE_OUT
]:
elif
lot_in
.
action
in
[
"OUTBOUND"
,
InventoryAction
.
SCRAP
,
InventoryAction
.
MAINTENANCE_OUT
]:
if
equipment_db
.
quantity
<
lot_in
.
quantity
:
raise
HTTPException
(
status_code
=
400
,
detail
=
"Not enough quantity in stock"
)
equipment_db
.
quantity
-=
lot_in
.
quantity
...
...
API-Fast/src/models/__pycache__/equipment.cpython-312.pyc
View file @
d901add5
No preview for this file type
API-Fast/src/models/equipment.py
View file @
d901add5
...
...
@@ -18,6 +18,7 @@ class Equipment(Base):
)
equipmentName
=
Column
(
String
(
255
),
nullable
=
False
)
description
=
Column
(
String
,
nullable
=
True
)
quantity
=
Column
(
Integer
,
nullable
=
False
)
is_returnable
=
Column
(
Boolean
,
nullable
=
False
,
default
=
True
)
categoryId
=
Column
(
UUID
(
as_uuid
=
True
),
ForeignKey
(
"equipment_category.categoryId"
),
nullable
=
True
)
# ถ้าต้องการวันเวลาสร้าง/แก้ไข
...
...
API-Fast/src/schemas/__pycache__/equipment_schema.cpython-312.pyc
View file @
d901add5
No preview for this file type
API-Fast/src/schemas/equipment_schema.py
View file @
d901add5
...
...
@@ -6,6 +6,7 @@ from uuid import UUID
class
EquipmentBase
(
BaseModel
):
equipmentName
:
str
description
:
Optional
[
str
]
=
None
quantity
:
int
is_returnable
:
bool
=
True
class
EquipmentCreate
(
EquipmentBase
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment