syntax = "proto3";
import "google/protobuf/timestamp.proto";
import "type.proto";

//type_url: ec:s:event_info
message EventInfo {
    string title = 1;
    string description = 2;
    uint32 total = 4;
    repeated TicketHolder tickets = 5;
    google.protobuf.Timestamp start_time = 7;
    google.protobuf.Timestamp end_time = 8;
    uint64 ticket_price = 9;
    repeated string participants = 10;
    uint32 remaining = 11;
    string location = 12;
    forge_abi.Transaction consume_tx=13;
}

//type_url: ec:t:update_hosted
//event host send this itx when creating new event to add this event to account.hosted
message UpdateHostedTx {
    string address = 1;
}

//type_url: eventInfo:t:eventInfo
//extend accountState
message ParticipantInfo {
    repeated string hosted = 1;
    repeated string participated = 2;
    repeated string unused = 3;
    repeated string used = 4;
}

//type_url: ec:s:ticket_info
message TicketInfo {
    uint32 id = 3;
    string event_address = 4;
    bool is_used = 5;
}

message TicketHolder {
    forge_abi.Transaction ticket_create = 1;
    forge_abi.Transaction ticket_exchange = 2;
    uint32 id = 4;
    string address = 5;
}
