Skip to content

Commit

Permalink
♻️ :: [#245] ViolationResponseDTO / rule Type String -> ViolationType
Browse files Browse the repository at this point in the history
  • Loading branch information
uuuunseo committed Aug 17, 2024
1 parent a46e5c7 commit 43431cb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import BaseDomainInterface
import Foundation

public struct ViolationEntity: Equatable {
public let id: Int
public let rule: String
public let rule: ViolationType
public let createDate: Date

public init(id: Int, rule: String, createDate: Date) {
public init(
id: Int,
rule: ViolationType,
createDate: Date
) {
self.id = id
self.rule = rule
self.createDate = createDate
Expand Down
4 changes: 3 additions & 1 deletion Projects/Domain/ViolationDomain/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import ProjectDescriptionHelpers
let project = Project.module(
name: ModulePaths.Domain.ViolationDomain.rawValue,
targets: [
.interface(module: .domain(.ViolationDomain)),
.interface(module: .domain(.ViolationDomain), dependencies: [
.domain(target: .BaseDomain, type: .interface)
]),
.implements(module: .domain(.ViolationDomain), dependencies: [
.domain(target: .ViolationDomain, type: .interface),
.domain(target: .BaseDomain)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import BaseDomainInterface
import DateUtility
import Foundation
import ViolationDomainInterface

struct ViolationResponseDTO: Decodable {
let id: Int
let rule: String
let rule: ViolationType
let createdDate: String
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class FetchMyViolationListUseCaseTests: XCTestCase {

func test_FetchMyViolationList() async throws {
let expected: [ViolationModel] = [
ViolationModel(id: 1, rule: "기숙사 탈주", createDate: .init())
ViolationModel(id: 1, rule: .firearms, createDate: .init())
]
violationRepository.fetchMyViolationListHandler = { expected }
XCTAssertEqual(violationRepository.fetchMyViolationListCallCount, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class ViolationRepositoryTests: XCTestCase {

func test_FetchMyViolationList() async throws {
let expected: [ViolationEntity] = [
ViolationEntity(id: 1, rule: "기숙사 탈주", createDate: .init())
ViolationEntity(id: 1, rule: .firearms, createDate: .init())
]
remoteViolationDataSource.fetchMyViolationListHandler = { expected }
XCTAssertEqual(remoteViolationDataSource.fetchMyViolationListCallCount, 0)
Expand Down

0 comments on commit 43431cb

Please sign in to comment.