Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
import Foundation

public enum SurchargeStatus: String, Codable, Equatable, Sendable {
case UNKNOWN, REPORTED, CONFIRMED
case UNKNOWN, REPORTED, CONFIRMED, AUTO_GENERATED, REJECTED
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
import Foundation

public enum SurchargeStatus: String, Codable, Equatable, Sendable {
case unknown, reported, confirmed
case unknown, reported, confirmed, autoGenerated, rejected
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ struct ConvertDTOtoEntity {
case .UNKNOWN: return .unknown
case .REPORTED: return .reported
case .CONFIRMED: return .confirmed
case .AUTO_GENERATED: return .autoGenerated
case .REJECTED: return .rejected
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public struct GetPlaceUsecase<R: PlaceRepositoryProtocol>: GetPlaceUsecaseProtoc
case .UNKNOWN: return .unknown
case .REPORTED: return .reported
case .CONFIRMED: return .confirmed
case .AUTO_GENERATED: return .autoGenerated
case .REJECTED: return .rejected
case .none: return .unknown
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public struct GetPlacesUsecase<R: PlaceRepositoryProtocol>: GetPlacesUsecaseProt
case .UNKNOWN: return .unknown
case .REPORTED: return .reported
case .CONFIRMED: return .confirmed
case .AUTO_GENERATED: return .autoGenerated
case .REJECTED: return .rejected
case .none: return .unknown
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
import Foundation

public enum SurchargeStatus: Equatable, Sendable {
case notDetermined, unknown, reported, confirmed
case notDetermined, unknown, reported, confirmed, autoGenerated, rejected
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ public extension View {
self._style(foreground: R.color.green800.color, background: R.color.green300.color)
}

func surchargeStatusAutoGenerated() -> some View {
self._style(foreground: R.color.yellow800.color, background: R.color.yellow300.color)
}

private func _style(foreground: Color, background: Color) -> some View {
self
.foregroundStyle(foreground)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import AppStatusService
import AppStatusService
import ViewUpdateService
import DevelopmentEndpoint
import DevelopmentAdsService

@main
struct MainApp: App {
Expand All @@ -32,7 +33,7 @@ struct MainApp: App {
var body: some Scene {
WindowGroup {
NavigationStack {
MainView(
MainView<MainFactory<DevelopmentEndpoint>.ViewModel, MainRouter, DevelopmentAdsService>(
viewModel: MainFactory<DevelopmentEndpoint>(
locationService: _locationService,
viewUpdateService: _viewUpdateService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,33 +22,40 @@ struct PlaceView: View {
}

var body: some View {
VStack(spacing: 5) {
HStack(spacing: 20) {

HStack(spacing: 10) {

Image(systemName: "storefront")
.imageScale(.large)

VStack(spacing: 5) {
Text(_place.name)
.font(.headline)
.frame(maxWidth: .infinity, alignment: .leading)
.multilineTextAlignment(.leading)

if let rate = _place.surcharge.rate {
if _place.surcharge.status == .reported {
Text(verbatim: rate == 0 ? "\(R.string.localizable.zeroRates())🎉" : "\(rate)%")
.surchargeStatusReported()

} else if _place.surcharge.status == .confirmed {
Text(verbatim: rate == 0 ? "\(R.string.localizable.zeroRates())🎉" : "\(rate)%")
.surchargeStatusConfirmed()
}
}
Text(_place.address)
.frame(maxWidth: .infinity, alignment: .leading)
.font(.subheadline)
.multilineTextAlignment(.leading)
}

Text(_place.address)
.frame(maxWidth: .infinity, alignment: .center)
.font(.subheadline)
.multilineTextAlignment(.center)

if let rate = _place.surcharge.rate {
if _place.surcharge.status == .reported {
Text(verbatim: rate == 0 ? "\(R.string.localizable.zeroRates())🎉" : "\(rate)%")
.surchargeStatusReported()

} else if _place.surcharge.status == .confirmed {
Text(verbatim: rate == 0 ? "\(R.string.localizable.zeroRates())🎉" : "\(rate)%")
.surchargeStatusConfirmed()

} else if _place.surcharge.status == .autoGenerated {
Text(verbatim: rate == 0 ? "\(R.string.localizable.zeroRates())🎉" : "\(rate)%")
.surchargeStatusAutoGenerated()
}
}
}
.padding([.leading, .trailing], 20)

}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ struct ContributeButton: View {
Button {

switch _surcharge.status {
case .notDetermined, .reported:
case .notDetermined, .reported, .rejected:
break
case .unknown, .confirmed:
case .unknown, .confirmed, .autoGenerated:
_action()
}

Expand All @@ -45,10 +45,10 @@ struct ContributeButton: View {
private func buttonText() -> String {

switch _surcharge.status {
case .notDetermined: return ""
case .notDetermined, .rejected: return ""
case .unknown: return "\(R.string.localizable.reportForUnknownButtonTitle())🙏🏻"
case .reported: return ""
case .confirmed: return "\(R.string.localizable.reportForConfirmedButtonTitle())🤔"
case .confirmed, .autoGenerated: return "\(R.string.localizable.reportForConfirmedButtonTitle())🤔"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,30 @@ struct SurchargeView: View {
var body: some View {
VStack(spacing: 10) {

VStack(spacing: 10) {
HStack(spacing: 20) {

Text(_placeName)
.font(.headline)
.frame(maxWidth: .infinity, alignment: .leading)
.multilineTextAlignment(.leading)
Image(systemName: "storefront")
.imageScale(.large)
.shimmering(active: _isLoading)
.redacted(reason: _isLoading ? .placeholder : [])

Text(_placeAddress)
.font(.subheadline)
.frame(maxWidth: .infinity, alignment: .leading)
.multilineTextAlignment(.leading)
.shimmering(active: _isLoading)
.redacted(reason: _isLoading ? .placeholder : [])
VStack(spacing: 5) {

Text(_placeName)
.font(.headline)
.frame(maxWidth: .infinity, alignment: .leading)
.multilineTextAlignment(.leading)
.shimmering(active: _isLoading)
.redacted(reason: _isLoading ? .placeholder : [])

Text(_placeAddress)
.font(.subheadline)
.frame(maxWidth: .infinity, alignment: .leading)
.multilineTextAlignment(.leading)
.shimmering(active: _isLoading)
.redacted(reason: _isLoading ? .placeholder : [])
}

}

VStack(spacing: 10) {
Expand All @@ -75,7 +84,7 @@ struct SurchargeView: View {
.shimmering(active: _isLoading)
.cornerRadius(5)

case .unknown:
case .unknown, .rejected:

Text("\(R.string.localizable.surchargeStatusUnknownMessage())😞")
.font(.headline)
Expand All @@ -102,6 +111,15 @@ struct SurchargeView: View {
.font(.headline)
.surchargeStatusConfirmed()

case .autoGenerated:

Text(verbatim: _rateText(rate: _surcharge.rate))
.font(.largeTitle)

Text(verbatim: R.string.localizable.surchargeStatusAutoGenerated())
.font(.headline)
.surchargeStatusAutoGenerated()

}

if let updatedDate = _surcharge.updatedDate {
Expand All @@ -118,7 +136,7 @@ struct SurchargeView: View {

private func _rateText(rate: Double?) -> String {
if let rate = rate {
return rate == 0 ? "\(R.string.localizable.zeroRates)🎉" : "\(rate)%"
return rate == 0 ? "\(R.string.localizable.zeroRates())🎉" : "\(rate)%"
} else {
return R.string.localizable.surchargeStatusUnknown()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"colors" : [
{
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "14",
"green" : "77",
"red" : "133"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "light"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "14",
"green" : "77",
"red" : "133"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "display-p3",
"components" : {
"alpha" : "1.000",
"blue" : "13",
"green" : "77",
"red" : "133"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
"close"="Close";
"searchBoxPlaceholder"="Search your destination";
"searchButtonTitle"="Search";
"reportForUnknownButtonTitle"="We're welcome to your contribution.";
"reportForUnknownButtonTitle"="We welcome to your contribution.";
"reportForConfirmedButtonTitle"="Something wrong?";
"surchargeStatusUnknownMessage"="Haven't reported the surcharge rate yet";
"surchargeStatusUnknownMessage"="There is no reported surcharge rate yet";
"surchargeStatusUnknown"="Unknown";
"surchargeStatusReported"="Reported";
"surchargeStatusConfirmed"="Confirmed";
"surchargeStatusAutoGenerated"="Auto-Generated";
"updatedAt"="Updated at %@";
"recognitionSuccess"="Recognised🎉, Just in case please check the amounts, if it may not accurate.";
"recognitionSuccess"="Recognised🎉, please confirm amount entered, if it may not accurate.";
"recognitionNameNotMatched"="Place name is not matched.";
"reportProceedAnyway"="Do you think the recognition sucks?🤮\nTap here to proceed anyway.";
"recognitionExtractedPartially"="It is recognised partially. Please input the rest manually.";
Expand All @@ -48,23 +49,26 @@
"reportSuccessTitle"="Thank you for your contribution to";
"backToPlace"="Back to place";
"or"="or";
"surchargeStatusHelpDisclaimer"="Disclaimer: Although we are trying to provide the most accurate information, there may be some inaccuracies. Please use the information as a reference.";
"surchargeStatusHelpDiscription"="There are three types of surcharge status:";
"surchargeStatusHelpUnknown1"="Means the surcharge status is not yet known. We're please to receive your report.";
"surchargeStatusHelpUnknown2"="Remeber, Red colour is unknown about surcharge.";
"surchargeStatusHelpDisclaimer"="Disclaimer: Although we are trying to provide the most accurate information, there may be some inaccuracies. Please use the information as a guide only.";
"surchargeStatusHelpDiscription"="There are four types of surcharge status:";
"surchargeStatusHelpUnknown1"="Means the surcharge status is not yet known. We welcome your report.";
"surchargeStatusHelpUnknown2"="Remember, Red indicates surcharge is unknown.";
"surchargeStatusHelpUnknown2Emphasise"="Red";
"surchargeStatusHelpReported1"="Means the surcharge status is reported from someone who has passion to help others.\nHowever, it's not yet confirmed which means it may not be accurate.";
"surchargeStatusHelpReported2"="Remeber, Blue colour is reported but not confirmed.";
"surchargeStatusHelpReported2"="Remember, Blue indicates it is reported but not confirmed.";
"surchargeStatusHelpReported2Emphasise"="Blue";
"surchargeStatusHelpConfirmed1"="Means the surcharge status is confirmed by us. It's highly likely to be accurate.\nBut still, it may be accurate. Please check the updated date in place detail.";
"surchargeStatusHelpConfirmed2"="Remeber, Green colour is confirmed for surcharge information.";
"surchargeStatusHelpConfirmed1"="Means the surcharge status is confirmed by us. It's highly likely to be accurate.\nBut still, it may be inaccurate. Please check the updated date in place detail.";
"surchargeStatusHelpConfirmed2"="Remember, Green indicates confirmed surcharge information.";
"surchargeStatusHelpConfirmed2Emphasise"="Green";
"surchargeStatusHelpAutoGenerated1"="Big franchises are unlikely to charge a surcharge, so we automatically set it to zero. However, this may not be accurate.";
"surchargeStatusHelpAutoGenerated2"="Remember, Yellow indicates auto-generated surcharge information.";
"surchargeStatusHelpAutoGenerated2Emphasise"="Yellow";
"gotIt"="Got it";
"toastUnauthorised"="Do you want some permissions?";
"toastOutOfRegion"="Only available in";
"toastNoInternet"="Please check the Internet connection.";
"toastNewVersion"="New version available. Please update.";
"toastUnknown"="Oops🫢 Something went wrong. Please try again.";
"exposingAdsSuggestion"="If you are enjoy this app, and make it sustainable, is it okay to show you ads? It will show here and in the place list.";
"exposingAdsSuggestion"="Enjoying this app?\nWant to support us?\nLet us know if it is okay to show you ads.\nIt will appear here and in the place list.";
"exposingAdsAcceptButtonTitle"="Yes. Show me ads!";
"exposingAdsThanks"="Thank you for supporting us!";
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"surchargeStatusUnknown"="알려지지 않음";
"surchargeStatusReported"="보고 됨";
"surchargeStatusConfirmed"="확인 됨";
"surchargeStatusAutoGenerated"="자동 생성 됨";
"updatedAt"="%@에 업데이트 됨";
"recognitionSuccess"="인식완료🎉, 만약을 위해 다시 한 번 입력 된 금액을 확인해 주세요.";
"recognitionNameNotMatched"="상호명이 일치하지 않습니다.";
Expand All @@ -49,7 +50,7 @@
"backToPlace"="삼정으로 돌아가기";
"or"="또는";
"surchargeStatusHelpDisclaimer"="면책조항: 저희는 정확한 정보를 제공하려고 노력합니다만, 부정확한 정보가 있을 수 있습니다. Surcharge에서 제공되는 정보는 참고용으로만 사용해 주세요.";
"surchargeStatusHelpDiscription"="총 세개의 결제 수수료 상태가 있습니다:";
"surchargeStatusHelpDiscription"="총 네개의 결제 수수료 상태가 있습니다:";
"surchargeStatusHelpUnknown1"="보고 된 결제 수수료 정보가 없음을 의미합니다. 혹시 어딘가에서 결제한 영수증을 가지고 계시다면 저희에게 알려주세요.";
"surchargeStatusHelpUnknown2"="Surcharge의 어디서나 빨간색은 결제 수수료 정보가 알려지지 않음을 의미합니다.";
"surchargeStatusHelpUnknown2Emphasise"="빨간색";
Expand All @@ -59,6 +60,9 @@
"surchargeStatusHelpConfirmed1"="결제 수수료 정보가 확인 되었음을 의미합니다. 이 정보는 정확할 확률이 높습니다. 하지만 여전히, 부정확 할 수 있기 때문에 상점 상제 정보에서 업데이트 날짜를 확인해 주세요.";
"surchargeStatusHelpConfirmed2"="Surcharge의 어디서나 초록색은 결제 수수료 정보가 확인 되었음을 의미합니다.";
"surchargeStatusHelpConfirmed2Emphasise"="초록색";
"surchargeStatusHelpAutoGenerated1"="프렌차이즈 같은 큰 기업의 상점은 결제 수수료를 부과하지 않는 경우가 많습니다. 이에 대해 자동으로 결제 수수료 없음으로 표시합니다. 정확한 정보가 아닐 수 있습니다.";
"surchargeStatusHelpAutoGenerated2"="Surcharge의 어디서나 노란색은 결제 수수료 정보가 자동으로 생성되었음을 의미합니다.";
"surchargeStatusHelpAutoGenerated2Emphasise"="노란색";
"gotIt"="확인";
"toastUnauthorised"="무엇을 하고 싶으신가요? 필요한 권한이라도?";
"toastOutOfRegion"="다음 지역에서만 이용 가능합니다.";
Expand Down
Loading
Loading