/*
 * 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();

  @FieldType(FieldTypeEnum.ID)
  @ForeignKey(table = "trips.txt", field = "trip_id")
  String fromTripId();

  @FieldType(FieldTypeEnum.ID)
  @ForeignKey(table = "trips.txt", field = "trip_id")
  String toTripId();

  @FieldType(FieldTypeEnum.ID)
  @ForeignKey(table = "routes.txt", field = "route_id")
  String fromRouteId();

  @FieldType(FieldTypeEnum.ID)
  @ForeignKey(table = "routes.txt", field = "route_id")
  String toRouteId();
}

@@ -631,16 +631,100 @@
 table;%0A%0A
+import static org.mobilitydata.gtfsvalidator.annotation.TranslationRecordIdType.*;%0A%0A
 import o
@@ -775,16 +775,16 @@
 ldType;%0A
-
 import o
@@ -1022,16 +1022,77 @@
 gative;%0A
+import org.mobilitydata.gtfsvalidator.annotation.PrimaryKey;%0A
 import o
@@ -1317,32 +1317,83 @@
 ld = %22stop_id%22)%0A
+  @PrimaryKey(translationRecordIdType = RECORD_ID)%0A
   String fromSto
@@ -1493,24 +1493,79 @@
  %22stop_id%22)%0A
+  @PrimaryKey(translationRecordIdType = RECORD_SUB_ID)%0A
   String toS
@@ -1740,32 +1740,85 @@
 ld = %22trip_id%22)%0A
+  @PrimaryKey(translationRecordIdType = UNSUPPORTED)%0A
   String fromTri
@@ -1906,24 +1906,77 @@
  %22trip_id%22)%0A
+  @PrimaryKey(translationRecordIdType = UNSUPPORTED)%0A
   String toT
@@ -2064,32 +2064,85 @@
 d = %22route_id%22)%0A
+  @PrimaryKey(translationRecordIdType = UNSUPPORTED)%0A
   String fromRou
@@ -2173,32 +2173,32 @@
 eldTypeEnum.ID)%0A
-
   @ForeignKey(ta
@@ -2237,16 +2237,69 @@
 te_id%22)%0A
+  @PrimaryKey(translationRecordIdType = UNSUPPORTED)%0A
   String

apply multi-pk to transfer schema (#1220)