Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ThisBuild / organization := "app.softnetwork"

name := "payment"

ThisBuild / version := "0.9.10.3"
ThisBuild / version := "0.9-SNAPSHOT"

ThisBuild / scalaVersion := scala212

Expand Down
9 changes: 9 additions & 0 deletions client/src/main/protobuf/model/payment/transaction.proto
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ message PayInTransaction {
optional string preAuthorizedTransactionId = 14;
optional int32 preAuthorizationDebitedAmount = 15;
optional string preRegistrationId = 16;
map<string, string> metadata = 17;
}

message PayInWithCardTransaction {
Expand All @@ -147,6 +148,7 @@ message PayInWithCardTransaction {
optional bool printReceipt = 11;
optional string statementDescriptor = 12;
optional string preRegistrationId = 13;
map<string, string> metadata = 14;
}

message PayInWithPayPalTransaction {
Expand All @@ -165,6 +167,7 @@ message PayInWithPayPalTransaction {
optional BrowserInfo browserInfo = 12;
optional bool registerPaypal = 13;
optional string preRegistrationId = 14;
map<string, string> metadata = 15;
}

message RefundTransaction {
Expand All @@ -177,6 +180,7 @@ message RefundTransaction {
required string reasonMessage = 6;
required bool initializedByClient = 7;
optional int32 feesRefundAmount = 8;
map<string, string> metadata = 9;
}

message TransferTransaction {
Expand All @@ -192,6 +196,7 @@ message TransferTransaction {
optional string externalReference = 9;
optional string statementDescriptor = 10;
optional string payInTransactionId = 11;
map<string, string> metadata = 12;
}

message PayOutTransaction {
Expand All @@ -207,6 +212,7 @@ message PayOutTransaction {
optional string externalReference = 9;
optional string payInTransactionId = 10;
optional string statementDescriptor = 11;
map<string, string> metadata = 12;
}

message DirectDebitTransaction {
Expand All @@ -220,6 +226,7 @@ message DirectDebitTransaction {
required string mandateId = 7;
required string statementDescriptor = 8;
optional string externalReference = 9;
map<string, string> metadata = 10;
}

message PreAuthorizationTransaction {
Expand All @@ -238,6 +245,7 @@ message PreAuthorizationTransaction {
optional string statementDescriptor = 12;
optional string preRegistrationId = 13;
required Transaction.PaymentType paymentType = 14 [default = CARD];
map<string, string> metadata = 15;
}

message PayInWithPreAuthorization {
Expand All @@ -252,6 +260,7 @@ message PayInWithPreAuthorization {
optional int32 feesAmount = 8;
optional string statementDescriptor = 9;
optional string preRegistrationId = 10;
map<string, string> metadata = 11;
}

message PreRegistration{
Expand Down
90 changes: 90 additions & 0 deletions common/src/main/protobuf/message/payment/payment.proto
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ message WalletRegisteredEvent {
required string userId = 3;
required string walletId = 4;
required google.protobuf.Timestamp lastUpdated = 5 [(scalapb.field).type = "java.time.Instant"];
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 6;
}

message CardPreRegisteredEvent { // deprecated replaced by PaymentMethodPreRegisteredEvent
Expand All @@ -50,6 +53,9 @@ message CardPreRegisteredEvent { // deprecated replaced by PaymentMethodPreRegis
required string walletId = 5;
required string cardPreRegistrationId = 6;
required app.softnetwork.payment.model.CardOwner owner = 7;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 8;
}

message PaymentMethodPreRegisteredEvent {
Expand All @@ -64,6 +70,9 @@ message PaymentMethodPreRegisteredEvent {
required string preRegistrationId = 6;
required app.softnetwork.payment.model.Transaction.PaymentType paymentType = 7;
optional app.softnetwork.payment.model.CardOwner owner = 8;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 9;
}

message CardRegisteredEvent { // deprecated, replaced by PaymentMethodRegisteredEvent
Expand All @@ -74,6 +83,9 @@ message CardRegisteredEvent { // deprecated, replaced by PaymentMethodRegistered
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
required string externalUuid = 3;
required app.softnetwork.payment.model.Card card = 4;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 5;
}

message PaymentMethodRegisteredEvent {
Expand All @@ -87,6 +99,9 @@ message PaymentMethodRegisteredEvent {
app.softnetwork.payment.model.Card card = 4;
app.softnetwork.payment.model.Paypal paypal = 5;
}
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 6;
}

message PaymentAccountUpsertedEvent {
Expand All @@ -95,6 +110,9 @@ message PaymentAccountUpsertedEvent {
option (scalapb.message).extends = "PaymentAccountEvent";
required app.softnetwork.payment.model.PaymentAccount document = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 3;
}

message BankAccountUpdatedEvent {
Expand All @@ -106,6 +124,9 @@ message BankAccountUpdatedEvent {
required string userId = 3;
required string walletId = 4;
required string bankAccountId = 5;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 6;
}

message MandateUpdatedEvent {
Expand All @@ -117,6 +138,9 @@ message MandateUpdatedEvent {
optional string mandateId = 3;
optional app.softnetwork.payment.model.Mandate.MandateStatus mandateStatus = 4;
required string bankAccountId = 5;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 6;
}

message TermsOfPSPAcceptedEvent{
Expand All @@ -126,6 +150,9 @@ message TermsOfPSPAcceptedEvent{
required string externalUuid = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
required google.protobuf.Timestamp lastAcceptedTermsOfPSP = 3 [(scalapb.field).type = "java.time.Instant"];
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 4;
}

message UboDeclarationUpdatedEvent{
Expand All @@ -135,6 +162,9 @@ message UboDeclarationUpdatedEvent{
required string externalUuid = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
optional app.softnetwork.payment.model.UboDeclaration uboDeclaration = 3;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 4;
}

message RegularUserValidatedEvent{
Expand All @@ -144,6 +174,9 @@ message RegularUserValidatedEvent{
required string externalUuid = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
required string userId = 3;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 4;
}

message RegularUserInvalidatedEvent{
Expand All @@ -153,6 +186,9 @@ message RegularUserInvalidatedEvent{
required string externalUuid = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
required string userId = 3;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 4;
}

message PaymentAccountStatusUpdatedEvent {
Expand All @@ -162,6 +198,9 @@ message PaymentAccountStatusUpdatedEvent {
required string externalUuid = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
required app.softnetwork.payment.model.PaymentAccount.PaymentAccountStatus paymentAccountStatus = 3;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 4;
}

message DocumentsUpdatedEvent {
Expand All @@ -171,6 +210,9 @@ message DocumentsUpdatedEvent {
required string externalUuid = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
repeated app.softnetwork.payment.model.KycDocument documents = 3;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 4;
}

message DocumentUpdatedEvent {
Expand All @@ -180,6 +222,9 @@ message DocumentUpdatedEvent {
required string externalUuid = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
required app.softnetwork.payment.model.KycDocument document = 3;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 4;
}

message BankAccountDeletedEvent {
Expand All @@ -188,6 +233,9 @@ message BankAccountDeletedEvent {
option (scalapb.message).extends = "BroadcastEvent";
required string externalUuid = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 3;
}

message ExternalEntityToPaymentEvent{
Expand All @@ -206,6 +254,9 @@ message ExternalEntityToPaymentEvent{
LoadDirectDebitTransactionCommandEvent loadDirectDebitTransaction = 9;
CancelMandateCommandEvent cancelMandate = 10;
}
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 11;
}

message PayInWithPreAuthorizationCommandEvent{
Expand All @@ -216,6 +267,9 @@ message PayInWithPreAuthorizationCommandEvent{
optional int32 debitedAmount = 3;
optional int32 feesAmount = 4;
optional string clientId = 5;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 6;
}

message RefundCommandEvent{
Expand All @@ -229,6 +283,9 @@ message RefundCommandEvent{
required bool initializedByClient = 6;
optional string clientId = 7;
optional int32 feesRefundAmount = 8;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 9;
}

message PayOutCommandEvent{
Expand All @@ -241,6 +298,9 @@ message PayOutCommandEvent{
required string currency = 5 [default = "EUR"];
optional string externalReference = 6;
optional string clientId = 7;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 8;
}

message TransferCommandEvent{
Expand All @@ -255,6 +315,9 @@ message TransferCommandEvent{
required bool payOutRequired = 7 [default = true];
optional string externalReference = 8;
optional string clientId = 9;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 10;
}

message DirectDebitCommandEvent{
Expand All @@ -267,12 +330,18 @@ message DirectDebitCommandEvent{
required string statementDescriptor = 5;
optional string externalReference = 6;
optional string clientId = 7;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 8;
}

message CreateOrUpdatePaymentAccountCommandEvent{
option (scalapb.message).extends = "ProtobufEvent";
option (scalapb.message).extends = "PaymentCommandEvent";
required app.softnetwork.payment.model.PaymentAccount paymentAccount = 1;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 2;
}

message RegisterRecurringPaymentCommandEvent {
Expand All @@ -291,6 +360,9 @@ message RegisterRecurringPaymentCommandEvent {
optional int32 nextFeesAmount = 11;
optional string clientId = 12;
optional string cardId = 13;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 14;
}

message RecurringPaymentRegisteredEvent {
Expand All @@ -299,6 +371,9 @@ message RecurringPaymentRegisteredEvent {
option (scalapb.message).extends = "BroadcastEvent";
required string externalUuid = 1;
required app.softnetwork.payment.model.RecurringPayment recurringPayment = 2;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 3;
}

message CancelPreAuthorizationCommandEvent {
Expand All @@ -307,13 +382,19 @@ message CancelPreAuthorizationCommandEvent {
required string orderUuid = 1;
required string cardPreAuthorizedTransactionId = 2;
optional string clientId = 3;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 4;
}

message LoadDirectDebitTransactionCommandEvent {
option (scalapb.message).extends = "ProtobufEvent";
option (scalapb.message).extends = "PaymentCommandEvent";
required string directDebitTransactionId = 1;
optional string clientId = 2;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 3;
}

message PaymentAccountCreatedOrUpdatedEvent {
Expand All @@ -327,13 +408,19 @@ message PaymentAccountCreatedOrUpdatedEvent {
app.softnetwork.payment.model.NaturalUser naturalUser = 4;
app.softnetwork.payment.model.LegalUser legalUser = 5;
}
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 6;
}

message CancelMandateCommandEvent {
option (scalapb.message).extends = "ProtobufEvent";
option (scalapb.message).extends = "PaymentCommandEvent";
required string externalUuid = 1;
optional string clientId = 2;
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 3;
}

message MandateCancelationFailedEvent {
Expand All @@ -342,4 +429,7 @@ message MandateCancelationFailedEvent {
option (scalapb.message).extends = "BroadcastEvent";
required string externalUuid = 1;
required google.protobuf.Timestamp lastUpdated = 2 [(scalapb.field).type = "java.time.Instant"];
// Story 13.7 — cross-service correlation id (durable hop for the audit trail).
option (scalapb.message).extends = "AuditableEvent";
optional string correlation_id = 3;
}
Loading
Loading