From 7d76bd1173a54a5dea45876cc3c71f42d7ec7b1e Mon Sep 17 00:00:00 2001 From: felixojiambo Date: Sun, 15 Dec 2024 21:36:58 +0300 Subject: [PATCH] dtos --- .../payment_service/dtos/InvoiceResponse.java | 16 ++++++++++++++ .../payment_service/dtos/PaymentRequest.java | 15 +++++++++++++ .../payment_service/dtos/PaymentResponse.java | 21 +++++++++++++++++++ .../payment_service/dtos/RefundRequest.java | 13 ++++++++++++ .../payment_service/dtos/RefundResponse.java | 20 ++++++++++++++++++ .../dtos/TransactionRequest.java | 11 ++++++++++ .../dtos/TransactionResponse.java | 21 +++++++++++++++++++ 7 files changed, 117 insertions(+) create mode 100644 payment-service/src/main/java/com/finpay/payment_service/dtos/InvoiceResponse.java create mode 100644 payment-service/src/main/java/com/finpay/payment_service/dtos/PaymentRequest.java create mode 100644 payment-service/src/main/java/com/finpay/payment_service/dtos/PaymentResponse.java create mode 100644 payment-service/src/main/java/com/finpay/payment_service/dtos/RefundRequest.java create mode 100644 payment-service/src/main/java/com/finpay/payment_service/dtos/RefundResponse.java create mode 100644 payment-service/src/main/java/com/finpay/payment_service/dtos/TransactionRequest.java create mode 100644 payment-service/src/main/java/com/finpay/payment_service/dtos/TransactionResponse.java diff --git a/payment-service/src/main/java/com/finpay/payment_service/dtos/InvoiceResponse.java b/payment-service/src/main/java/com/finpay/payment_service/dtos/InvoiceResponse.java new file mode 100644 index 0000000..2a31be2 --- /dev/null +++ b/payment-service/src/main/java/com/finpay/payment_service/dtos/InvoiceResponse.java @@ -0,0 +1,16 @@ +package com.finpay.payment_service.dtos; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.UUID; + +@Data +public class InvoiceResponse { + private UUID id; + private UUID userId; + private BigDecimal totalAmount; + private String currency; + private String status; + // Add other relevant fields as necessary +} diff --git a/payment-service/src/main/java/com/finpay/payment_service/dtos/PaymentRequest.java b/payment-service/src/main/java/com/finpay/payment_service/dtos/PaymentRequest.java new file mode 100644 index 0000000..b5af40a --- /dev/null +++ b/payment-service/src/main/java/com/finpay/payment_service/dtos/PaymentRequest.java @@ -0,0 +1,15 @@ +package com.finpay.payment_service.dtos; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.UUID; + +@Data +public class PaymentRequest { + private BigDecimal amount; + private String currency; + private String paymentMethod; // e.g., CREDIT_CARD, BANK_TRANSFER + private UUID invoiceId; // Reference to Invoice managed by Invoice Service + private String paymentGateway; // e.g., Stripe, PayPal +} diff --git a/payment-service/src/main/java/com/finpay/payment_service/dtos/PaymentResponse.java b/payment-service/src/main/java/com/finpay/payment_service/dtos/PaymentResponse.java new file mode 100644 index 0000000..0a82e94 --- /dev/null +++ b/payment-service/src/main/java/com/finpay/payment_service/dtos/PaymentResponse.java @@ -0,0 +1,21 @@ +package com.finpay.payment_service.dtos; + +import com.finpay.payment_service.models.PaymentStatus; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.math.BigDecimal; +import java.util.UUID; + +@Data +@AllArgsConstructor +public class PaymentResponse { + private UUID id; + private String paymentReference; + private BigDecimal amount; + private String currency; + private PaymentStatus status; + private UUID invoiceId; + private String paymentGateway; + private String message; +} diff --git a/payment-service/src/main/java/com/finpay/payment_service/dtos/RefundRequest.java b/payment-service/src/main/java/com/finpay/payment_service/dtos/RefundRequest.java new file mode 100644 index 0000000..607c5d9 --- /dev/null +++ b/payment-service/src/main/java/com/finpay/payment_service/dtos/RefundRequest.java @@ -0,0 +1,13 @@ +package com.finpay.payment_service.dtos; + +import lombok.Data; + +import java.math.BigDecimal; +import java.util.UUID; + +@Data +public class RefundRequest { + private UUID paymentId; + private BigDecimal amount; + private String reason; +} diff --git a/payment-service/src/main/java/com/finpay/payment_service/dtos/RefundResponse.java b/payment-service/src/main/java/com/finpay/payment_service/dtos/RefundResponse.java new file mode 100644 index 0000000..dad76b8 --- /dev/null +++ b/payment-service/src/main/java/com/finpay/payment_service/dtos/RefundResponse.java @@ -0,0 +1,20 @@ +package com.finpay.payment_service.dtos; + +import com.finpay.payment_service.models.RefundStatus; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.UUID; + +@Data +@AllArgsConstructor +public class RefundResponse { + private UUID id; + private String refundReference; + private RefundStatus status; + private BigDecimal amount; + private String reason; + private LocalDateTime createdAt; +} diff --git a/payment-service/src/main/java/com/finpay/payment_service/dtos/TransactionRequest.java b/payment-service/src/main/java/com/finpay/payment_service/dtos/TransactionRequest.java new file mode 100644 index 0000000..813c516 --- /dev/null +++ b/payment-service/src/main/java/com/finpay/payment_service/dtos/TransactionRequest.java @@ -0,0 +1,11 @@ +package com.finpay.payment_service.dtos; + +import lombok.Data; + +import java.math.BigDecimal; + +@Data +public class TransactionRequest { + private String transactionType; + private BigDecimal amount; +} diff --git a/payment-service/src/main/java/com/finpay/payment_service/dtos/TransactionResponse.java b/payment-service/src/main/java/com/finpay/payment_service/dtos/TransactionResponse.java new file mode 100644 index 0000000..b9b0558 --- /dev/null +++ b/payment-service/src/main/java/com/finpay/payment_service/dtos/TransactionResponse.java @@ -0,0 +1,21 @@ +package com.finpay.payment_service.dtos; + +import com.finpay.payment_service.models.TransactionStatus; +import com.finpay.payment_service.models.TransactionType; +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.math.BigDecimal; +import java.time.LocalDateTime; +import java.util.UUID; + +@Data +@AllArgsConstructor +public class TransactionResponse { + private UUID id; + private String transactionReference; + private TransactionType type; + private TransactionStatus status; + private BigDecimal amount; + private LocalDateTime createdAt; +}