syntax = "proto3";
package passport;
option go_package = "bsm/full/module/base/passport/pb;passport";
import "protobuf/blocks.proto";

// Passport(会员通行证)-验证
service Verify{
    // 认证请求
    rpc Request(VerifyRequest) returns (blocks.StatusReply) {}

    // KYC 认证回调
    rpc JumioCallback(JumioCallbackPayload) returns (blocks.StatusReply) {}
}

message VerifyRequest {
    string provider = 1; // 服务提供商
    map<string, string> args = 2; // 参数
}

message JumioCallbackPayload {
  string scan_reference = 1;
  string customer_internal_reference = 2;
  VerificationStatus verification_status = 3;
  Document document = 4;
  // 其他可选字段
  PersonalInformation personal_information = 5;
  FaceMap face_map = 6;
  string callback_date = 7;
  string client_ip = 8;
}

message VerificationStatus {
  string state = 1; // "PENDING", "DONE", "FAILED"
  string reason = 2; // 可选字段，失败原因
}

message Document {
  string status = 1; // "APPROVED_VERIFIED", "DENIED_FRAUD", etc.
  string type = 2;   // "PASSPORT", "DRIVER_LICENSE", etc.
  string issuing_country = 3;
  string number = 4;
}

message PersonalInformation {
  string first_name = 1;
  string last_name = 2;
  string date_of_birth = 3;
  string nationality = 4;
}

message FaceMap {
  string status = 1;
  float similarity = 2; // 人脸比对相似度
}