syntax = "proto3";

package acme.user.v1;

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

message LinkedAccount {
    enum Provider {
        GitHub = 0;
        GitLab = 1;
        Stripe = 2;
        Google = 3;
    }
    enum Type {
        IdentityProvider = 0;
        PaymentProvider = 1;
    }

    string id = 1;
    Type type = 2;
    Provider provider = 3;
    string provider_uid = 4;
    optional google.protobuf.Struct metadata = 5;

    google.protobuf.Timestamp created_at = 100;
    optional string created_by_account_id = 101;
    optional google.protobuf.Timestamp deleted_at = 102;
    optional string deleted_by_account_id = 103;
    optional google.protobuf.Timestamp updated_at = 104;
    optional string updated_by_account_id = 105;
    oneof owner {
        string owner_account_id = 106;
    }
}
