Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/pl 29 #59

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AppPackage/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ let package = Package(
.target(
name: "TimeTableFeature",
dependencies: [
.product(name: "ComposableArchitecture", package: "swift-composable-architecture")
.product(name: "ComposableArchitecture", package: "swift-composable-architecture"),
"APIClient",
"APIClientLive",
"DesignSystem"
]
),
.target(
Expand Down
70 changes: 39 additions & 31 deletions AppPackage/Sources/Entity/Model.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ public struct UpdateUsernameRequest: Encodable, Equatable {
public struct CreatePromisingRequest: Encodable, Equatable {
private enum CodingKeys: String, CodingKey {
case name = "promisingName"
case startDate = "minTime"
case endDate = "maxTime"
case minTime
case maxTime
case categoryID = "categoryId"
case availableDates
case place = "placeName"
}

public let name: String
public let startDate: Date
public let endDate: Date
public let minTime: String
public let maxTime: String
public let categoryID: Int
public let availableDates: [Date]
public let availableDates: [String]
public let place: String

public init(
name: String,
startDate: Date,
endDate: Date,
minTime: String,
maxTime: String,
categoryID: Int,
availableDates: [Date],
availableDates: [String],
place: String
) {
self.name = name
self.startDate = startDate
self.endDate = endDate
self.minTime = minTime
self.maxTime = maxTime
self.categoryID = categoryID
self.availableDates = availableDates
self.place = place
Expand All @@ -74,29 +74,21 @@ public struct CreatePromisingResponse: Decodable, Equatable {
}

public struct PromisingSessionResponse: Decodable, Equatable {
private enum CodingKeys: String, CodingKey {
case startDate = "minTime"
case endDate = "maxTime"
case totalCount
case unit
case availableDates
}

public let startDate: Date
public let endDate: Date
public let minTime: String
public let maxTime: String
public let totalCount: Int
public let unit: Int
public let availableDates: [Date]
public let unit: Double
public let availableDates: [String]

public init(
startDate: Date,
endDate: Date,
minTime: String,
maxTime: String,
totalCount: Int,
unit: Int,
availableDates: [Date]
unit: Double,
availableDates: [String]
) {
self.startDate = startDate
self.endDate = endDate
self.minTime = minTime
self.maxTime = maxTime
self.totalCount = totalCount
self.unit = unit
self.availableDates = availableDates
Expand Down Expand Up @@ -172,12 +164,28 @@ public struct PromisingSession: Codable, Equatable {
}

public struct PromisingTime: Codable, Equatable {
public let unit: Int
public let timeTable: TimeTable
public let unit: Double
public let timeTable: [TimeTable]

public struct TimeTable: Codable, Equatable {
public let date: Date
public let date: String
public let times: [Bool]

public init(
date: String,
times: [Bool]
) {
self.date = date
self.times = times
}
}

public init(
unit: Double,
timeTable: [TimeTable]
) {
self.unit = unit
self.timeTable = timeTable
}
}

Expand Down
12 changes: 3 additions & 9 deletions AppPackage/Sources/HomeContainerFeature/HomeContainerCore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public struct HomeContainerCore: ReducerProtocol {
}

public enum DestinationState: Equatable {
case makePromise(MakePromiseState)
case makePromise(MakePromise.State)
case promiseList(PromiseListCore.State)
}

public enum DestinationAction: Equatable {
case makePromise(MakePromiseAction)
case makePromise(MakePromise.Action)
case promiseList(PromiseListCore.Action)
}

Expand Down Expand Up @@ -135,14 +135,8 @@ public struct HomeContainerCore: ReducerProtocol {
Scope(
state: /DestinationState.makePromise,
action: /DestinationAction.makePromise,
child: {
Reduce(
makePromiseReducer,
environment: .init()
)
}
child: MakePromise.init
)

Scope(
state: /DestinationState.promiseList,
action: /DestinationAction.promiseList,
Expand Down
22 changes: 0 additions & 22 deletions AppPackage/Sources/MakePromise/MakePromiseAction.swift

This file was deleted.

197 changes: 0 additions & 197 deletions AppPackage/Sources/MakePromise/MakePromiseState.swift

This file was deleted.

Loading