-
Notifications
You must be signed in to change notification settings - Fork 28
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
택배송장앱 [STEP 1] Caron #40
Open
Qussk
wants to merge
13
commits into
yagom-academy:rft_2_caron
Choose a base branch
from
Qussk:caron
base: rft_2_caron
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d376c52
feat: commit test
Qussk 0412c3d
feat: protocol로 처리
Qussk 5abffd4
feat: SOLID SRP 적용
Qussk faaea65
feat: ParcelOrderViewController 처리
Qussk b6d812a
feat: SOLID DIP 적용
Qussk 90a2e3c
feat: 제출
Qussk b1f8890
feat: view 리팩토링
Qussk f2d48ff
feat: STEP 2 : OCP의 실현 // 제출
Qussk 72ed269
feat: ParcelInformation 정리.. Discount 활용
Qussk da14d3a
feat: SOLID SRP 적용2
Qussk 79e9e7b
feat: SOLID DIP 적용2
Qussk d5d5219
feat: 원시값 포장
Qussk 95a6840
feat: 공통분모 통일
Qussk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
|
@@ -32,6 +32,13 @@ enum layoutViewTitle { | |
static let notice: String = "알림" | ||
} | ||
|
||
enum DiscountList { | ||
static let vip = 5 * 4 | ||
static let coupon = 2 | ||
static let youth = 3 | ||
|
||
} | ||
|
||
class NoDiscount: DiscountStrategy { | ||
func applyDiscount(deliveryCost: Int) -> Int { | ||
return deliveryCost | ||
|
@@ -40,16 +47,21 @@ class NoDiscount: DiscountStrategy { | |
|
||
class VIPDiscount: DiscountStrategy { | ||
func applyDiscount(deliveryCost: Int) -> Int { | ||
return deliveryCost / 5 * 4 | ||
return deliveryCost / DiscountList.vip | ||
} | ||
} | ||
|
||
class CouponDiscount: DiscountStrategy { | ||
func applyDiscount(deliveryCost: Int) -> Int { | ||
return deliveryCost / 2 | ||
return deliveryCost / DiscountList.coupon | ||
} | ||
} | ||
|
||
class YouthDiscount: DiscountStrategy { | ||
func applyDiscount(deliveryCost: Int) -> Int { | ||
return deliveryCost / DiscountList.youth | ||
} | ||
Comment on lines
+59
to
+62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 새로운 할인 정책을 추가해보셨네요!👍 |
||
|
||
} | ||
|
||
|
||
class ParcelOrderView: UIView { | ||
|
@@ -86,13 +98,15 @@ class ParcelOrderView: UIView { | |
static let not = "없음" | ||
static let vip = "VIP" | ||
static let coupone = "쿠폰" | ||
static let youth = "청소년" | ||
} | ||
|
||
private let discountSegmented: UISegmentedControl = { | ||
let control: UISegmentedControl = .init() | ||
control.insertSegment(withTitle: segmentOption.not, at: 0, animated: false) | ||
control.insertSegment(withTitle: segmentOption.vip, at: 1, animated: false) | ||
control.insertSegment(withTitle: segmentOption.coupone, at: 2, animated: false) | ||
control.insertSegment(withTitle: segmentOption.youth, at: 3, animated: false) | ||
control.selectedSegmentIndex = 0 | ||
return control | ||
}() | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
수식을 따로 선언해보셨네요!👍