-
Notifications
You must be signed in to change notification settings - Fork 1
SPM-175 주문관리 구현 / 주문 로직 구현 #18
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
d54ad66
[FEAT] 주문관리 화면, 주문관리 상세 화면 구현
Sangyoon98 2d38e1f
[FIX] Navigation 변경
Sangyoon98 f3c6399
[FEAT] 주문 로직 구현, 주문 취소, 입고 처리 연동
Sangyoon98 9430d1f
[REFAC] 미사용 Import 제거
Sangyoon98 1b4b94b
[FIX] 코드 래빗 리뷰 사항 수정
Sangyoon98 bed77cd
[FIX] 코드 래빗 리뷰 사항 수정
Sangyoon98 7b6058e
[FIX] 버튼 비활성화 로직 수정
Sangyoon98 3ece7b9
[FEAT] 리스트 스와이프 새로고침 기능 추가
Sangyoon98 81b543f
[FIX] 코드 래빗 리뷰 사항 수정
Sangyoon98 39c4736
[FIX] 코드 래빗 리뷰 사항 수정
Sangyoon98 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
37 changes: 37 additions & 0 deletions
37
app/src/main/java/com/sampoom/android/core/ui/component/StatusChip.kt
This file contains hidden or 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,37 @@ | ||
| package com.sampoom.android.core.ui.component | ||
|
|
||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.material3.MaterialTheme | ||
| import androidx.compose.material3.Surface | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.stringResource | ||
| import androidx.compose.ui.unit.dp | ||
| import com.sampoom.android.R | ||
| import com.sampoom.android.core.ui.theme.FailRed | ||
| import com.sampoom.android.core.ui.theme.SuccessGreen | ||
| import com.sampoom.android.core.ui.theme.WaitYellow | ||
| import com.sampoom.android.feature.order.domain.model.OrderStatus | ||
|
|
||
| @Composable | ||
| fun StatusChip(status: OrderStatus) { | ||
| val (text, color) = when (status) { | ||
| OrderStatus.PENDING -> stringResource(R.string.order_status_pending) to WaitYellow | ||
| OrderStatus.COMPLETED -> stringResource(R.string.order_status_completed) to SuccessGreen | ||
| OrderStatus.CANCELED -> stringResource(R.string.order_status_canceled) to FailRed | ||
| } | ||
|
|
||
| Surface( | ||
| shape = RoundedCornerShape(16.dp), | ||
| color = color.copy(alpha = 0.2F) | ||
| ) { | ||
| Text( | ||
| text = text, | ||
| modifier = Modifier.padding(horizontal = 12.dp, vertical = 6.dp), | ||
| style = MaterialTheme.typography.bodySmall, | ||
| color = color | ||
| ) | ||
| } | ||
| } |
29 changes: 29 additions & 0 deletions
29
app/src/main/java/com/sampoom/android/core/util/FormatDate.kt
This file contains hidden or 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,29 @@ | ||
| package com.sampoom.android.core.util | ||
|
|
||
| import android.os.Build | ||
| import androidx.annotation.RequiresApi | ||
| import java.time.format.DateTimeFormatter | ||
|
|
||
| @RequiresApi(Build.VERSION_CODES.O) | ||
| fun formatDate(dateString: String): String { | ||
| return runCatching { | ||
| val out = DateTimeFormatter.ISO_LOCAL_DATE | ||
| val hasOffset = | ||
| dateString.contains("Z") || (dateString.contains('T') && (dateString.lastIndexOf('+') > dateString.indexOf( | ||
| 'T' | ||
| ) || (dateString.lastIndexOf('-') > dateString.indexOf('T') && dateString.count { it == ':' } >= 3))) | ||
| val date = if (hasOffset) { | ||
| val inFmt = DateTimeFormatter.ISO_OFFSET_DATE_TIME | ||
| java.time.OffsetDateTime.parse(dateString, inFmt).toLocalDate() | ||
| } else { | ||
| val inFmt = java.time.format.DateTimeFormatterBuilder() | ||
| .appendPattern("yyyy-MM-dd'T'HH:mm:ss") | ||
| .optionalStart() | ||
| .appendFraction(java.time.temporal.ChronoField.NANO_OF_SECOND, 0, 6, true) | ||
| .optionalEnd() | ||
| .toFormatter(java.util.Locale.ROOT) | ||
| java.time.LocalDateTime.parse(dateString, inFmt).toLocalDate() | ||
| } | ||
| date.format(out) | ||
| }.getOrElse { dateString } | ||
| } |
26 changes: 26 additions & 0 deletions
26
app/src/main/java/com/sampoom/android/core/util/OrderTitle.kt
This file contains hidden or 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,26 @@ | ||
| package com.sampoom.android.core.util | ||
|
|
||
| import com.sampoom.android.feature.order.domain.model.Order | ||
| import com.sampoom.android.feature.order.domain.model.OrderPart | ||
|
|
||
| fun buildOrderTitle(order: Order): String { | ||
| val flattened: List<Triple<String /*category*/, String /*group*/, OrderPart>> = | ||
| order.items.flatMap { category -> | ||
| category.groups.flatMap { group -> | ||
| group.parts.map { part -> Triple(category.categoryName, group.groupName, part) } | ||
| } | ||
| } | ||
|
|
||
| if (flattened.isEmpty()) return "-" | ||
|
|
||
| val first = flattened.first() | ||
| val groupName = first.second | ||
| val part = first.third | ||
| val totalParts = flattened.size | ||
|
|
||
| return if (totalParts == 1) { | ||
| "$groupName - ${part.name} ${part.quantity}EA" | ||
| } else { | ||
| "$groupName - ${part.name} ${part.quantity}EA 외 ${totalParts - 1}건" | ||
| } | ||
|
Sangyoon98 marked this conversation as resolved.
|
||
| } | ||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.