refactor/checkout (#8)
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 59s
Build and Publish / BuildAndDeployArm64 (push) Successful in 5m40s

Co-authored-by: matst80 <mats.tornberg@gmail.com>
Reviewed-on: #8
Co-authored-by: Mats Törnberg <mats@tornberg.me>
Co-committed-by: Mats Törnberg <mats@tornberg.me>
This commit was merged in pull request #8.
This commit is contained in:
2025-12-03 09:45:48 +01:00
committed by mats
parent ebd1508294
commit ee5f54f0dd
77 changed files with 5190 additions and 5795 deletions

106
proto/checkout.proto Normal file
View File

@@ -0,0 +1,106 @@
syntax = "proto3";
package checkout_messages;
option go_package = "git.k6n.net/go-cart-actor/proto/checkout;checkout_messages";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
message SetDelivery {
string provider = 1;
repeated uint32 items = 2;
optional PickupPoint pickupPoint = 3;
string country = 4;
string zip = 5;
optional string address = 6;
optional string city = 7;
}
message SetPickupPoint {
uint32 deliveryId = 1;
PickupPoint pickupPoint = 2;
}
message PickupPoint {
string id = 2;
optional string name = 3;
optional string address = 4;
optional string city = 5;
optional string zip = 6;
optional string country = 7;
}
message RemoveDelivery { uint32 id = 1; }
message PaymentStarted {
string paymentId = 1;
int64 amount = 3;
string currency = 4;
string provider = 5;
optional string method = 6;
optional google.protobuf.Timestamp startedAt = 7;
repeated uint32 items = 2;
}
message PaymentCompleted {
string paymentId = 1;
string status = 2;
int64 amount = 3;
string currency = 4;
optional string processorReference = 5;
optional google.protobuf.Timestamp completedAt = 6;
}
message PaymentDeclined {
string paymentId = 1;
string message = 2;
optional string code = 3;
}
message PaymentEvent {
string paymentId = 1;
string name = 2;
bool success = 3;
google.protobuf.Any data = 4;
}
message ConfirmationViewed {
google.protobuf.Timestamp viewedAt = 1;
}
message OrderCreated {
string orderId = 1;
string status = 2;
google.protobuf.Timestamp createdAt = 3;
}
message InitializeCheckout {
string orderId = 1;
uint64 cartId = 2;
uint32 version = 3;
google.protobuf.Any cartState = 4;
}
message InventoryReserved {
string id = 1;
string status = 2;
optional string message = 3;
}
message Mutation {
oneof type {
SetDelivery set_delivery = 1;
SetPickupPoint set_pickup_point = 2;
RemoveDelivery remove_delivery = 3;
PaymentDeclined payment_declined = 4;
ConfirmationViewed confirmation_viewed = 5;
OrderCreated order_created = 7;
InitializeCheckout initialize_checkout = 9;
InventoryReserved inventory_reserved = 10;
PaymentStarted payment_started = 11;
PaymentCompleted payment_completed = 12;
PaymentEvent payment_event = 13;
}
}