@@ -142,10 +142,10 @@ struct CommentLink {
142
142
}
143
143
144
144
#[ derive( Serialize , Deserialize , Debug , Clone ) ]
145
- struct ODTReservationLink {
145
+ struct BookingRuleLink {
146
146
object_id : String ,
147
147
object_type : ObjectType ,
148
- odt_reservation_id : String ,
148
+ booking_rule_id : String ,
149
149
}
150
150
151
151
#[ derive( Serialize , Deserialize , Debug , Clone ) ]
@@ -338,7 +338,7 @@ where
338
338
read:: manage_stop_times ( & mut collections, file_handler) ?;
339
339
read:: manage_codes ( & mut collections, file_handler) ?;
340
340
read:: manage_comments ( & mut collections, file_handler) ?;
341
- read:: manage_odt_reservations ( & mut collections, file_handler) ?;
341
+ read:: manage_booking_rules ( & mut collections, file_handler) ?;
342
342
read:: manage_object_properties ( & mut collections, file_handler) ?;
343
343
read:: manage_fares_v1 ( & mut collections, file_handler) ?;
344
344
read:: manage_companies_on_vj ( & mut collections) ?;
@@ -413,7 +413,7 @@ pub fn write<P: AsRef<path::Path>>(
413
413
& model. stop_locations ,
414
414
) ?;
415
415
write:: write_comments ( path, model) ?;
416
- write:: write_odt_reservations ( path, model) ?;
416
+ write:: write_booking_rules ( path, model) ?;
417
417
write:: write_codes ( path, model) ?;
418
418
write:: write_object_properties ( path, model) ?;
419
419
write:: write_fares_v1 ( path, model) ?;
@@ -533,7 +533,7 @@ mod tests {
533
533
( "feed_end_date" . to_string( ) , "20180131" . to_string( ) ) ,
534
534
( "feed_publisher_name" . to_string( ) , "Nicaragua" . to_string( ) ) ,
535
535
( "feed_start_date" . to_string( ) , "20180130" . to_string( ) ) ,
536
- ( "ntfs_version" . to_string( ) , "0.16.1 " . to_string( ) ) ,
536
+ ( "ntfs_version" . to_string( ) , "0.17.0 " . to_string( ) ) ,
537
537
( "tartare_platform" . to_string( ) , "dev" . to_string( ) ) ,
538
538
] ,
539
539
collections
@@ -622,7 +622,7 @@ mod tests {
622
622
codes: KeysValues :: default ( ) ,
623
623
object_properties: PropertiesMap :: default ( ) ,
624
624
comment_links: LinksT :: default ( ) ,
625
- odt_reservation_links : LinksT :: default ( ) ,
625
+ booking_rule_links : LinksT :: default ( ) ,
626
626
forward_name: Some ( "Hôtels - Hôtels" . to_string( ) ) ,
627
627
backward_name: Some ( "Hôtels - Hôtels" . to_string( ) ) ,
628
628
color: Some ( Rgb {
@@ -649,7 +649,7 @@ mod tests {
649
649
codes: KeysValues :: default ( ) ,
650
650
object_properties: PropertiesMap :: default ( ) ,
651
651
comment_links: LinksT :: default ( ) ,
652
- odt_reservation_links : LinksT :: default ( ) ,
652
+ booking_rule_links : LinksT :: default ( ) ,
653
653
forward_name: None ,
654
654
backward_name: None ,
655
655
color: None ,
@@ -751,7 +751,7 @@ mod tests {
751
751
codes: KeysValues :: default ( ) ,
752
752
object_properties: PropertiesMap :: default ( ) ,
753
753
comment_links: LinksT :: default ( ) ,
754
- odt_reservation_links : LinksT :: default ( ) ,
754
+ booking_rule_links : LinksT :: default ( ) ,
755
755
route_id: "OIF:078078001:1" . to_string( ) ,
756
756
physical_mode_id: "Bus" . to_string( ) ,
757
757
dataset_id: "OIF:0" . to_string( ) ,
@@ -795,7 +795,7 @@ mod tests {
795
795
codes: KeysValues :: default ( ) ,
796
796
object_properties: PropertiesMap :: default ( ) ,
797
797
comment_links: LinksT :: default ( ) ,
798
- odt_reservation_links : LinksT :: default ( ) ,
798
+ booking_rule_links : LinksT :: default ( ) ,
799
799
route_id: "OIF:800:TER" . to_string( ) ,
800
800
physical_mode_id: "Bus" . to_string( ) ,
801
801
dataset_id: "OIF:0" . to_string( ) ,
@@ -1099,30 +1099,30 @@ mod tests {
1099
1099
] )
1100
1100
. unwrap ( ) ;
1101
1101
1102
- let odt_reservations = CollectionWithId :: new ( vec ! [
1103
- ODTReservation {
1102
+ let booking_rules = CollectionWithId :: new ( vec ! [
1103
+ BookingRule {
1104
1104
id: "odt:1" . to_string( ) ,
1105
1105
name: Some ( "name:1" . to_string( ) ) ,
1106
- url : Some ( "https://reservation1" . to_string( ) ) ,
1106
+ info_url : Some ( "https://reservation1" . to_string( ) ) ,
1107
1107
phone: Some ( "01 02 03 04 01" . to_string( ) ) ,
1108
- condition : Some ( "lundi au vendredi de 9h à 18h" . to_string( ) ) ,
1109
- deeplink : Some ( "https://deeplink1" . to_string( ) ) ,
1108
+ message : Some ( "lundi au vendredi de 9h à 18h" . to_string( ) ) ,
1109
+ booking_url : Some ( "https://deeplink1" . to_string( ) ) ,
1110
1110
} ,
1111
- ODTReservation {
1111
+ BookingRule {
1112
1112
id: "odt:2" . to_string( ) ,
1113
1113
name: None ,
1114
- url : Some ( "https://reservation2" . to_string( ) ) ,
1114
+ info_url : Some ( "https://reservation2" . to_string( ) ) ,
1115
1115
phone: Some ( "01 02 03 04 02" . to_string( ) ) ,
1116
- condition : Some ( "lundi au samedi de 8h à 15h" . to_string( ) ) ,
1117
- deeplink : Some ( "https://deeplink2" . to_string( ) ) ,
1116
+ message : Some ( "lundi au samedi de 8h à 15h" . to_string( ) ) ,
1117
+ booking_url : Some ( "https://deeplink2" . to_string( ) ) ,
1118
1118
} ,
1119
- ODTReservation {
1119
+ BookingRule {
1120
1120
id: "odt:3" . to_string( ) ,
1121
1121
name: Some ( "name:3" . to_string( ) ) ,
1122
- url : Some ( "https://reservation3" . to_string( ) ) ,
1122
+ info_url : Some ( "https://reservation3" . to_string( ) ) ,
1123
1123
phone: Some ( "01 02 03 04 03" . to_string( ) ) ,
1124
- condition : Some ( "lundi au mardi de 9h à 10h" . to_string( ) ) ,
1125
- deeplink : Some ( "https://deeplink3" . to_string( ) ) ,
1124
+ message : Some ( "lundi au mardi de 9h à 10h" . to_string( ) ) ,
1125
+ booking_url : Some ( "https://deeplink3" . to_string( ) ) ,
1126
1126
} ,
1127
1127
] )
1128
1128
. unwrap ( ) ;
@@ -1188,7 +1188,7 @@ mod tests {
1188
1188
"prop_value:3" . to_string( )
1189
1189
) ] ,
1190
1190
comment_links : btree_set_from_vec ( vec ! [ "c:1" . to_string( ) ] ) ,
1191
- odt_reservation_links : btree_set_from_vec ( vec ! [ "odt:1" . to_string( ) ] ) ,
1191
+ booking_rule_links : btree_set_from_vec ( vec ! [ "odt:1" . to_string( ) ] ) ,
1192
1192
forward_name : None ,
1193
1193
backward_name : None ,
1194
1194
color : None ,
@@ -1230,7 +1230,7 @@ mod tests {
1230
1230
"prop_value:6" . to_string( )
1231
1231
) ] ,
1232
1232
comment_links : LinksT :: default ( ) ,
1233
- odt_reservation_links : btree_set_from_vec ( vec ! [ "odt:2" . to_string( ) ] ) ,
1233
+ booking_rule_links : btree_set_from_vec ( vec ! [ "odt:2" . to_string( ) ] ) ,
1234
1234
route_id : "OIF:800:TER" . to_string ( ) ,
1235
1235
physical_mode_id : "Bus" . to_string ( ) ,
1236
1236
dataset_id : "OIF:0" . to_string ( ) ,
@@ -1275,7 +1275,7 @@ mod tests {
1275
1275
stop_time_comments. insert ( ( "VJ:1" . to_string ( ) , 0 ) , "c:2" . to_string ( ) ) ;
1276
1276
1277
1277
ser_collections. comments = comments;
1278
- ser_collections. odt_reservations = odt_reservations ;
1278
+ ser_collections. booking_rules = booking_rules ;
1279
1279
ser_collections. stop_areas = stop_areas;
1280
1280
ser_collections. stop_points = stop_points;
1281
1281
ser_collections. stop_locations = stop_locations;
@@ -1306,7 +1306,7 @@ mod tests {
1306
1306
)
1307
1307
. unwrap ( ) ;
1308
1308
write:: write_comments ( path, & ser_collections) . unwrap ( ) ;
1309
- write:: write_odt_reservations ( path, & ser_collections) . unwrap ( ) ;
1309
+ write:: write_booking_rules ( path, & ser_collections) . unwrap ( ) ;
1310
1310
write:: write_codes ( path, & ser_collections) . unwrap ( ) ;
1311
1311
write:: write_object_properties ( path, & ser_collections) . unwrap ( ) ;
1312
1312
let mut handler = PathFileHandler :: new ( path. to_path_buf ( ) ) ;
@@ -1321,15 +1321,12 @@ mod tests {
1321
1321
read:: manage_stops ( & mut des_collections, & mut handler) . unwrap ( ) ;
1322
1322
read:: manage_stop_times ( & mut des_collections, & mut handler) . unwrap ( ) ;
1323
1323
read:: manage_comments ( & mut des_collections, & mut handler) . unwrap ( ) ;
1324
- read:: manage_odt_reservations ( & mut des_collections, & mut handler) . unwrap ( ) ;
1324
+ read:: manage_booking_rules ( & mut des_collections, & mut handler) . unwrap ( ) ;
1325
1325
read:: manage_codes ( & mut des_collections, & mut handler) . unwrap ( ) ;
1326
1326
read:: manage_object_properties ( & mut des_collections, & mut handler) . unwrap ( ) ;
1327
1327
1328
1328
assert_eq ! ( ser_collections. comments, des_collections. comments) ;
1329
- assert_eq ! (
1330
- ser_collections. odt_reservations,
1331
- des_collections. odt_reservations
1332
- ) ;
1329
+ assert_eq ! ( ser_collections. booking_rules, des_collections. booking_rules) ;
1333
1330
1334
1331
// test comment links
1335
1332
assert_eq ! (
@@ -1415,31 +1412,31 @@ mod tests {
1415
1412
des_collections. stop_time_comments
1416
1413
) ;
1417
1414
1418
- // test odt reservation links
1415
+ // test booking rule links
1419
1416
assert_eq ! (
1420
1417
ser_collections
1421
1418
. lines
1422
1419
. get( "OIF:002002003:3OIF829" )
1423
1420
. unwrap( )
1424
- . odt_reservation_links ,
1421
+ . booking_rule_links ,
1425
1422
des_collections
1426
1423
. lines
1427
1424
. get( "OIF:002002003:3OIF829" )
1428
1425
. unwrap( )
1429
- . odt_reservation_links
1426
+ . booking_rule_links
1430
1427
) ;
1431
1428
1432
1429
assert_eq ! (
1433
1430
ser_collections
1434
1431
. vehicle_journeys
1435
1432
. get( "VJ:1" )
1436
1433
. unwrap( )
1437
- . odt_reservation_links ,
1434
+ . booking_rule_links ,
1438
1435
des_collections
1439
1436
. vehicle_journeys
1440
1437
. get( "VJ:1" )
1441
1438
. unwrap( )
1442
- . odt_reservation_links
1439
+ . booking_rule_links
1443
1440
) ;
1444
1441
1445
1442
// test codes
0 commit comments