generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
224 additions
and
51 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Projects/Domain/AuthenticationDomain/Interface/DI/AuthenticationDomainBuildable.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
public protocol AuthenticationDomainBuildable { | ||
var fetchAuthenticationFormUseCase: any FetchAuthenticationFormUseCase { get } | ||
var inputAuthenticationUseCase: any InputAuthenticationUseCase { get } | ||
var fetchAuthenticationStateUseCase: any FetchAuthenticationStateUseCase { get } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
Projects/Domain/AuthenticationDomain/Interface/Entity/AuthenticationStateEntity.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
public struct AuthenticationStateEntity { | ||
public let name: String | ||
public let score: Double | ||
public let grader: String? | ||
public let markingBoardType: MarkingBoardType | ||
|
||
public init(name: String, score: Double, grader: String?, markingBoardType: MarkingBoardType) { | ||
self.name = name | ||
self.score = score | ||
self.grader = grader | ||
self.markingBoardType = markingBoardType | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
Projects/Domain/AuthenticationDomain/Interface/Enum/MarkingBoardEnum.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
public enum MarkingBoardType: String, Codable { | ||
case notSubmitted = "NOT_SUBMITTED" | ||
case pendingReview = "PENDING_REVIEW" | ||
case underReview = "UNDER_REVIEW" | ||
case completed = "COMPLETED" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
Projects/Domain/AuthenticationDomain/Interface/UseCase/FetchAuthenticationStateUseCase.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Foundation | ||
|
||
public protocol FetchAuthenticationStateUseCase { | ||
func execute() async throws -> AuthenticationStateEntity | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...cts/Domain/AuthenticationDomain/Sources/DTO/Response/AuthenticationStateResponseDTO.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Foundation | ||
import AuthenticationDomainInterface | ||
|
||
public struct AuthenticationStateResponseDTO: Decodable { | ||
public let name: String | ||
public let score: Double | ||
public let grader: String? | ||
public let markingBoardType: MarkingBoardType | ||
|
||
public init(name: String, score: Double, grader: String?, markingBoardType: MarkingBoardType) { | ||
self.name = name | ||
self.score = score | ||
self.grader = grader | ||
self.markingBoardType = markingBoardType | ||
} | ||
} | ||
|
||
extension AuthenticationStateResponseDTO { | ||
func toDomain() -> AuthenticationStateEntity { | ||
AuthenticationStateEntity( | ||
name: name, | ||
score: score, | ||
grader: grader, | ||
markingBoardType: markingBoardType | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...cts/Domain/AuthenticationDomain/Sources/UseCase/FetchAuthenticationStateUseCaseImpl.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import AuthenticationDomainInterface | ||
|
||
struct FetchAuthenticationStateUseCaseImpl: FetchAuthenticationStateUseCase { | ||
private let authenticationRepository: any AuthenticationRepository | ||
|
||
init(authenticationRepository: any AuthenticationRepository) { | ||
self.authenticationRepository = authenticationRepository | ||
} | ||
|
||
func execute() async throws -> AuthenticationStateEntity { | ||
try await authenticationRepository.fetchAuthenticationState() | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
Projects/Domain/AuthenticationDomain/Testing/FetchAuthenticationStateUseCaseSpy.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import AuthenticationDomainInterface | ||
|
||
public final class FetchAuthenticationStateUseCaseSpy: FetchAuthenticationStateUseCase { | ||
public var callCount = 0 | ||
public var handler: (() async throws -> AuthenticationStateEntity)? = { | ||
return AuthenticationStateEntity(name: "ASDFsa", score: 0, grader: nil, markingBoardType: .notSubmitted) | ||
} | ||
|
||
public init() {} | ||
|
||
public func execute() async throws -> AuthenticationStateEntity { | ||
guard let handler else { fatalError() } | ||
return try await handler() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...ure/GSMAuthenticationFormFeature/Sources/Intent/GSMAuthenticationFormIntentProtocol.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...ects/Feature/GSMAuthenticationFormFeature/Sources/Model/GSMAuthenticationStateModel.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import AuthenticationDomainInterface | ||
|
||
struct GSMAuthenticationStateModel { | ||
var name: String | ||
var score: Double | ||
var grader: String? | ||
var markingBoardType: MarkingBoardType | ||
} |
Oops, something went wrong.