syntax = "proto2";

option java_package = "com.wire.events";
option java_outer_classname = "TeamEvents";

message TeamEvent {
    required EventType event_type = 1;
    required bytes team_id = 2;
    required int64 utc_time = 3;
    optional EventData event_data = 4;

    message EventData {
        required int32  member_count = 1;
        repeated bytes  billing_user = 2;
        optional string currency     = 3; // ISO_4217

        // the following fields are at the end of the declaration
        // for backwards compatibility.
        //
        // this declaration is used to generate producer code, so it
        // is ok and desirable to make this fields mandatory (they
        // are guaranteed to be present).
        //
        // for backwards compatibility, clients should make these
        // fields optional, and fall back to using `member_count` if
        // they are missing.
        required int32  member_count_regular = 4;
        required int32  member_count_app = 5;
    }

    enum EventType {
        TEAM_ACTIVATE = 0;
        TEAM_DELETE   = 1;
        TEAM_UPDATE   = 2;
        TEAM_SUSPEND  = 3;
    }
}
