Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
5a3a36af
Commit
5a3a36af
authored
May 20, 2021
by
Bogdan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Car Sharing Official schema prototype
parent
fe42acd3
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
1383 additions
and
0 deletions
+1383
-0
add_carsharingofficial_schema.py
...pts/car_sharing_official/add_carsharingofficial_schema.py
+63
-0
__init__.py
..._use_case_scripts/car_sharing_official/tables/__init__.py
+13
-0
add_car.py
...d_use_case_scripts/car_sharing_official/tables/add_car.py
+184
-0
add_hash.py
..._use_case_scripts/car_sharing_official/tables/add_hash.py
+89
-0
add_media.py
...use_case_scripts/car_sharing_official/tables/add_media.py
+91
-0
add_offer.py
...use_case_scripts/car_sharing_official/tables/add_offer.py
+133
-0
add_offerEndPlaces.py
...scripts/car_sharing_official/tables/add_offerEndPlaces.py
+69
-0
add_publication.py
...se_scripts/car_sharing_official/tables/add_publication.py
+126
-0
add_travel.py
...se_case_scripts/car_sharing_official/tables/add_travel.py
+185
-0
add_travelCancelledBy.py
...ipts/car_sharing_official/tables/add_travelCancelledBy.py
+68
-0
add_travelFinishedBy.py
...ripts/car_sharing_official/tables/add_travelFinishedBy.py
+68
-0
add_travelStartedBy.py
...cripts/car_sharing_official/tables/add_travelStartedBy.py
+68
-0
add_travelSuggestedEndPlaces.py
...r_sharing_official/tables/add_travelSuggestedEndPlaces.py
+68
-0
add_travelUsers.py
...se_scripts/car_sharing_official/tables/add_travelUsers.py
+66
-0
add_user.py
..._use_case_scripts/car_sharing_official/tables/add_user.py
+92
-0
No files found.
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/add_carsharingofficial_schema.py
0 → 100644
View file @
5a3a36af
import
sys
import
os
from
pathlib
import
Path
from
typing
import
Dict
,
Any
import
requests
modules_paths
=
[
'.'
,
'../../../modules/'
]
for
modules_path
in
modules_paths
:
if
os
.
path
.
exists
(
modules_path
):
sys
.
path
.
insert
(
1
,
modules_path
)
# import _add_use_case_scripts.car_sharing.tables.add_user as user
from
_add_use_case_scripts.car_sharing.tables
import
add_car
,
add_hash
,
add_media
,
add_offer
,
add_offerEndPlaces
,
add_publication
,
add_travel
,
add_travelCancelledBy
from
_add_use_case_scripts.car_sharing.tables
import
add_travelFinishedBy
,
add_travelStartedBy
,
add_travelSuggestedEndPlaces
,
add_travelUsers
,
add_user
import
network_constants
as
nc
from
security.token_manager
import
TokenManager
def
add_use_case
(
use_case
:
str
):
use_case
=
"car-sharing-official"
jwt
=
TokenManager
.
getInstance
()
.
getToken
()
url
=
f
"https://articonf1.itec.aau.at:30420/api/use-cases"
response
=
requests
.
post
(
url
,
verify
=
False
,
proxies
=
{
"http"
:
None
,
"https"
:
None
},
headers
=
{
"Authorization"
:
f
"Bearer {jwt}"
},
json
=
{
"name"
:
use_case
}
)
print
(
url
+
": "
+
str
(
response
.
content
))
if
__name__
==
"__main__"
:
use_case
=
"car-sharing-official"
# disable ssl warnings :)
requests
.
packages
.
urllib3
.
disable_warnings
()
add_use_case
(
use_case
)
add_car
.
main
(
use_case
)
add_hash
.
main
(
use_case
)
add_media
.
main
(
user_case
)
add_offer
.
main
(
use_case
)
add_offerEndPlaces
.
main
(
user_case
)
add_publication
.
main
(
use_case
)
add_travel
.
main
(
use_case
)
add_travelCancelledBy
.
main
(
user_case
)
add_travelFinishedBy
.
main
(
user_case
)
add_travelStartedBy
.
main
(
user_case
)
add_travelSuggestedEndPlaces
.
main
(
user_case
)
add_travelUsers
.
main
(
user_case
)
add_user
.
main
(
use_case
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/__init__.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.car_sharing.tables
import
add_car
from
_add_use_case_scripts.car_sharing.tables
import
add_hash
from
_add_use_case_scripts.car_sharing.tables
import
add_offer
from
_add_use_case_scripts.car_sharing.tables
import
add_offerEndPlaces
from
_add_use_case_scripts.car_sharing.tables
import
add_publication
from
_add_use_case_scripts.car_sharing.tables
import
add_travel
from
_add_use_case_scripts.car_sharing.tables
import
add_travelCancelledBy
from
_add_use_case_scripts.car_sharing.tables
import
add_travelFinishedBy
from
_add_use_case_scripts.car_sharing.tables
import
add_travelStartedBy
from
_add_use_case_scripts.car_sharing.tables
import
add_travelSuggestedEndPlaces
from
_add_use_case_scripts.car_sharing.tables
import
add_travelUsers
from
_add_use_case_scripts.car_sharing.tables
import
add_user
from
_add_use_case_scripts.car_sharing.tables
import
requestPost
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_car.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"brand"
,
"carLicensePlate"
,
"colour"
,
"deleted"
,
"model"
,
"numberOfEvaluations"
,
"observations"
,
"ownerId"
,
"seats"
,
"state"
,
"sumOfEvaluations"
"year"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"carLicensePlate"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"GeneralCar_layer"
,
"properties"
:
[
"UniqueID"
,
"brand"
,
"carLicensePlate"
,
"colour"
,
"deleted"
,
"model"
,
"numberOfEvaluations"
,
"observations"
,
"ownerId"
,
"seats"
,
"state"
,
"sumOfEvaluations"
"year"
],
"cluster_properties"
:
[
"brand"
,
"model"
,
"seats"
,
"year"
,
"ownerId"
,
"state"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Owner_layer"
,
"properties"
:
[
"UniqueID"
,
"brand"
,
"carLicensePlate"
,
"colour"
,
"deleted"
,
"model"
,
"numberOfEvaluations"
,
"observations"
,
"ownerId"
,
"seats"
,
"state"
,
"sumOfEvaluations"
"year"
],
"cluster_properties"
:
[
"OwnerID"
,
"UniqueID"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"CarAge_layer"
,
"properties"
:
[
"UniqueID"
,
"brand"
,
"carLicensePlate"
,
"colour"
,
"deleted"
,
"model"
,
"numberOfEvaluations"
,
"observations"
,
"ownerId"
,
"seats"
,
"state"
,
"sumOfEvaluations"
"year"
],
"cluster_properties"
:
[
"year"
,
"state"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Model_layer"
,
"properties"
:
[
"UniqueID"
,
"brand"
,
"carLicensePlate"
,
"colour"
,
"deleted"
,
"model"
,
"numberOfEvaluations"
,
"observations"
,
"ownerId"
,
"seats"
,
"state"
,
"sumOfEvaluations"
"year"
],
"cluster_properties"
:
[
"brand"
,
"model"
,
"seats"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"CarState_layer"
,
"properties"
:
[
"UniqueID"
,
"ownerId"
,
"deleted"
,
"state"
],
"cluster_properties"
:
[
"deleted"
,
"state"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"CarEvaluation_layer"
,
"properties"
:
[
"UniqueID"
,
"brand"
,
"colour"
,
"deleted"
,
"model"
,
"numberOfEvaluations"
,
"observations"
,
"ownerId"
,
"seats"
,
"state"
,
"sumOfEvaluations"
"year"
],
"cluster_properties"
:
[
"numberOfEvaluations"
,
"sumOfEvaluations"
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"CAR"
)
table_name
=
"car"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_hash.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"connection"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"documents[0]//id"
columns
[
"database"
]
=
"connection//database"
columns
[
"databaseType"
]
=
"connection//databaseType"
columns
[
"host"
]
=
"connection//host"
columns
[
"port"
]
=
"connection//port"
columns
[
"documentCollection"
]
=
"documents[0]//collection"
columns
[
"documentHash"
]
=
"documents[0]//hash"
columns
[
"documentId"
]
=
"documents[0]//id"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"document_Layer"
,
"properties"
:
[
"UniqueID"
,
"documentCollection"
,
"documentHash"
,
"documentId"
],
"cluster_properties"
:
[
"documentId"
,
"documentCollection"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"hostAndPort_Layer"
,
"properties"
:
[
"UniqueID"
,
"database"
,
"databaseType"
,
"host"
,
"port"
],
"cluster_properties"
:
[
"host"
,
"port"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"databaseType_Layer"
,
"properties"
:
[
"UniqueID"
,
"database"
,
"databaseType"
,
"host"
,
"port"
],
"cluster_properties"
:
[
"databaseType"
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"HASH"
)
table_name
=
"hash"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_media.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"data"
,
"extension"
,
"id"
,
"name"
,
"publication"
,
"type"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"publication+id"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"MediaExtension_Layer"
,
"properties"
:
[
"UniqueID"
,
"data"
,
"extension"
,
"id"
,
"name"
,
"publication"
,
"type"
],
"cluster_properties"
:
[
"extension"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"MediaType_Layer"
,
"properties"
:
[
"UniqueID"
,
"data"
,
"extension"
,
"id"
,
"name"
,
"publication"
,
"type"
],
"cluster_properties"
:
[
"type"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"MediaName_Layer"
,
"properties"
:
[
"data"
,
"extension"
,
"id"
,
"name"
,
"publication"
,
"type"
],
"cluster_properties"
:
[
"name"
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"MEDIA"
)
table_name
=
"media"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_offer.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"available"
,
"deleted"
,
"deposit"
,
"endDate"
,
"id"
,
"priceForKm"
,
"priceForTime"
,
"startDate"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"id"
columns
[
"carID"
]
=
"car//carLicensePlate"
columns
[
"carOwner"
]
=
"car//ownerId"
columns
[
"startPlaceAddress"
]
=
"startPlace//address"
columns
[
"startPlaceLatitude"
]
=
"startPlace//latitude"
columns
[
"startPlaceLongitude"
]
=
"startPlace//longitude"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"OfferStartPlace_layer"
,
"properties"
:
[
"UniqueID"
,
"carID"
,
"carOwner"
,
"startPlaceAddress"
,
"startPlaceLatitude"
,
"startPlaceLongitude"
,
"startDate"
],
"cluster_properties"
:
[
"carOwner"
,
"startPlaceLatitude"
,
"startPlaceLongitude"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"OfferedCar_layer"
,
"properties"
:
[
"UniqueID"
,
"carID"
,
"carOwner"
],
"cluster_properties"
:
[
"carID"
,
"carOwner"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"OfferPrice_layer"
,
"properties"
:
[
"UniqueID"
,
"carOwner"
,
"priceForKm"
,
"priceForTime"
,
"deposit"
],
"cluster_properties"
:
[
"carOwner"
,
"priceForKm"
,
"priceForTime"
,
"deposit"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"OfferTime_layer"
,
"properties"
:
[
"UniqueID"
,
"carOwner"
,
"startDate"
,
"endDate"
],
"cluster_properties"
:
[
"carOwner"
,
"startDate"
,
"endDate"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"OfferStatus_layer"
,
"properties"
:
[
"UniqueID"
,
"carOwner"
,
"available"
,
"deleted"
],
"cluster_properties"
:
[
"carOwner"
,
"available"
,
"deleted"
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"OFFER"
)
table_name
=
"offer"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_offerEndPlaces.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
# None
]
#TODO unique id is dependent on offferId -> error?
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"offerId+endPlacesLatitude+endPlacesLongitude"
columns
[
"offerId"
]
=
"offer//id"
columns
[
"endPlacesAddress"
]
=
"endPlaces[0]//address"
,
columns
[
"endPlacesLatitude"
]
=
"endPlaces[0]//latitude"
,
columns
[
"endPlacesLongitude"
]
=
"endPlaces[0]//longitude"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"OfferEndPlace_layer"
,
"properties"
:
[
"UniqueID"
,
"offerID"
,
"endPlacesAddress"
,
"endPlacesLatitude"
,
"endPlacesLongitude"
],
"cluster_properties"
:
[
"endPlacesLatitude"
,
"endPlacesLongitude"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"OfferEndAddress_layer"
,
"properties"
:
[
"UniqueID"
,
"offerID"
,
"endPlacesAddress"
,
"endPlacesLatitude"
,
"endPlacesLongitude"
],
"cluster_properties"
:
[
"endPlacesAddress"
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"OFFER_ENDPLACES"
)
table_name
=
"offerEndPlaces"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_publication.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"answerTo"
,
"date"
,
"deleted"
,
"id"
,
"labels"
,
"text"
,
"user"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"id"
columns
[
"latitude"
]
=
"location//latitude"
columns
[
"longitude"
]
=
"location//longitude"
columns
[
"likesNumber"
]
=
"likesUsers//length"
columns
[
"reportsNumber"
]
=
"usersReports//length"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"PublicationLocation_Layer"
,
"properties"
:
[
"UniqueID"
,
"user"
,
"latitude"
,
"longitude"
],
"cluster_properties"
:
[
"latitude"
,
"longitude"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"PublicationTime_Layer"
,
"properties"
:
[
"UniqueID"
,
"user"
,
"latitude"
,
"longitude"
,
"date"
],
"cluster_properties"
:
[
"date"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"PublicationUser_Layer"
,
"properties"
:
[
"UniqueID"
,
"text"
,
"user"
,
"labels"
],
"cluster_properties"
:
[
"user"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"PublicationStatus_Layer"
,
"properties"
:
[
"UniqueID"
,
"text"
,
"user"
,
"deleted"
,
"answerTo"
],
"cluster_properties"
:
[
"deleted"
,
"answerTo"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"PublicationLikeReport_Layer"
,
"properties"
:
[
"UniqueID"
,
"text"
,
"user"
,
"deleted"
,
"answerTo"
,
"likesNumber"
,
"reportsNumber"
],
"cluster_properties"
:
[
"likesNumber"
,
"reportsNumber"
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"PUBLICATION"
)
table_name
=
"publication"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ No newline at end of file
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_travel.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"carLicensePlate"
,
"carOwner"
,
"depositBalance"
,
"endDate"
,
"id"
,
"observations"
,
"offerId"
,
"priceBalance"
,
"rentForTime"
,
"rewardBalance"
,
"seats"
,
"startDate"
,
"status"
,
"totalPrice"
,
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"id"
columns
[
"endPlaceAddress"
]
=
"endPlace//address"
columns
[
"endPlaceLatitude"
]
=
"endPlace//latitude"
columns
[
"endPlaceLongitude"
]
=
"endPlace//longitude"
columns
[
"startPlaceAddress"
]
=
"startPlace//address"
columns
[
"startPlaceLatitude"
]
=
"startPlace//latitude"
columns
[
"startPlaceLongitude"
]
=
"startPlace//longitude"
columns
[
"checkedByUser"
]
=
"checkedBy[0]//user"
columns
[
"checkedByMoment"
]
=
"checkedBy[0]//moment"
columns
[
"checkedByLatitude"
]
=
"checkedBy[0]//coordinate//latitude"
columns
[
"checkedByLongitude"
]
=
"checkedBy[0]//coordinate//longitude"
columns
[
"checkedByState"
]
=
"checkedBy[0]//state"
columns
[
"scoreNumber"
]
=
"score//length"
columns
[
"scoreSum"
]
=
"score//sum"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"StartingPoint_Layer"
,
"properties"
:
[
'UniqueID'
,
'startPlaceLatitude'
,
'startPlaceLongitude'
,
'startDate'
,
'endDate'
],
"cluster_properties"
:
[
'startPlaceLatitude'
,
'startPlaceLatitude'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"StartingTime_Layer"
,
"properties"
:
[
'UniqueID'
,
'startDate'
,
'endDate'
],
"cluster_properties"
:
[
'startDate'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"CheckedByLocation_Layer"
,
"properties"
:
[
'UniqueID'
,
'checkedByUser'
,
'checkedByMoment'
,
'checkedByLatitude'
,
'checkedByLongitude'
,
'checkedByState'
,
'startPlaceLatitude'
,
'startPlaceLongitude'
],
"cluster_properties"
:
[
'checkedByLatitude'
,
'checkedByLongitude'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"CheckedByMoment_Layer"
,
"properties"
:
[
'UniqueID'
,
'checkedByUser'
,
'checkedByMoment'
,
'checkedByLatitude'
,
'checkedByLongitude'
,
'checkedByState'
,
'startDate'
,
'startPlaceLatitude'
,
'startPlaceLongitude'
],
"cluster_properties"
:
[
'checkedByMoment'
,
'startDate'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"FinishedTime_Layer"
,
"properties"
:
[
'UniqueID'
,
'startDate'
,
'endDate'
],
"cluster_properties"
:
[
'endDate'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Price_Layer"
,
"properties"
:
[
'UniqueID'
,
'totalPrice'
,
'priceBalance'
,
'depositBalance'
,
'rewardBalance'
],
"cluster_properties"
:
[
'totalPrice'
,
'priceBalance'
,
'depositBalance'
,
'rewardBalance'
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Status_Layer"
,
"properties"
:
[
'UniqueID'
,
'status'
,
'rentForTime'
],
"cluster_properties"
:
[
'status'
,
'rentForTime'
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Score_Layer"
,
"properties"
:
[
'UniqueID'
,
'scoreSum'
,
'scoreNumber'
],
"cluster_properties"
:
[
'scoreSum'
,
'scoreNumber'
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"TRAVEL"
)
table_name
=
"travel"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_travelCancelledBy.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"travelId"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"travelId+user"
columns
[
"moment"
]
=
"travel//cancelledBy[0]//moment"
columns
[
"latitude"
]
=
"travel//cancelledBy[0]//cancellationPlace//latitude"
columns
[
"longitude"
]
=
"travel//cancelledBy[0]//cancellationPlace//longitude"
columns
[
"user"
]
=
"travel//cancelledBy[0]//user"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"CancelledByAtLocation_Layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'moment'
,
'latitude'
,
'longitude'
,
'user'
],
"cluster_properties"
:
[
'latitude'
,
'latitude'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"CancelledByAtMoment_Layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'moment'
,
'latitude'
,
'longitude'
,
'user'
],
"cluster_properties"
:
[
'moment'
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"TRAVEL_CancelledBY"
)
table_name
=
"travelCancelledBy"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_travelFinishedBy.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"travelId"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"travelId+user"
columns
[
"moment"
]
=
"travel//finishedBy[0]//moment"
columns
[
"latitude"
]
=
"travel//finishedBy[0]//endPlace//latitude"
columns
[
"longitude"
]
=
"travel//finishedBy[0]//endPlace//longitude"
columns
[
"user"
]
=
"travel//finishedBy[0]//user"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"FinishedByAtLocation_Layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'moment'
,
'latitude'
,
'longitude'
,
'user'
],
"cluster_properties"
:
[
'latitude'
,
'latitude'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"FinishedByAtMoment_Layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'moment'
,
'latitude'
,
'longitude'
,
'user'
],
"cluster_properties"
:
[
'moment'
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"TRAVEL_FinishedBy"
)
table_name
=
"travelFinishedBy"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_travelStartedBy.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"travelId"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"travelId+user"
columns
[
"moment"
]
=
"travel//startedBy[0]//moment"
columns
[
"latitude"
]
=
"travel//startedBy[0]//startPlace//latitude"
columns
[
"longitude"
]
=
"travel//startedBy[0]//startPlace//longitude"
columns
[
"user"
]
=
"travel//startedBy[0]//user"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"StartedByAtLocation_Layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'moment'
,
'latitude'
,
'longitude'
,
'user'
],
"cluster_properties"
:
[
'latitude'
,
'latitude'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"StartedByAtMoment_Layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'moment'
,
'latitude'
,
'longitude'
,
'user'
],
"cluster_properties"
:
[
'moment'
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"TRAVEL_STARTEDBY"
)
table_name
=
"travelStartedBy"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_travelSuggestedEndPlaces.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"travelId"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"travelId+user"
columns
[
"latitude"
]
=
"travel//suggestedEndPlaces[0]//endPlace//latitude"
columns
[
"longitude"
]
=
"travel//suggestedEndPlaces[0]//endPlace//longitude"
columns
[
"reward"
]
=
"travel//suggestedEndPlaces[0]//reward"
columns
[
"user"
]
=
"travel//suggestedEndPlaces[0]//suggestedBy"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"SuggestedEndPlacesAtLocation_Layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'reward'
,
'latitude'
,
'longitude'
,
'user'
],
"cluster_properties"
:
[
'latitude'
,
'latitude'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"SuggestedEndPlacesAtReward_Layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'reward'
,
'latitude'
,
'longitude'
,
'user'
],
"cluster_properties"
:
[
'reward'
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"TRAVEL_suggestedEndPlaces"
)
table_name
=
"travelSuggestedEndPlaces"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_travelUsers.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"travelId"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"travelId+user"
columns
[
"isDriver"
]
=
"travel//users[0]//userIdisDriver"
columns
[
"passengersNr"
]
=
"ravel//users[0]//passengers"
columns
[
"user"
]
=
"travel//users[0]//userId"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Driver_layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'isDriver'
,
'passengersNr'
,
'user'
],
"cluster_properties"
:
[
'isDriver'
]
},{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"Passangers_layer"
,
"properties"
:
[
'UniqueID'
,
'travelId'
,
'isDriver'
,
'passengersNr'
,
'user'
],
"cluster_properties"
:
[
'passengersNr'
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"TRAVEL_USERS"
)
table_name
=
"travelUsers"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing_official/tables/add_user.py
0 → 100644
View file @
5a3a36af
from
_add_use_case_scripts.requestPost
import
postLayersToSwagger
,
postTableToSwagger
def
add_table
(
use_case
:
str
,
table_name
:
str
):
'''
take the columns and add the mappings at the server
replace all "/"'s in the internal representation with a "_"
'''
columns
=
[
"id"
,
# pk
"balance"
,
"numberOfTripsDone"
,
"role"
,
"sumOfTripsScores"
]
columns
=
{
c
:
c
for
c
in
columns
}
columns
[
"UniqueID"
]
=
"id"
table
=
{
"name"
:
table_name
,
"mappings"
:
columns
}
postTableToSwagger
(
use_case
,
table
)
def
add_layers
(
use_case
:
str
,
table_name
:
str
):
layers
=
[
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"User_layer"
,
"properties"
:
[
"UniqueID"
,
"balance"
,
"role"
,
"numberOfTripsDone"
,
"sumOfTripsScores"
],
"cluster_properties"
:
[
"balance"
,
"numberOfTripsDone"
,
"sumOfTripsScores"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"UserBalance_layer"
,
"properties"
:
[
"UniqueID"
,
"balance"
,
"role"
,
"numberOfTripsDone"
,
"sumOfTripsScores"
],
"cluster_properties"
:
[
"balance"
,
"sumOfTripsScores"
]
},
{
"use_case"
:
use_case
,
"table"
:
table_name
,
"name"
:
"UserVeterancy_layer"
,
"properties"
:
[
"UniqueID"
,
"balance"
,
"role"
,
"numberOfTripsDone"
,
"sumOfTripsScores"
],
"cluster_properties"
:
[
"numberOfTripsDone"
,
"sumOfTripsScores"
]
}
]
postLayersToSwagger
(
use_case
,
layers
)
def
main
(
use_case
:
str
):
print
(
"USER"
)
table_name
=
"user"
add_table
(
use_case
,
table_name
)
add_layers
(
use_case
,
table_name
)
\ 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