Update warranty status to use backend calculation and add comprehensive tests
Client-Side Changes: - Add WarrantyStatus data class to Document model for backend-calculated status - Update WarrantyCard to display backend status (statusText, statusColor) with client fallback - Fix document list refresh: call loadDocuments() after create/update operations Testing: - Add ComprehensiveDocumentWarrantyTests with 25+ XCUITest cases - Test document creation, update, delete, image upload - Test warranty-specific fields and property selection - Test both general documents and warranties - Includes helper methods for form interaction and cleanup Other: - Update ApiConfig and PushNotificationManager 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,13 @@ package com.example.mycrib.models
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class WarrantyStatus(
|
||||
@SerialName("status_text") val statusText: String,
|
||||
@SerialName("status_color") val statusColor: String,
|
||||
@SerialName("is_expiring_soon") val isExpiringSoon: Boolean
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class DocumentImage(
|
||||
val id: Int? = null,
|
||||
@@ -48,6 +55,7 @@ data class Document(
|
||||
val notes: String? = null,
|
||||
@SerialName("is_active") val isActive: Boolean = true,
|
||||
@SerialName("days_until_expiration") val daysUntilExpiration: Int? = null,
|
||||
@SerialName("warranty_status") val warrantyStatus: WarrantyStatus? = null,
|
||||
@SerialName("created_at") val createdAt: String? = null,
|
||||
@SerialName("updated_at") val updatedAt: String? = null
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ package com.example.mycrib.network
|
||||
*/
|
||||
object ApiConfig {
|
||||
// ⚠️ CHANGE THIS TO TOGGLE ENVIRONMENT ⚠️
|
||||
val CURRENT_ENV = Environment.DEV
|
||||
val CURRENT_ENV = Environment.LOCAL
|
||||
|
||||
enum class Environment {
|
||||
LOCAL,
|
||||
|
||||
Reference in New Issue
Block a user