This commit is contained in:
2025-03-05 01:35:59 +05:30
parent 8dcabfbf11
commit 928dbbaba1
4 changed files with 41 additions and 0 deletions

8
README.md Normal file
View 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
View 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
View 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
View 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']
}