Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Arturo Montejo Ráez
/
WBT2425_0
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
20
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
513e30a1
authored
Mar 17, 2025
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
updated loan states
parent
f30560df
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
fastapi/loan/schemas.py
fastapi/webapp.sql
fastapi/loan/schemas.py
View file @
513e30a1
...
...
@@ -5,13 +5,13 @@ from enum import Enum
class
LoanStatus
(
str
,
Enum
):
reserved
=
"reserved"
borrowed
=
"borrowed
"
returned
=
"returned
"
onloan
=
"on loan
"
available
=
"available
"
class
LoanBase
(
BaseModel
):
id_user
:
int
id_book
:
int
status
:
LoanStatus
=
LoanStatus
.
reserved
status
:
LoanStatus
=
LoanStatus
.
available
start
:
Optional
[
date
]
=
None
end
:
Optional
[
date
]
=
None
...
...
fastapi/webapp.sql
View file @
513e30a1
...
...
@@ -43,7 +43,7 @@ CREATE TABLE `book` (
CREATE
TABLE
`loan`
(
`id_user`
int
(
10
)
UNSIGNED
NOT
NULL
,
`id_book`
int
(
10
)
UNSIGNED
NOT
NULL
,
`status`
enum
(
'reserved'
,
'
started'
,
'ended'
)
NOT
NULL
DEFAULT
'reserved
'
,
`status`
enum
(
'reserved'
,
'
on loan'
,
'available'
)
NOT
NULL
DEFAULT
'available
'
,
`start`
date
DEFAULT
NULL
,
`end`
date
DEFAULT
NULL
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_general_ci
;
...
...
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