From 93a52fd93e744c7909cd275bb4f8e67903367649 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sun, 17 Mar 2024 16:08:51 +0100 Subject: [PATCH] Defined the GetReviewsEndpoint protocol in the Feed library. --- .../Endpoints/GetReviewsEndpoint.swift | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Libraries/Feed/Kit/Sources/Protocols/Endpoints/GetReviewsEndpoint.swift diff --git a/Libraries/Feed/Kit/Sources/Protocols/Endpoints/GetReviewsEndpoint.swift b/Libraries/Feed/Kit/Sources/Protocols/Endpoints/GetReviewsEndpoint.swift new file mode 100644 index 0000000..0159e5e --- /dev/null +++ b/Libraries/Feed/Kit/Sources/Protocols/Endpoints/GetReviewsEndpoint.swift @@ -0,0 +1,44 @@ +// +// GetReviewsEndpoint.swift +// ReviewsFeedKit +// +// Created by Javier Cicchelli on 17/03/2024. +// Copyright © 2024 Röck+Cöde VoF. All rights reserved. +// + +import Foundation + +public protocol GetReviewsEndpoint: Endpoint +where Input == GetReviewsInput, + Output == GetReviewsOutput {} + +// MARK: - Input +public struct GetReviewsInput: EndpointInput { + + // MARK: Constants + public let appID: String + public let countryCode: String + + // MARK: Initialisers + public init( + appID: String, + countryCode: String + ) { + self.appID = appID + self.countryCode = countryCode + } + +} + +// MARK: - Output +public struct GetReviewsOutput: EndpointOutput { + + // MARK: Constants + public let reviews: [Review] + + // MARK: Initialisers + public init(reviews: [Review]) { + self.reviews = reviews + } + +}