002
This commit is contained in:
8
README.md
Normal file
8
README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# Flight Booking System
|
||||||
|
|
||||||
|
[ ] Developed RESTful API for flight search and booking
|
||||||
|
[ ] User Authentication
|
||||||
|
[ ] Implemented comprehensive flight search functionality
|
||||||
|
[ ] Implemented user registration and login functionality
|
||||||
|
[ ] Implemented secure booking process
|
||||||
|
[*] Create database schema for flights, users, and bookings
|
14
src/plane_entities.v
Normal file
14
src/plane_entities.v
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
module main
|
||||||
|
|
||||||
|
@[table: 'planes']
|
||||||
|
pub struct Plane {
|
||||||
|
mut:
|
||||||
|
id int @[primary; sql: serial]
|
||||||
|
from string @[nonull; sql_type: 'TEXT']
|
||||||
|
to string @[nonull; sql_type: 'TEXT']
|
||||||
|
seats string @[nonull; sql_type: 'TEXT']
|
||||||
|
seats_available int @[nonull; sql_type: 'INT']
|
||||||
|
time string @[nonull; sql_type: 'TEXT']
|
||||||
|
status string @[nonull; sql_type: 'TEXT']
|
||||||
|
tickets []Ticket @[foreign_key: 'plane_id'; on_delete: 'cascade'; on_update: 'cascade']
|
||||||
|
}
|
9
src/ticket_entities.v
Normal file
9
src/ticket_entities.v
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
module main
|
||||||
|
|
||||||
|
@[table: 'tickets']
|
||||||
|
pub struct Ticket {
|
||||||
|
mut:
|
||||||
|
id int @[primary; sql: serial]
|
||||||
|
user_id int
|
||||||
|
plane_id int
|
||||||
|
}
|
10
src/user_entities.v
Normal file
10
src/user_entities.v
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
module main
|
||||||
|
|
||||||
|
@[table: 'users']
|
||||||
|
pub struct User {
|
||||||
|
mut:
|
||||||
|
id int @[primary; sql: serial]
|
||||||
|
username string @[nonull; sql_type: 'TEXT'; unique]
|
||||||
|
password string @[nonull; sql_type: 'TEXT']
|
||||||
|
tickets []Ticket @[foreign_key: 'user_id']
|
||||||
|
}
|
Reference in New Issue
Block a user