Add PostgreSQL database option and more booking flow functionalities

This commit is contained in:
2023-05-08 01:29:59 +02:00
parent d8346a20be
commit e2e6759dc0
40 changed files with 1594 additions and 907 deletions

View File

@@ -8,8 +8,61 @@ import (
func ReadConfig() (*viper.Viper, error) {
defaults := map[string]any{
"name": "COOPGO Mobility Accounts",
"name": "COOPGO Carpool Service",
"dev_env": false,
"storage": map[string]any{
"db": map[string]any{
"type": "psql",
"mongodb": map[string]any{
"host": "localhost",
"port": 27017,
"db_name": "coopgo_platform",
"collections": map[string]any{
"regular_routes": "carpool_regular_routes",
"punctual_routes": "carpool_punctual_routes",
"bookings": "carpool_bookings",
"driver_candidate_journeys": "carpool_driver_candidate_journeys",
"passenger_candidate_journeys": "carpool_passenger_candidate_journeys",
"persisted_kv": "carpool_persisted_kv",
},
},
"psql": map[string]any{
"host": "localhost",
"port": 5432,
"user": "postgres",
"password": "postgres",
"dbname": "coopgo_platform",
"schema": "carpool_service",
"sslmode": "disable",
"tables": map[string]any{
"regular_routes": "regular_routes",
"regular_route_schedules": "regular_route_schedules",
"bookings": "bookings",
"journeys_cache": "journeys_cache",
},
},
},
},
"services": map[string]any{
"grpc": map[string]any{
"enable": true,
"port": 8080,
},
"ocss_api": map[string]any{
"enable": true,
"port": 80,
},
},
"interoperability": map[string]any{
"internal_operator_id": "example.coopgo.fr",
"ocss": map[string]any{
"operator_id": "example.coopgo.fr",
"web_urls": map[string]string{
"driver_journeys": "https://example.coopgo.fr/driver_journeys/%s",
"passenger_journeys": "https://example.coopgo.fr/passenger_journeys/%s",
},
},
},
}
v := viper.New()