syntax = "proto3";

package exocore.store;

import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";

message Entity {
    string id = 1;

    repeated Trait traits = 4;

    google.protobuf.Timestamp creation_date = 5;

    google.protobuf.Timestamp modification_date = 6;

    google.protobuf.Timestamp deletion_date = 7;

    uint64 last_operation_id = 8;
}

message Trait {
    string id = 1;

    google.protobuf.Any message = 2;

    google.protobuf.Timestamp creation_date = 3;

    google.protobuf.Timestamp modification_date = 4;

    google.protobuf.Timestamp deletion_date = 6;

    uint64 last_operation_id = 7;

    TraitDetails details = 5;
}

message Reference {
    string entity_id = 1;

    string trait_id = 2;
}

enum TraitDetails {
    TRAIT_DETAILS_FULL = 0;
    TRAIT_DETAILS_PARTIAL = 1;
}