updated loan states

parent f30560df
Showing with 4 additions and 4 deletions
...@@ -5,13 +5,13 @@ from enum import Enum ...@@ -5,13 +5,13 @@ from enum import Enum
class LoanStatus(str, Enum): class LoanStatus(str, Enum):
reserved = "reserved" reserved = "reserved"
borrowed = "borrowed" onloan = "on loan"
returned = "returned" available = "available"
class LoanBase(BaseModel): class LoanBase(BaseModel):
id_user: int id_user: int
id_book: int id_book: int
status: LoanStatus = LoanStatus.reserved status: LoanStatus = LoanStatus.available
start: Optional[date] = None start: Optional[date] = None
end: Optional[date] = None end: Optional[date] = None
......
...@@ -43,7 +43,7 @@ CREATE TABLE `book` ( ...@@ -43,7 +43,7 @@ CREATE TABLE `book` (
CREATE TABLE `loan` ( CREATE TABLE `loan` (
`id_user` int(10) UNSIGNED NOT NULL, `id_user` int(10) UNSIGNED NOT NULL,
`id_book` 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, `start` date DEFAULT NULL,
`end` date DEFAULT NULL `end` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment