syntax = "proto3";

package nexuscrm.runtime.v1;

import "common/v1/common.proto";

option go_package = "github.com/pingcap-inc/nexuscrm-contract/wire-go/gen/runtime/v1;runtimev1";

// RecycleBinMutationService restores or permanently purges one deleted record.
// Product URL grammar and response/error projection remain caller-owned.
service RecycleBinMutationService {
  rpc RestoreRecycleBin(RestoreRecycleBinRequest) returns (RestoreRecycleBinResponse);
  rpc PurgeRecycleBin(PurgeRecycleBinRequest) returns (PurgeRecycleBinResponse);
}

// Identity and authority are authenticated transport context. The method name
// is the single owner of the requested operation.
message RestoreRecycleBinRequest {
  string record_id = 1;
  optional uint64 min_catalog_revision = 2;
}

message RestoreRecycleBinResponse {
  nexuscrm.common.v1.ConsistencyReceipts receipts = 1;
}

message PurgeRecycleBinRequest {
  string record_id = 1;
  optional uint64 min_catalog_revision = 2;
}

message PurgeRecycleBinResponse {
  nexuscrm.common.v1.ConsistencyReceipts receipts = 1;
}
