/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.mobilitydata.gtfsvalidator.table;

import org.mobilitydata.gtfsvalidator.annotation.FieldType;
import org.mobilitydata.gtfsvalidator.annotation.FieldTypeEnum;
import org.mobilitydata.gtfsvalidator.annotation.ForeignKey;
import org.mobilitydata.gtfsvalidator.annotation.GtfsTable;
import org.mobilitydata.gtfsvalidator.annotation.NonNegative;
import org.mobilitydata.gtfsvalidator.annotation.Required;

@GtfsTable("transfers.txt")
public interface GtfsTransferSchema extends GtfsEntity {
  @FieldType(FieldTypeEnum.ID)
  @Required
  @ForeignKey(table = "stops.txt", field = "stop_id")
  String fromStopId();

  @FieldType(FieldTypeEnum.ID)
  @Required
  @ForeignKey(table = "stops.txt", field = "stop_id")
  String toStopId();

  @Required
  GtfsTransferType transferType();

  @NonNegative
  int minTransferTime();
}

@@ -1410,11 +1410,449 @@
 rTime();
+%0A%0A  @FieldType(FieldTypeEnum.ID)%0A  @ForeignKey(table = %22trips.txt%22, field = %22trip_id%22)%0A  String fromTripId();%0A%0A  @FieldType(FieldTypeEnum.ID)%0A  @ForeignKey(table = %22trips.txt%22, field = %22trip_id%22)%0A  String toTripId();%0A%0A  @FieldType(FieldTypeEnum.ID)%0A  @ForeignKey(table = %22routes.txt%22, field = %22route_id%22)%0A  String fromRouteId();%0A%0A  @FieldType(FieldTypeEnum.ID)%0A  @ForeignKey(table = %22routes.txt%22, field = %22route_id%22)%0A  String toRouteId();
 %0A%7D%0A

add trip-to-trip and route-to-route fields to transfers (#1208)