From c1d974139d3e0d3ba27f20adf13409a8b30413d1 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Sat, 26 Oct 2024 07:45:36 +0300 Subject: [PATCH 1/7] wip: cancellation message types and services --- .../cmp/services/cancellation/v1/accept.proto | 27 +++++++++++++ .../cancellation/v1/accept_counter.proto | 27 +++++++++++++ .../cancellation/v1/cancel_proposal.proto | 23 +++++++++++ .../services/cancellation/v1/counter.proto | 27 +++++++++++++ .../services/cancellation/v1/initiate.proto | 25 ++++++++++++ .../cmp/services/cancellation/v1/reject.proto | 39 +++++++++++++++++++ .../services/cancellation/v1/services.proto | 30 ++++++++++++++ 7 files changed, 198 insertions(+) create mode 100644 proto/cmp/services/cancellation/v1/accept.proto create mode 100644 proto/cmp/services/cancellation/v1/accept_counter.proto create mode 100644 proto/cmp/services/cancellation/v1/cancel_proposal.proto create mode 100644 proto/cmp/services/cancellation/v1/counter.proto create mode 100644 proto/cmp/services/cancellation/v1/initiate.proto create mode 100644 proto/cmp/services/cancellation/v1/reject.proto create mode 100644 proto/cmp/services/cancellation/v1/services.proto diff --git a/proto/cmp/services/cancellation/v1/accept.proto b/proto/cmp/services/cancellation/v1/accept.proto new file mode 100644 index 0000000..ab7dee7 --- /dev/null +++ b/proto/cmp/services/cancellation/v1/accept.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package cmp.services.cancellation.v1; + +import "cmp/types/v1/common.proto"; +import "cmp/types/v2/price.proto"; + +// Request for cancellation acceptance +message AcceptCancellationRequest { + // Request header + optional cmp.types.v1.RequestHeader header = 1; + + // Cancellation token ID + optional uint64 token_id = 2; + + // Refund amount to validate the acceptance on-chain + optional cmp.types.v2.Price refund_amount = 3; +} + +// Response for cancellation acceptance +message AcceptCancellationResponse { + // Response header + optional cmp.types.v1.ResponseHeader header = 1; + + // Accept cancellation transaction ID + optional string transaction_id = 2; +} diff --git a/proto/cmp/services/cancellation/v1/accept_counter.proto b/proto/cmp/services/cancellation/v1/accept_counter.proto new file mode 100644 index 0000000..f214b11 --- /dev/null +++ b/proto/cmp/services/cancellation/v1/accept_counter.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package cmp.services.cancellation.v1; + +import "cmp/types/v1/common.proto"; +import "cmp/types/v2/price.proto"; + +// Request for counter cancellation acceptance +message AcceptCounterCancellationRequest { + // Request header + optional cmp.types.v1.RequestHeader header = 1; + + // Cancellation token ID + optional uint64 token_id = 2; + + // Refund amount to validate the acceptance on-chain + optional cmp.types.v2.Price refund_amount = 3; +} + +// Response for counter cancellation acceptance +message AcceptCounterCancellationResponse { + // Response header + optional cmp.types.v1.ResponseHeader header = 1; + + // Accept counter cancellation transaction ID + optional string transaction_id = 2; +} diff --git a/proto/cmp/services/cancellation/v1/cancel_proposal.proto b/proto/cmp/services/cancellation/v1/cancel_proposal.proto new file mode 100644 index 0000000..b1e932a --- /dev/null +++ b/proto/cmp/services/cancellation/v1/cancel_proposal.proto @@ -0,0 +1,23 @@ +syntax = "proto3"; + +package cmp.services.cancellation.v1; + +import "cmp/types/v1/common.proto"; + +// Request for cancelling an active cancellation proposal +message CancelCancellationRequest { + // Request header + optional cmp.types.v1.RequestHeader header = 1; + + // Cancellation token ID + optional uint64 token_id = 2; +} + +// Response for cancelling an active cancellation proposal +message CancelCancellationResponse { + // Response header + optional cmp.types.v1.ResponseHeader header = 1; + + // Accept cancellation transaction ID + optional string transaction_id = 2; +} diff --git a/proto/cmp/services/cancellation/v1/counter.proto b/proto/cmp/services/cancellation/v1/counter.proto new file mode 100644 index 0000000..80bf030 --- /dev/null +++ b/proto/cmp/services/cancellation/v1/counter.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package cmp.services.cancellation.v1; + +import "cmp/types/v1/common.proto"; +import "cmp/types/v2/price.proto"; + +// Request for countering a cancellation +message CounterCancellationRequest { + // Request header + optional cmp.types.v1.RequestHeader header = 1; + + // Cancellation token ID + optional uint64 token_id = 2; + + // Refund amount to counter the cancellation proposal with + optional cmp.types.v2.Price refund_amount = 3; +} + +// Response for countering a cancellation +message CounterCancellationResponse { + // Response header + optional cmp.types.v1.ResponseHeader header = 1; + + // Counter cancellation transaction ID + optional string transaction_id = 2; +} diff --git a/proto/cmp/services/cancellation/v1/initiate.proto b/proto/cmp/services/cancellation/v1/initiate.proto new file mode 100644 index 0000000..3e0a059 --- /dev/null +++ b/proto/cmp/services/cancellation/v1/initiate.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package cmp.services.cancellation.v1; + +import "cmp/types/v1/common.proto"; +import "cmp/types/v2/price.proto"; + +message InitiateCancellationRequest { + // The request header + cmp.types.v1.RequestHeader header = 1; + + // The token id of the booking to be cancelled + uint64 token_id = 2; + + // The amount to be refunded + cmp.types.v2.Price refund_amount = 3; +} + +message InitiateCancellationResponse { + // The response header + cmp.types.v1.ResponseHeader header = 1; + + // Transaction id for the initiate cancellation request + string transaction_id = 2; +} diff --git a/proto/cmp/services/cancellation/v1/reject.proto b/proto/cmp/services/cancellation/v1/reject.proto new file mode 100644 index 0000000..cbf6a83 --- /dev/null +++ b/proto/cmp/services/cancellation/v1/reject.proto @@ -0,0 +1,39 @@ +syntax = "proto3"; + +package cmp.services.cancellation.v1; + +import "cmp/types/v1/common.proto"; + +// Request for cancellation rejection +message RejectCancellationRequest { + // Request Header + cmp.types.v1.RequestHeader header = 1; + + // Token ID to reject the cancellation for (Booking Token) + uint64 token_id = 2; + + // Reason for rejection + cmp.services.cancellation.v1.CancellationRejectionReason reason = 3; +} + +// Response for cancellation rejection +message RejectCancellationResponse { + // Response Header + cmp.types.v1.ResponseHeader header = 1; + + // Transaction id for the rejected cancellation + string transaction_id = 2; +} + +enum CancellationRejectionReason { + CANCELLATION_REJECTION_REASON_UNSPECIFIED = 0; + CANCELLATION_REJECTION_REASON_TECHNICAL_ERROR = 1; + CANCELLATION_REJECTION_REASON_INVALID_SERVICE_OR_BOOKING_REFERENCE = 2; + CANCELLATION_REJECTION_REASON_BOOKING_IS_ALREADY_CANCELLED = 3; + CANCELLATION_REJECTION_REASON_SERVICE_HAS_STARTED_OR_HAS_BEEN_DELIVERED = 4; + CANCELLATION_REJECTION_REASON_CANCELLATION_WINDOW_EXPIRED = 5; + CANCELLATION_REJECTION_REASON_SERVICE_CANNOT_BE_CANCELLED_ONLINE = 6; + CANCELLATION_REJECTION_REASON_RATE_OR_FARE_CANNOT_BE_CANCELLED = 7; + CANCELLATION_REJECTION_REASON_ENTIRE_PACKAGE_MUST_BE_CANCELLED = 8; // Service forms part of a package, the entire package must be cancelled + CANCELLATION_REJECTION_REASON_REFUND_CURRENCY_NOT_SUPPORTED = 9; +} diff --git a/proto/cmp/services/cancellation/v1/services.proto b/proto/cmp/services/cancellation/v1/services.proto new file mode 100644 index 0000000..3a19769 --- /dev/null +++ b/proto/cmp/services/cancellation/v1/services.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; + +package cmp.services.cancellation.v1; + +import "cmp/services/cancellation/v1/accept.proto"; +import "cmp/services/cancellation/v1/accept_counter.proto"; +import "cmp/services/cancellation/v1/cancel_proposal.proto"; +import "cmp/services/cancellation/v1/counter.proto"; +import "cmp/services/cancellation/v1/initiate.proto"; +import "cmp/services/cancellation/v1/reject.proto"; + +service CancellationService { + // Initiate cancellation + rpc InitiateCancellation(InitiateCancellationRequest) returns (InitiateCancellationResponse) {} + + // Accept cancellation + rpc AcceptCancellation(AcceptCancellationRequest) returns (AcceptCancellationResponse) {} + + // Reject cancellation + rpc RejectCancellation(RejectCancellationRequest) returns (RejectCancellationResponse) {} + + // Counter cancellation + rpc CounterCancellation(CounterCancellationRequest) returns (CounterCancellationResponse) {} + + // Accept countered cancellation + rpc AcceptCounterCancellation(AcceptCounterCancellationRequest) returns (AcceptCounterCancellationResponse) {} + + // Cancel cancellation proposal + rpc CancelCancellation(CancelCancellationRequest) returns (CancelCancellationResponse) {} +} From 8af270bf5952d096256e4bbc3a183121ced09e3b Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Sat, 26 Oct 2024 08:01:08 +0300 Subject: [PATCH 2/7] add diagram urls --- proto/cmp/services/cancellation/v1/accept.proto | 4 ++++ proto/cmp/services/cancellation/v1/services.proto | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/proto/cmp/services/cancellation/v1/accept.proto b/proto/cmp/services/cancellation/v1/accept.proto index ab7dee7..eab5f54 100644 --- a/proto/cmp/services/cancellation/v1/accept.proto +++ b/proto/cmp/services/cancellation/v1/accept.proto @@ -6,6 +6,10 @@ import "cmp/types/v1/common.proto"; import "cmp/types/v2/price.proto"; // Request for cancellation acceptance +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/accept.proto.dot.xs.svg) +// +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/accept.proto.dot.svg) message AcceptCancellationRequest { // Request header optional cmp.types.v1.RequestHeader header = 1; diff --git a/proto/cmp/services/cancellation/v1/services.proto b/proto/cmp/services/cancellation/v1/services.proto index 3a19769..ed13c86 100644 --- a/proto/cmp/services/cancellation/v1/services.proto +++ b/proto/cmp/services/cancellation/v1/services.proto @@ -9,6 +9,11 @@ import "cmp/services/cancellation/v1/counter.proto"; import "cmp/services/cancellation/v1/initiate.proto"; import "cmp/services/cancellation/v1/reject.proto"; +// Cancellation service +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/services.proto.dot.xs.svg) +// +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/services.proto.dot.svg) service CancellationService { // Initiate cancellation rpc InitiateCancellation(InitiateCancellationRequest) returns (InitiateCancellationResponse) {} From 7dc31dfa2069db48944e1b32f8a689c5dbfd6ca6 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Mon, 28 Oct 2024 12:15:15 +0300 Subject: [PATCH 3/7] add notifications for cancellation events --- buf.yaml | 1 + .../cmp/services/notification/v1/notify.proto | 5 ++ .../cmp/services/notification/v2/notify.proto | 81 +++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 proto/cmp/services/notification/v2/notify.proto diff --git a/buf.yaml b/buf.yaml index 86367be..980b97e 100644 --- a/buf.yaml +++ b/buf.yaml @@ -8,6 +8,7 @@ lint: ignore_only: RPC_REQUEST_STANDARD_NAME: - proto/cmp/services/notification/v1/notify.proto + - proto/cmp/services/notification/v2/notify.proto rpc_allow_google_protobuf_empty_responses: true breaking: use: diff --git a/proto/cmp/services/notification/v1/notify.proto b/proto/cmp/services/notification/v1/notify.proto index 6b75a7c..817dff4 100644 --- a/proto/cmp/services/notification/v1/notify.proto +++ b/proto/cmp/services/notification/v1/notify.proto @@ -16,6 +16,11 @@ message TokenExpired { cmp.types.v1.UUID mint_id = 2; } +// Notification service for different events that the partner should be notified about +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/notification/v2/notify.proto.dot.xs.svg) +// +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/notification/v2/notify.proto.dot.svg) service NotificationService { rpc TokenBoughtNotification(TokenBought) returns (google.protobuf.Empty); rpc TokenExpiredNotification(TokenExpired) returns (google.protobuf.Empty); diff --git a/proto/cmp/services/notification/v2/notify.proto b/proto/cmp/services/notification/v2/notify.proto new file mode 100644 index 0000000..3364dda --- /dev/null +++ b/proto/cmp/services/notification/v2/notify.proto @@ -0,0 +1,81 @@ +syntax = "proto3"; + +package cmp.services.notification.v2; + +import "cmp/services/cancellation/v1/reject.proto"; +import "cmp/types/v1/uuid.proto"; +import "google/protobuf/empty.proto"; + +// Notification service for different events that the partner should be notified about +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/notification/v2/notify.proto.dot.xs.svg) +// +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/notification/v2/notify.proto.dot.svg) +service NotificationService { + rpc TokenBoughtNotification(TokenBought) returns (google.protobuf.Empty); + rpc TokenExpiredNotification(TokenExpired) returns (google.protobuf.Empty); + rpc CancellationPendingNotification(CancellationPending) returns (google.protobuf.Empty); + rpc CancellationAcceptedNotification(CancellationAccepted) returns (google.protobuf.Empty); + rpc CancellationProposalAcceptedByTheOwnerNotification(CancellationProposalAcceptedByTheOwner) returns (google.protobuf.Empty); + rpc CancellationCounteredNotification(CancellationCountered) returns (google.protobuf.Empty); + rpc CancellationProposalCancelledNotification(CancellationProposalCancelled) returns (google.protobuf.Empty); + rpc CancellationRejectedNotification(CancellationRejected) returns (google.protobuf.Empty); +} + +message TokenBought { + uint64 token_id = 1; + string tx_id = 2; + cmp.types.v1.UUID mint_id = 3; +} + +message TokenExpired { + uint64 token_id = 1; + cmp.types.v1.UUID mint_id = 2; +} + +// event CancellationPending(uint256 indexed tokenId, address indexed proposedBy, uint256 refundAmount); +message CancellationPending { + uint64 token_id = 1; + string proposed_by = 2; + uint64 refund_amount = 3; + string tx_id = 4; +} + +// event CancellationAccepted(uint256 indexed tokenId, address indexed acceptedBy, uint256 refundAmount); +message CancellationAccepted { + uint64 token_id = 1; + string accepted_by = 2; + uint64 refund_amount = 3; + string tx_id = 4; +} + +// event CancellationProposalAcceptedByTheOwner(uint256 indexed tokenId, address indexed acceptedBy, uint256 refundAmount); +message CancellationProposalAcceptedByTheOwner { + uint64 token_id = 1; + string accepted_by = 2; + uint64 refund_amount = 3; + string tx_id = 4; +} + +// event CancellationCountered(uint256 indexed tokenId, address indexed counteredBy, uint256 newRefundAmount); +message CancellationCountered { + uint64 token_id = 1; + string countered_by = 2; + uint64 new_refund_amount = 3; + string tx_id = 4; +} + +// event CancellationProposalCancelled(uint256 indexed tokenId, address indexed cancelledBy); +message CancellationProposalCancelled { + uint64 token_id = 1; + string cancelled_by = 2; + string tx_id = 3; +} + +// event CancellationRejected(uint256 indexed tokenId, address indexed rejectedBy, CancellationRejectionReason reason); +message CancellationRejected { + uint64 token_id = 1; + string rejected_by = 2; + cmp.services.cancellation.v1.CancellationRejectionReason reason = 3; + string tx_id = 4; +} From 36eafd6b4ac66ef16c8709140d329693e7fdcfe5 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Mon, 28 Oct 2024 12:26:01 +0300 Subject: [PATCH 4/7] fix notification v1 diagram url --- proto/cmp/services/notification/v1/notify.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/cmp/services/notification/v1/notify.proto b/proto/cmp/services/notification/v1/notify.proto index 817dff4..27045c0 100644 --- a/proto/cmp/services/notification/v1/notify.proto +++ b/proto/cmp/services/notification/v1/notify.proto @@ -18,9 +18,9 @@ message TokenExpired { // Notification service for different events that the partner should be notified about // -// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/notification/v2/notify.proto.dot.xs.svg) +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/notification/v1/notify.proto.dot.xs.svg) // -// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/notification/v2/notify.proto.dot.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/notification/v1/notify.proto.dot.svg) service NotificationService { rpc TokenBoughtNotification(TokenBought) returns (google.protobuf.Empty); rpc TokenExpiredNotification(TokenExpired) returns (google.protobuf.Empty); From c4dd8d4bc721f1e5fad37f89357c3fbbab5db566 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Thu, 31 Oct 2024 02:23:14 +0300 Subject: [PATCH 5/7] add check cancellation service and types --- .../cmp/services/cancellation/v1/accept.proto | 10 ++-- .../cancellation/v1/accept_counter.proto | 10 ++-- .../cancellation/v1/cancel_proposal.proto | 8 +-- .../cmp/services/cancellation/v1/check.proto | 58 +++++++++++++++++++ .../services/cancellation/v1/counter.proto | 10 ++-- 5 files changed, 77 insertions(+), 19 deletions(-) create mode 100644 proto/cmp/services/cancellation/v1/check.proto diff --git a/proto/cmp/services/cancellation/v1/accept.proto b/proto/cmp/services/cancellation/v1/accept.proto index eab5f54..8e6488a 100644 --- a/proto/cmp/services/cancellation/v1/accept.proto +++ b/proto/cmp/services/cancellation/v1/accept.proto @@ -12,20 +12,20 @@ import "cmp/types/v2/price.proto"; // [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/accept.proto.dot.svg) message AcceptCancellationRequest { // Request header - optional cmp.types.v1.RequestHeader header = 1; + cmp.types.v1.RequestHeader header = 1; // Cancellation token ID - optional uint64 token_id = 2; + uint64 token_id = 2; // Refund amount to validate the acceptance on-chain - optional cmp.types.v2.Price refund_amount = 3; + cmp.types.v2.Price refund_amount = 3; } // Response for cancellation acceptance message AcceptCancellationResponse { // Response header - optional cmp.types.v1.ResponseHeader header = 1; + cmp.types.v1.ResponseHeader header = 1; // Accept cancellation transaction ID - optional string transaction_id = 2; + string transaction_id = 2; } diff --git a/proto/cmp/services/cancellation/v1/accept_counter.proto b/proto/cmp/services/cancellation/v1/accept_counter.proto index f214b11..9464a78 100644 --- a/proto/cmp/services/cancellation/v1/accept_counter.proto +++ b/proto/cmp/services/cancellation/v1/accept_counter.proto @@ -8,20 +8,20 @@ import "cmp/types/v2/price.proto"; // Request for counter cancellation acceptance message AcceptCounterCancellationRequest { // Request header - optional cmp.types.v1.RequestHeader header = 1; + cmp.types.v1.RequestHeader header = 1; // Cancellation token ID - optional uint64 token_id = 2; + uint64 token_id = 2; // Refund amount to validate the acceptance on-chain - optional cmp.types.v2.Price refund_amount = 3; + cmp.types.v2.Price refund_amount = 3; } // Response for counter cancellation acceptance message AcceptCounterCancellationResponse { // Response header - optional cmp.types.v1.ResponseHeader header = 1; + cmp.types.v1.ResponseHeader header = 1; // Accept counter cancellation transaction ID - optional string transaction_id = 2; + string transaction_id = 2; } diff --git a/proto/cmp/services/cancellation/v1/cancel_proposal.proto b/proto/cmp/services/cancellation/v1/cancel_proposal.proto index b1e932a..8ca81a2 100644 --- a/proto/cmp/services/cancellation/v1/cancel_proposal.proto +++ b/proto/cmp/services/cancellation/v1/cancel_proposal.proto @@ -7,17 +7,17 @@ import "cmp/types/v1/common.proto"; // Request for cancelling an active cancellation proposal message CancelCancellationRequest { // Request header - optional cmp.types.v1.RequestHeader header = 1; + cmp.types.v1.RequestHeader header = 1; // Cancellation token ID - optional uint64 token_id = 2; + uint64 token_id = 2; } // Response for cancelling an active cancellation proposal message CancelCancellationResponse { // Response header - optional cmp.types.v1.ResponseHeader header = 1; + cmp.types.v1.ResponseHeader header = 1; // Accept cancellation transaction ID - optional string transaction_id = 2; + string transaction_id = 2; } diff --git a/proto/cmp/services/cancellation/v1/check.proto b/proto/cmp/services/cancellation/v1/check.proto new file mode 100644 index 0000000..ca86f9e --- /dev/null +++ b/proto/cmp/services/cancellation/v1/check.proto @@ -0,0 +1,58 @@ +syntax = "proto3"; + +package cmp.services.cancellation.v1; + +import "cmp/services/cancellation/v1/reject.proto"; +import "cmp/types/v1/common.proto"; +import "cmp/types/v2/price.proto"; +import "google/protobuf/timestamp.proto"; + +// Service for checking cancellation +// +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/check.dot.xs.svg) +// +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/check.dot.svg) +service CheckCancellationService { + rpc CheckCancellation(CheckCancellationRequest) returns (CheckCancellationResponse); +} + +message CheckCancellationRequest { + // The request header + cmp.types.v1.RequestHeader header = 1; + + // The token id of the booking to be cancelled + uint64 token_id = 2; + + // The amount to be refunded + cmp.types.v2.Price refund_amount = 3; +} + +message CheckCancellationResponse { + // The response header + cmp.types.v1.ResponseHeader header = 1; + + // The token id of the booking to be cancelled + uint64 token_id = 2; + + // The amount to be refunded + cmp.types.v2.Price refund_amount = 3; + + // The policy id applied + string policy_id_applied = 4; + + // Status of the cancellation check + cmp.services.cancellation.v1.CancellationCheckStatus status = 5; + + // Rejection reason + cmp.services.cancellation.v1.CancellationRejectionReason rejection_reason = 6; + + // Cancellation check timestamp + google.protobuf.Timestamp timestamp = 7; +} + +enum CancellationCheckStatus { + CANCELLATION_CHECK_STATUS_UNSPECIFIED = 0; + CANCELLATION_CHECK_STATUS_ALREADY_CANCELLED = 1; + CANCELLATION_CHECK_STATUS_CONFIRM = 2; + CANCELLATION_CHECK_STATUS_REJECT = 3; +} diff --git a/proto/cmp/services/cancellation/v1/counter.proto b/proto/cmp/services/cancellation/v1/counter.proto index 80bf030..01af2be 100644 --- a/proto/cmp/services/cancellation/v1/counter.proto +++ b/proto/cmp/services/cancellation/v1/counter.proto @@ -8,20 +8,20 @@ import "cmp/types/v2/price.proto"; // Request for countering a cancellation message CounterCancellationRequest { // Request header - optional cmp.types.v1.RequestHeader header = 1; + cmp.types.v1.RequestHeader header = 1; // Cancellation token ID - optional uint64 token_id = 2; + uint64 token_id = 2; // Refund amount to counter the cancellation proposal with - optional cmp.types.v2.Price refund_amount = 3; + cmp.types.v2.Price refund_amount = 3; } // Response for countering a cancellation message CounterCancellationResponse { // Response header - optional cmp.types.v1.ResponseHeader header = 1; + cmp.types.v1.ResponseHeader header = 1; // Counter cancellation transaction ID - optional string transaction_id = 2; + string transaction_id = 2; } From 8a8fd3fefad9a2ca5fc2aa611390891fd8041e45 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Thu, 31 Oct 2024 02:39:47 +0300 Subject: [PATCH 6/7] fix diagram url --- proto/cmp/services/cancellation/v1/check.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/cmp/services/cancellation/v1/check.proto b/proto/cmp/services/cancellation/v1/check.proto index ca86f9e..9f8c084 100644 --- a/proto/cmp/services/cancellation/v1/check.proto +++ b/proto/cmp/services/cancellation/v1/check.proto @@ -9,9 +9,9 @@ import "google/protobuf/timestamp.proto"; // Service for checking cancellation // -// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/check.dot.xs.svg) +// ![Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/check.proto.dot.xs.svg) // -// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/check.dot.svg) +// [Open Message Diagram](https://storage.googleapis.com/docs-cmp-files/diagrams/proto/cmp/services/cancellation/v1/check.proto.dot.svg) service CheckCancellationService { rpc CheckCancellation(CheckCancellationRequest) returns (CheckCancellationResponse); } From 748a7ad7be34a6b9c1f5a9eaa9a4cd698f5ecfb8 Mon Sep 17 00:00:00 2001 From: Sam Jaarsma C4T Date: Mon, 4 Nov 2024 10:39:20 +0100 Subject: [PATCH 7/7] adding a basic introduction and link to docs --- proto/cmp/services/cancellation/v1/services.proto | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/proto/cmp/services/cancellation/v1/services.proto b/proto/cmp/services/cancellation/v1/services.proto index ed13c86..a5f1325 100644 --- a/proto/cmp/services/cancellation/v1/services.proto +++ b/proto/cmp/services/cancellation/v1/services.proto @@ -1,5 +1,15 @@ syntax = "proto3"; +// ## Cancellation Services +// +// The Cancellation services are used for any message type or vertical. +// There is an imperative workflow, which has the purpose to register the +// cancellation request moment, followed by both parties agreeing the cancellation +// is possible and the refund amount on the blockchain, so that there will be no +// disputes after a cancellation is executed. +// +// There is a detailed explanation on [Camino Docs](https://docs.camino.network/camino-messenger/cancellation) + package cmp.services.cancellation.v1; import "cmp/services/cancellation/v1/accept.proto";