syntax = "proto3";

package rv.data;

option cc_enable_arenas = true;
option csharp_namespace = "Pro.SerializationInterop.RVProtoData";
option swift_prefix = "RVData_";

import "url.proto";
import "rvtimestamp.proto";
import "presentation.proto";

message PlanningCenterPlan {
  message PlanItem {
    message Attachment {
      string name = 1;
      .rv.data.URL url = 2;
      .rv.data.Timestamp created_date = 3;
      .rv.data.URL linked_path = 4;
      uint32 pco_id_num = 5;
      bool needs_update = 6;
      .rv.data.Timestamp update_date = 7;
      string pco_id_str = 8;
    }

    message SongItem {
      message Sequence {
        uint32 pco_id_num = 1;
        string name = 2;
        repeated string group_names = 3;
        string pco_id_str = 4;
      }

      uint32 pco_id_num = 1;
      uint32 arrangement_id_num = 2;
      .rv.data.Presentation.CCLI ccli = 3;
      .rv.data.PlanningCenterPlan.PlanItem.SongItem.Sequence sequence = 4;
      string pco_id_str = 5;
      string arrangement_id_str = 6;
    }

    enum PlanItemType {
      PLAN_ITEM_TYPE_ITEM = 0;
      PLAN_ITEM_TYPE_SONG = 1;
      PLAN_ITEM_TYPE_MEDIA = 2;
      PLAN_ITEM_TYPE_HEADER = 3;
    }

    .rv.data.PlanningCenterPlan.PlanItem.PlanItemType item_type = 1;
    uint32 pco_id_num = 2;
    uint32 service_id_num = 3;
    uint32 parent_id_num = 4;
    string name = 5;
    repeated .rv.data.PlanningCenterPlan.PlanItem.Attachment attachments = 6;
    .rv.data.Timestamp update_date = 7;
    .rv.data.PlanningCenterPlan.PlanItem.SongItem linked_song = 8;
    string pco_id_str = 9;
    string service_id_str = 10;
    string parent_id_str = 11;
  }

  uint32 plan_id_num = 1;
  uint32 parent_id_num = 2;
  string series_title = 3;
  string plan_title = 4;
  string date_list = 5;
  .rv.data.Timestamp created_date = 6;
  .rv.data.Timestamp update_date = 7;
  .rv.data.Timestamp last_update_check_date = 8;
  string plan_id_str = 9;
  string parent_id_str = 10;
}

