This PR contains the work done to implement the `iTunesService` service that fetches the reviews from the **Apple App Store**. Reviewed-on: #5 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
61 lines
1.3 KiB
Swift
61 lines
1.3 KiB
Swift
//
|
|
// Review.swift
|
|
// ReviewsFeedKit
|
|
//
|
|
// Created by Javier Cicchelli on 17/03/2024.
|
|
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Review {
|
|
|
|
// MARK: Constants
|
|
public let author: String
|
|
public let content: String
|
|
public let id: Int
|
|
public let rating: Int
|
|
public let title: String
|
|
public let updated: Date
|
|
public let version: String
|
|
|
|
// MARK: Initialisers
|
|
public init(
|
|
id: Int,
|
|
author: String,
|
|
title: String,
|
|
content: String,
|
|
rating: Int,
|
|
version: String,
|
|
updated: Date
|
|
) {
|
|
self.author = author
|
|
self.content = content
|
|
self.id = id
|
|
self.rating = rating
|
|
self.title = title
|
|
self.updated = updated
|
|
self.version = version
|
|
}
|
|
|
|
}
|
|
|
|
// MARK: - Equatable
|
|
extension Review: Equatable {
|
|
|
|
// MARK: Functions
|
|
public static func == (
|
|
lhs: Review,
|
|
rhs: Review
|
|
) -> Bool {
|
|
lhs.author == rhs.author
|
|
&& lhs.content == rhs.content
|
|
&& lhs.id == rhs.id
|
|
&& lhs.rating == rhs.rating
|
|
&& lhs.title == rhs.title
|
|
&& lhs.version == rhs.version
|
|
&& lhs.updated.description == rhs.updated.description
|
|
}
|
|
|
|
}
|