syntax = "proto3";

package customer;

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

option go_package = "./customer";

service CustomerService {
  rpc InsertHistory(History) returns (google.protobuf.Empty) {}
  rpc SetAccountVerificationStatus(SetVerificationReq) returns (Account) {}
}

message History {
  string UserID = 1;
  string Comment = 2;
  string Key = 3;
  string RawDetails = 4;
}

message SetVerificationReq {
  string userID = 1;
  AccountStatus status = 2;
}

message Account {
  string id = 1;
  string userID = 2;
  repeated string cart = 3;
  Wallet wallet = 4;
  Name name = 5;
  AccountStatus status = 6;
  bool isDeleted = 7;
  google.protobuf.Timestamp createdAt = 8;
  google.protobuf.Timestamp updatedAt = 9;
  google.protobuf.Timestamp deletedAt = 10;
  string from = 11;
  string partner = 12;
}

message Wallet {
  int64 cash = 1;
  string currency = 2;
  int64 spent = 3;
  int64 purchasesAmount = 4;
  int64 money = 5;
  string lastPaymentId = 6;
}

message Name {
  string middlename = 1;
  string firstname = 2;
  string orgname = 3;
  string secondname = 4;
}

enum AccountStatus {
  nko = 0;
  no = 1;
  org = 2;
}