Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
flight-agency-app
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Heber Cordova
flight-agency-app
Commits
a5c8977d
Commit
a5c8977d
authored
Nov 08, 2023
by
Heber Cordova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: added config for docker containers
parent
09e16b81
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
209 additions
and
35 deletions
+209
-35
docker-compose.yml
docker-compose.yml
+15
-12
SecurityConfig.java
...cordova/flightagencyapi/shared/config/SecurityConfig.java
+5
-4
application.properties
flight-agency-api/src/main/resources/application.properties
+5
-5
angular.json
flight-agency-app/angular.json
+7
-2
proxy.conf.json
flight-agency-app/proxy.conf.json
+1
-1
airports.service.ts
flight-agency-app/src/app/agent/services/airports.service.ts
+2
-1
booking.service.ts
flight-agency-app/src/app/agent/services/booking.service.ts
+2
-1
passenger.service.ts
...ht-agency-app/src/app/agent/services/passenger.service.ts
+2
-1
reservations.service.ts
...agency-app/src/app/agent/services/reservations.service.ts
+2
-1
ticket-class.service.ts
...agency-app/src/app/agent/services/ticket-class.service.ts
+2
-1
ticket-type.service.ts
...-agency-app/src/app/agent/services/ticket-type.service.ts
+2
-1
security.service.ts
...-agency-app/src/app/security/services/security.service.ts
+2
-1
agent.service.ts
...t-agency-app/src/app/supervisor/services/agent.service.ts
+2
-1
aircraft.service.ts
...gency-app/src/app/supervisor/services/aircraft.service.ts
+2
-1
airline.service.ts
...agency-app/src/app/supervisor/services/airline.service.ts
+2
-1
flight.service.ts
...-agency-app/src/app/supervisor/services/flight.service.ts
+2
-1
environment.development.ts
...ht-agency-app/src/environments/environment.development.ts
+4
-0
environment.ts
flight-agency-app/src/environments/environment.ts
+4
-0
init.sql
init.sql
+146
-0
No files found.
docker-compose.yml
View file @
a5c8977d
version
:
'
3.6'
services
:
app
:
image
:
nginx:latest
container_name
:
flight-booking-app
ports
:
-
"
8081:80"
volumes
:
-
./flight-agency-app/dist/flight-agency-app:/usr/share/nginx/html
-
./flight-agency-app/nginx.conf:/etc/nginx/conf.d/default.conf
networks
:
-
my-flight-app-network
database
:
image
:
mysql:latest
container_name
:
flight-booking-db
environment
:
-
MYSQL_ROOT_PASSWORD=admin
MYSQL_ROOT_PASSWORD
:
hbcordova
ports
:
-
"
3307:3306"
networks
:
-
my-flight-app-network
volumes
:
-
./init.sql:/docker-entrypoint-initdb.d/init.sql
api
:
build
:
./flight-agency-api
container_name
:
flight-booking-api
restart
:
always
ports
:
-
"
8082:8080"
depends_on
:
-
database
networks
:
-
my-flight-app-network
-
my-flight-app-network
app
:
image
:
nginx:latest
container_name
:
flight-booking-app
ports
:
-
"
8081:80"
volumes
:
-
./flight-agency-app/dist/flight-agency-app:/usr/share/nginx/html
-
./flight-agency-app/nginx.conf:/etc/nginx/conf.d/default.conf
networks
:
-
my-flight-app-network
networks
:
my-flight-app-network
:
flight-agency-api/src/main/java/com/hcordova/flightagencyapi/shared/config/SecurityConfig.java
View file @
a5c8977d
...
...
@@ -34,8 +34,8 @@ public class SecurityConfig {
@Bean
public
SecurityFilterChain
securityFilterChain
(
HttpSecurity
http
)
throws
Exception
{
http
.
csrf
(
AbstractHttpConfigurer:
:
disable
)
.
authorizeHttpRequests
(
request
->
request
.
requestMatchers
(
"/
api/v1/auth/
**"
)
.
permitAll
().
anyRequest
().
authenticated
())
.
authorizeHttpRequests
(
request
->
request
.
requestMatchers
(
"/**"
)
.
permitAll
().
anyRequest
().
permitAll
())
.
cors
(
cors
->
cors
.
configurationSource
(
corsConfigurationSource
()))
.
sessionManagement
(
manager
->
manager
.
sessionCreationPolicy
(
SessionCreationPolicy
.
STATELESS
))
.
authenticationProvider
(
authenticationProvider
()).
addFilterBefore
(
...
...
@@ -46,9 +46,10 @@ public class SecurityConfig {
@Bean
CorsConfigurationSource
corsConfigurationSource
()
{
CorsConfiguration
configuration
=
new
CorsConfiguration
();
configuration
.
setAllowedOrigins
(
Arrays
.
asList
(
"http://localhost:4200"
));
configuration
.
setAllowedMethods
(
Arrays
.
asList
(
"*"
,
"GET"
,
"POST"
,
"PUT"
,
"DELETE"
,
"PATCH"
,
"OPTIONS"
));
configuration
.
applyPermitDefaultValues
();
configuration
.
addAllowedOrigin
(
"*"
);
// configuration.setAllowedOrigins(Arrays.asList("https://b8cf-201-218-130-89.ngrok-free.app", "http://localhost:4200"));
// configuration.setAllowedMethods(Arrays.asList("*", "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
UrlBasedCorsConfigurationSource
source
=
new
UrlBasedCorsConfigurationSource
();
source
.
registerCorsConfiguration
(
"/**"
,
configuration
);
return
source
;
...
...
flight-agency-api/src/main/resources/application.properties
View file @
a5c8977d
# METADATA
db.host
=
my-flight-app-network
#
db.host=my-flight-app-network
jwt.signin.key
=
aJncb8DoBw4eNK4syWvjpbs8xQkVJDeLE2cthyQYfnc4p2XpsMuamKDe4HxUCXQT
# app.port=8080
# SERVER
server.port
=
808
5
server.port
=
808
0
# MYSQL
spring.datasource.driver-class-name
=
com.mysql.cj.jdbc.Driver
# spring.datasource.url=jdbc:mysql://${db.host}:localhost}:3306/flightdatabase?useSSL=false&createDatabaseIfNotExists=tru
e
spring.datasource.url
=
jdbc:mysql://localhost:3306/flightdatabase?useSSL=false&createDatabaseIfNotExists=true
spring.datasource.url
=
jdbc:mysql://database:3306/flightdatabase?allowPublicKeyRetrieval=true&createDatabaseIfNotExists=true&useSSL=fals
e
#
spring.datasource.url=jdbc:mysql://localhost:3306/flightdatabase?useSSL=false&createDatabaseIfNotExists=true
spring.datasource.username
=
root
spring.datasource.password
=
hbcordova
# JPA
spring.jpa.hibernate.ddl-auto
=
update
spring.jpa.database-platform
=
org.hibernate.dialect.MySQL8Dialect
# spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
spring.jpa.generate-ddl
=
true
spring.jpa.show-sql
=
true
\ No newline at end of file
flight-agency-app/angular.json
View file @
a5c8977d
...
...
@@ -54,8 +54,13 @@
"optimization"
:
false
,
"vendorChunk"
:
true
,
"extractLicenses"
:
false
,
"sourceMap"
:
true
,
"namedChunks"
:
true
"namedChunks"
:
true
,
"fileReplacements"
:
[
{
"replace"
:
"src/environments/environment.ts"
,
"with"
:
"src/environments/environment.development.ts"
}
]
}
},
"defaultConfiguration"
:
"production"
...
...
flight-agency-app/proxy.conf.json
View file @
a5c8977d
{
"/api"
:
{
"target"
:
"http://localhost:80
85
"
,
"target"
:
"http://localhost:80
50
"
,
"secure"
:
false
}
}
flight-agency-app/src/app/agent/services/airports.service.ts
View file @
a5c8977d
...
...
@@ -3,12 +3,13 @@ import { HttpClient } from '@angular/common/http';
import
{
Observable
}
from
'rxjs'
;
import
{
Airport
}
from
'../interfaces/airport.interface'
;
import
{
headers
}
from
'src/app/shared/utils/header.util'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
AirportsService
{
constructor
(
private
http
:
HttpClient
)
{
}
private
BASE_URL
:
string
=
'http://localhost:8085/api/v1/airports'
;
private
BASE_URL
:
string
=
`
${
environment
.
url
}
/api/v1/airports`
;
getAll
():
Observable
<
Airport
[]
>
{
return
this
.
http
.
get
<
Airport
[]
>
(
this
.
BASE_URL
,
{
headers
});
...
...
flight-agency-app/src/app/agent/services/booking.service.ts
View file @
a5c8977d
...
...
@@ -2,12 +2,13 @@ import { Injectable } from '@angular/core';
import
{
HttpClient
}
from
'@angular/common/http'
;
import
{
Observable
}
from
'rxjs'
;
import
{
Booking
}
from
'../interfaces/booking.interface'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
BookingService
{
constructor
(
private
httpClient
:
HttpClient
)
{
}
private
BASE_URL
:
string
=
'http://localhost:3000/bookings'
;
private
BASE_URL
:
string
=
`
${
environment
.
url
}
/api/v1/bookings`
;
getAll
():
Observable
<
Booking
[]
>
{
return
this
.
httpClient
.
get
<
Booking
[]
>
(
this
.
BASE_URL
);
...
...
flight-agency-app/src/app/agent/services/passenger.service.ts
View file @
a5c8977d
...
...
@@ -3,12 +3,13 @@ import { HttpClient } from '@angular/common/http';
import
{
Passenger
}
from
'../interfaces/passenger.interface'
;
import
{
Observable
}
from
'rxjs'
;
import
{
headers
}
from
'src/app/shared/utils/header.util'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
PassengerService
{
constructor
(
private
http
:
HttpClient
)
{
}
URL_BASE
:
string
=
'http://localhost:8085/api/v1/passengers'
;
URL_BASE
:
string
=
`
${
environment
.
url
}
/api/v1/passengers`
;
getAll
():
Observable
<
Passenger
[]
>
{
return
this
.
http
.
get
<
Passenger
[]
>
(
this
.
URL_BASE
,
{
headers
});
...
...
flight-agency-app/src/app/agent/services/reservations.service.ts
View file @
a5c8977d
...
...
@@ -5,12 +5,13 @@ import { Observable, tap } from 'rxjs';
import
{
headers
}
from
'src/app/shared/utils/header.util'
;
import
{
ReservationSave
}
from
'../interfaces/reservation-save.interface'
;
import
{
ReservationDetail
}
from
'src/app/passenger/interfaces/reservation-detail.interface'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
ReservationsService
{
constructor
(
private
http
:
HttpClient
)
{
}
URL_BASE
:
string
=
'http://localhost:8085/api/v1/reservations'
;
URL_BASE
:
string
=
`
${
environment
.
url
}
/api/v1/reservations`
;
getAll
():
Observable
<
Reservation
[]
>
{
return
this
.
http
.
get
<
Reservation
[]
>
(
this
.
URL_BASE
,
{
headers
});
...
...
flight-agency-app/src/app/agent/services/ticket-class.service.ts
View file @
a5c8977d
...
...
@@ -3,12 +3,13 @@ import { HttpClient } from '@angular/common/http';
import
{
Observable
}
from
'rxjs'
;
import
{
FlightClass
}
from
'../interfaces/flight-class.interface'
;
import
{
headers
}
from
'src/app/shared/utils/header.util'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
TicketClassService
{
constructor
(
private
http
:
HttpClient
)
{
}
private
BASE_URL
:
string
=
'http://localhost:8085/api/v1/travel-classes'
;
private
BASE_URL
:
string
=
`
${
environment
.
url
}
/api/v1/ticket-classes`
;
getAll
():
Observable
<
FlightClass
[]
>
{
return
this
.
http
.
get
<
FlightClass
[]
>
(
this
.
BASE_URL
,
{
headers
});
...
...
flight-agency-app/src/app/agent/services/ticket-type.service.ts
View file @
a5c8977d
...
...
@@ -3,12 +3,13 @@ import { HttpClient } from '@angular/common/http';
import
{
TicketType
}
from
'../interfaces/ticket-type.interface'
;
import
{
Observable
}
from
'rxjs'
;
import
{
headers
}
from
'src/app/shared/utils/header.util'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
TicketTypeService
{
constructor
(
private
http
:
HttpClient
)
{
}
private
BASE_URL
:
string
=
'http://localhost:8085/api/v1/ticket-types'
;
private
BASE_URL
:
string
=
`
${
environment
.
url
}
/api/v1/ticket-types`
;
getAll
():
Observable
<
TicketType
[]
>
{
return
this
.
http
.
get
<
TicketType
[]
>
(
this
.
BASE_URL
,
{
headers
});
...
...
flight-agency-app/src/app/security/services/security.service.ts
View file @
a5c8977d
...
...
@@ -4,12 +4,13 @@ import { SecurityCredentials } from '../models/security-credentials.interface';
import
{
SecurityResponse
}
from
'../models/security-response.interface'
;
import
{
Observable
}
from
'rxjs'
;
import
{
Router
}
from
'@angular/router'
;
import
{
environment
}
from
'../../../environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
SecurityService
{
constructor
(
private
http
:
HttpClient
,
private
router
:
Router
)
{
}
URL_BASE
:
string
=
'http://localhost:8085/api/v1/auth/'
;
URL_BASE
:
string
=
`
${
environment
.
url
}
/api/v1/auth/`
;
get
currentUser
():
SecurityResponse
|
null
{
const
userLocalStorage
=
localStorage
.
getItem
(
'userLogged'
);
...
...
flight-agency-app/src/app/supervisor/services/agent.service.ts
View file @
a5c8977d
...
...
@@ -3,12 +3,13 @@ import { HttpClient, HttpHeaders } from '@angular/common/http';
import
{
Observable
}
from
'rxjs'
;
import
{
Agent
,
AgentExtended
,
AgentSave
}
from
'../interfaces/agent.interface'
;
import
{
headers
}
from
'src/app/shared/utils/header.util'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
AgentsService
{
constructor
(
private
http
:
HttpClient
)
{
}
private
BASE_URL
:
string
=
'http://localhost:8085/api/v1/agents'
;
private
BASE_URL
:
string
=
`
${
environment
.
url
}
/api/v1/agents`
;
getAll
():
Observable
<
Agent
[]
>
{
console
.
log
(
headers
)
...
...
flight-agency-app/src/app/supervisor/services/aircraft.service.ts
View file @
a5c8977d
...
...
@@ -3,12 +3,13 @@ import { HttpClient } from '@angular/common/http';
import
{
Observable
}
from
'rxjs'
;
import
{
Aircraft
}
from
'../interfaces/aircraft.interface'
;
import
{
headers
}
from
'src/app/shared/utils/header.util'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
AircraftService
{
constructor
(
private
http
:
HttpClient
)
{
}
URL_BASE
:
string
=
'http://localhost:8085/api/v1/aircrafts'
;
URL_BASE
:
string
=
`
${
environment
.
url
}
/api/v1/aircrafts`
;
getAll
():
Observable
<
Aircraft
[]
>
{
return
this
.
http
.
get
<
Aircraft
[]
>
(
this
.
URL_BASE
,
{
headers
});
...
...
flight-agency-app/src/app/supervisor/services/airline.service.ts
View file @
a5c8977d
...
...
@@ -3,12 +3,13 @@ import { HttpClient } from '@angular/common/http';
import
{
Observable
}
from
'rxjs'
;
import
{
Airline
}
from
'../interfaces/airline.interface'
;
import
{
headers
}
from
'src/app/shared/utils/header.util'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
AirlineService
{
constructor
(
private
http
:
HttpClient
)
{
}
BASE_URL
=
'http://localhost:8085/api/v1/airlines'
;
BASE_URL
=
`
${
environment
.
url
}
/api/v1/airlines`
;
getAll
():
Observable
<
Airline
[]
>
{
return
this
.
http
.
get
<
Airline
[]
>
(
this
.
BASE_URL
,
{
headers
});
...
...
flight-agency-app/src/app/supervisor/services/flight.service.ts
View file @
a5c8977d
...
...
@@ -5,12 +5,13 @@ import { Flight } from '../interfaces/flight.interface';
import
{
FlightTable
}
from
'../interfaces/flight-table.interface'
;
import
{
FlightSave
}
from
'../interfaces/flight-save.interface'
;
import
{
headers
}
from
'src/app/shared/utils/header.util'
;
import
{
environment
}
from
'src/environments/environment'
;
@
Injectable
({
providedIn
:
'root'
})
export
class
FlightService
{
constructor
(
private
http
:
HttpClient
)
{
}
URL_BASE
:
string
=
'http://localhost:8085/api/v1/flights'
;
URL_BASE
:
string
=
`
${
environment
.
url
}
/api/v1/flights`
;
getAll
():
Observable
<
FlightTable
[]
>
{
return
this
.
http
.
get
<
FlightTable
[]
>
(
this
.
URL_BASE
,
{
headers
});
...
...
flight-agency-app/src/environments/environment.development.ts
0 → 100644
View file @
a5c8977d
export
const
environment
=
{
production
:
false
,
url
:
'http://localhost:8082'
};
flight-agency-app/src/environments/environment.ts
0 → 100644
View file @
a5c8977d
export
const
environment
=
{
production
:
true
,
url
:
'http://localhost:8082'
};
init.sql
0 → 100644
View file @
a5c8977d
CREATE
SCHEMA
IF
NOT
EXISTS
flightdatabase
;
USE
flightdatabase
;
CREATE
TABLE
IF
NOT
EXISTS
roles
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
users
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
,
lastname
VARCHAR
(
255
)
NOT
NULL
,
email
VARCHAR
(
255
)
NOT
NULL
,
password
VARCHAR
(
255
)
NOT
NULL
,
role_id
INT
NOT
NULL
,
PRIMARY
KEY
(
id
),
FOREIGN
KEY
(
role_id
)
REFERENCES
roles
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
airports
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
,
location
VARCHAR
(
255
)
NOT
NULL
,
code
VARCHAR
(
3
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
airlines
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
,
code
VARCHAR
(
2
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
aircrafts
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
,
manufacturer
VARCHAR
(
255
)
NOT
NULL
,
model
VARCHAR
(
255
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
ticket_type
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
travel_class
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
reservation_status
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
payment_status
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
name
VARCHAR
(
255
)
NOT
NULL
,
PRIMARY
KEY
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
supervisors
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
created_at
DATE
NOT
NULL
,
details
VARCHAR
(
255
)
NOT
NULL
,
user_id
INT
NOT
NULL
,
PRIMARY
KEY
(
id
),
FOREIGN
KEY
(
user_id
)
REFERENCES
users
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
agents
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
created_at
DATE
NOT
NULL
,
details
VARCHAR
(
255
)
NOT
NULL
,
user_id
INT
NOT
NULL
,
PRIMARY
KEY
(
id
),
FOREIGN
KEY
(
user_id
)
REFERENCES
users
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
passengers
(
id
INT
NOT
NULL
AUTO_INCREMENT
,
created_at
DATE
NOT
NULL
,
address
VARCHAR
(
255
)
NOT
NULL
,
city
VARCHAR
(
255
)
NOT
NULL
,
country
VARCHAR
(
255
)
NOT
NULL
,
phone
VARCHAR
(
255
)
NOT
NULL
,
user_id
INT
NOT
NULL
,
PRIMARY
KEY
(
id
),
FOREIGN
KEY
(
user_id
)
REFERENCES
users
(
id
)
);
INSERT
INTO
roles
(
name
)
VALUES
(
'supervisor'
),
(
'agent'
),
(
'passenger'
);
INSERT
INTO
airports
(
name
,
location
,
code
)
VALUES
(
'Jorge Chavez International Airport'
,
'Lima, Peru'
,
'LIM'
),
(
'John F. Kennedy International Airport'
,
'New York, USA'
,
'JFK'
),
(
'Heathrow Airport'
,
'London, UK'
,
'LHR'
),
(
'Charles de Gaulle Airport'
,
'Paris, France'
,
'CDG'
),
(
'Los Angeles International Airport'
,
'Los Angeles, USA'
,
'LAX'
),
(
'Sydney Kingsford Smith Airport'
,
'Sydney, Australia'
,
'SYD'
),
(
'Dubai International Airport'
,
'Dubai, UAE'
,
'DXB'
),
(
'Beijing Capital International Airport'
,
'Beijing, China'
,
'PEK'
),
(
'Benito Juarez International Airport'
,
'Mexico City, Mexico'
,
'MEX'
),
(
'Frankfurt Airport'
,
'Frankfurt, Germany'
,
'FRA'
),
(
'Toronto Pearson International Airport'
,
'Toronto, Canada'
,
'YYZ'
),
(
'Incheon International Airport'
,
'Seoul, South Korea'
,
'ICN'
),
(
'Sao Paulo-Guarulhos International Airport'
,
'Sao Paulo, Brazil'
,
'GRU'
),
(
'Barcelona-El Prat Airport'
,
'Barcelona, Spain'
,
'BCN'
),
(
'Cairo International Airport'
,
'Cairo, Egypt'
,
'CAI'
);
INSERT
INTO
airlines
(
name
,
code
)
VALUES
(
'American Airlines'
,
'AA'
),
(
'Delta Air Lines'
,
'DL'
),
(
'United Airlines'
,
'UA'
),
(
'Emirates'
,
'EK'
),
(
'Lufthansa'
,
'LH'
),
(
'British Airways'
,
'BA'
),
(
'Qatar Airways'
,
'QR'
),
(
'Air France'
,
'AF'
),
(
'LATAM Airlines'
,
'LA'
);
INSERT
INTO
aircrafts
(
name
,
manufacturer
,
model
)
VALUES
(
'Boeing 737'
,
'Boeing'
,
'737-800'
),
(
'Airbus A320'
,
'Airbus'
,
'A320-200'
),
(
'Boeing 787 Dreamliner'
,
'Boeing'
,
'787-9'
),
(
'Embraer E175'
,
'Embraer'
,
'E175'
);
INSERT
INTO
ticket_type
(
name
)
VALUES
(
'Economy'
),
(
'Business'
),
(
'First Class'
);
INSERT
INTO
travel_class
(
name
)
VALUES
(
'Economy'
),
(
'Business'
),
(
'First Class'
);
INSERT
INTO
reservation_status
(
name
)
VALUES
(
'registered'
),
(
'processing_payment'
),
(
'Cancelled'
),
(
'paid'
);
INSERT
INTO
payment_status
(
name
)
VALUES
(
'pending'
),
(
'paid'
),
(
'refunded'
);
INSERT
INTO
users
(
email
,
lastname
,
name
,
password
,
role_id
)
values
(
"supervisor@gmail.com"
,
"Loayza"
,
"Roberto"
,
"$2a$10$x2mZN5ZT0qnfUDWPFww/Ke4/UjgLRFVyEl4G/gd8kiBRZBvv4wzEO"
,
1
);
INSERT
INTO
users
(
email
,
lastname
,
name
,
password
,
role_id
)
values
(
"agent@gmail.com"
,
"Cordova"
,
"Heber"
,
"$2a$10$BFGbKrtQ67FENKMNXAR6deaICZ33m2fv4QoHMGHWlX1JNsmdR/Z5O"
,
2
);
INSERT
INTO
users
(
email
,
lastname
,
name
,
password
,
role_id
)
values
(
"passenger@gmail.com"
,
"DeTal"
,
"Fulanito"
,
"$2a$10$ks1w2U1QSCJyngLuM1X0aOnFRHa7eqG6rmb9WEOlZMjyICLhABMZe"
,
3
);
INSERT
INTO
supervisors
(
created_at
,
details
,
user_id
)
values
(
"2023-11-08"
,
""
,
1
);
INSERT
INTO
agents
(
created_at
,
details
,
user_id
)
values
(
"2023-11-08"
,
""
,
2
);
INSERT
INTO
passengers
(
created_at
,
address
,
city
,
country
,
phone
,
user_id
)
values
(
"2023-11-08"
,
"Calle Agusto Wiese 345"
,
"Lima"
,
"Peru"
,
"987654321"
,
3
);
\ No newline at end of file
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