mirror of
https://github.com/shaulascr/ecommerce_serang.git
synced 2025-08-14 11:02:21 +00:00
add address and shipping
This commit is contained in:
@ -0,0 +1,11 @@
|
||||
package com.alya.ecommerce_serang.data.api.dto
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class CartItem (
|
||||
@SerializedName("product_id")
|
||||
val productId: Int,
|
||||
|
||||
@SerializedName("quantity")
|
||||
val quantity: Int
|
||||
)
|
@ -0,0 +1,19 @@
|
||||
package com.alya.ecommerce_serang.data.api.dto
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class CourierCostRequest(
|
||||
@SerializedName("address_id")
|
||||
val addressId: Int,
|
||||
|
||||
@SerializedName("items")
|
||||
val itemCost: CostProduct
|
||||
)
|
||||
|
||||
data class CostProduct (
|
||||
@SerializedName("product_id")
|
||||
val productId: Int,
|
||||
|
||||
@SerializedName("quantity")
|
||||
val quantity: Int
|
||||
)
|
@ -1,91 +0,0 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class OrderListResponse(
|
||||
|
||||
@field:SerializedName("orders")
|
||||
val orders: List<OrdersItem>,
|
||||
|
||||
@field:SerializedName("message")
|
||||
val message: String
|
||||
)
|
||||
|
||||
data class OrdersItem(
|
||||
|
||||
@field:SerializedName("receipt_num")
|
||||
val receiptNum: String,
|
||||
|
||||
@field:SerializedName("latitude")
|
||||
val latitude: String,
|
||||
|
||||
@field:SerializedName("created_at")
|
||||
val createdAt: String,
|
||||
|
||||
@field:SerializedName("voucher_code")
|
||||
val voucherCode: String? = null,
|
||||
|
||||
@field:SerializedName("updated_at")
|
||||
val updatedAt: String,
|
||||
|
||||
@field:SerializedName("street")
|
||||
val street: String,
|
||||
|
||||
@field:SerializedName("longitude")
|
||||
val longitude: String,
|
||||
|
||||
@field:SerializedName("shipment_status")
|
||||
val shipmentStatus: String,
|
||||
|
||||
@field:SerializedName("order_items")
|
||||
val orderItems: List<OrderItemsItem>,
|
||||
|
||||
@field:SerializedName("is_store_location")
|
||||
val isStoreLocation: Boolean,
|
||||
|
||||
@field:SerializedName("voucher_name")
|
||||
val voucherName: String? = null,
|
||||
|
||||
@field:SerializedName("address_id")
|
||||
val addressId: Int,
|
||||
|
||||
@field:SerializedName("payment_method_id")
|
||||
val paymentMethodId: Int,
|
||||
|
||||
@field:SerializedName("total_amount")
|
||||
val totalAmount: String,
|
||||
|
||||
@field:SerializedName("user_id")
|
||||
val userId: Int,
|
||||
|
||||
@field:SerializedName("province_id")
|
||||
val provinceId: Int,
|
||||
|
||||
@field:SerializedName("courier")
|
||||
val courier: String,
|
||||
|
||||
@field:SerializedName("subdistrict")
|
||||
val subdistrict: String,
|
||||
|
||||
@field:SerializedName("service")
|
||||
val service: String,
|
||||
|
||||
@field:SerializedName("shipment_price")
|
||||
val shipmentPrice: String,
|
||||
|
||||
@field:SerializedName("voucher_id")
|
||||
val voucherId: Int? = null,
|
||||
|
||||
@field:SerializedName("detail")
|
||||
val detail: String,
|
||||
|
||||
@field:SerializedName("postal_code")
|
||||
val postalCode: String,
|
||||
|
||||
@field:SerializedName("order_id")
|
||||
val orderId: Int,
|
||||
|
||||
@field:SerializedName("city_id")
|
||||
val cityId: Int
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.auth
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.auth
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.auth
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
@ -1,19 +1,19 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.order
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class OrderResponse(
|
||||
data class CreateOrderResponse(
|
||||
|
||||
@field:SerializedName("shipping")
|
||||
@field:SerializedName("shipping")
|
||||
val shipping: Shipping,
|
||||
|
||||
@field:SerializedName("order_item")
|
||||
@field:SerializedName("order_item")
|
||||
val orderItem: List<OrderItemItem>,
|
||||
|
||||
@field:SerializedName("message")
|
||||
@field:SerializedName("message")
|
||||
val message: String,
|
||||
|
||||
@field:SerializedName("order")
|
||||
@field:SerializedName("order")
|
||||
val order: Order
|
||||
)
|
||||
|
@ -1,13 +1,13 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.order
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class OrderDetailResponse(
|
||||
|
||||
@field:SerializedName("orders")
|
||||
@field:SerializedName("orders")
|
||||
val orders: Orders,
|
||||
|
||||
@field:SerializedName("message")
|
||||
@field:SerializedName("message")
|
||||
val message: String
|
||||
)
|
||||
|
||||
@ -40,90 +40,90 @@ data class OrderItemsItem(
|
||||
|
||||
data class Orders(
|
||||
|
||||
@field:SerializedName("receipt_num")
|
||||
@field:SerializedName("receipt_num")
|
||||
val receiptNum: String,
|
||||
|
||||
@field:SerializedName("latitude")
|
||||
@field:SerializedName("latitude")
|
||||
val latitude: String,
|
||||
|
||||
@field:SerializedName("created_at")
|
||||
@field:SerializedName("created_at")
|
||||
val createdAt: String,
|
||||
|
||||
@field:SerializedName("voucher_code")
|
||||
@field:SerializedName("voucher_code")
|
||||
val voucherCode: String? = null,
|
||||
|
||||
@field:SerializedName("updated_at")
|
||||
@field:SerializedName("updated_at")
|
||||
val updatedAt: String,
|
||||
|
||||
@field:SerializedName("etd")
|
||||
@field:SerializedName("etd")
|
||||
val etd: String,
|
||||
|
||||
@field:SerializedName("street")
|
||||
@field:SerializedName("street")
|
||||
val street: String,
|
||||
|
||||
@field:SerializedName("cancel_date")
|
||||
@field:SerializedName("cancel_date")
|
||||
val cancelDate: String,
|
||||
|
||||
@field:SerializedName("longitude")
|
||||
@field:SerializedName("longitude")
|
||||
val longitude: String,
|
||||
|
||||
@field:SerializedName("shipment_status")
|
||||
@field:SerializedName("shipment_status")
|
||||
val shipmentStatus: String,
|
||||
|
||||
@field:SerializedName("order_items")
|
||||
@field:SerializedName("order_items")
|
||||
val orderItems: List<OrderItemsItem>,
|
||||
|
||||
@field:SerializedName("auto_completed_at")
|
||||
@field:SerializedName("auto_completed_at")
|
||||
val autoCompletedAt: String,
|
||||
|
||||
@field:SerializedName("is_store_location")
|
||||
@field:SerializedName("is_store_location")
|
||||
val isStoreLocation: Boolean,
|
||||
|
||||
@field:SerializedName("voucher_name")
|
||||
@field:SerializedName("voucher_name")
|
||||
val voucherName: String? = null,
|
||||
|
||||
@field:SerializedName("address_id")
|
||||
@field:SerializedName("address_id")
|
||||
val addressId: Int,
|
||||
|
||||
@field:SerializedName("payment_method_id")
|
||||
@field:SerializedName("payment_method_id")
|
||||
val paymentMethodId: Int,
|
||||
|
||||
@field:SerializedName("cancel_reason")
|
||||
@field:SerializedName("cancel_reason")
|
||||
val cancelReason: String,
|
||||
|
||||
@field:SerializedName("total_amount")
|
||||
@field:SerializedName("total_amount")
|
||||
val totalAmount: String,
|
||||
|
||||
@field:SerializedName("user_id")
|
||||
@field:SerializedName("user_id")
|
||||
val userId: Int,
|
||||
|
||||
@field:SerializedName("province_id")
|
||||
@field:SerializedName("province_id")
|
||||
val provinceId: Int,
|
||||
|
||||
@field:SerializedName("courier")
|
||||
@field:SerializedName("courier")
|
||||
val courier: String,
|
||||
|
||||
@field:SerializedName("subdistrict")
|
||||
@field:SerializedName("subdistrict")
|
||||
val subdistrict: String,
|
||||
|
||||
@field:SerializedName("service")
|
||||
@field:SerializedName("service")
|
||||
val service: String,
|
||||
|
||||
@field:SerializedName("shipment_price")
|
||||
@field:SerializedName("shipment_price")
|
||||
val shipmentPrice: String,
|
||||
|
||||
@field:SerializedName("voucher_id")
|
||||
@field:SerializedName("voucher_id")
|
||||
val voucherId: Int? = null,
|
||||
|
||||
@field:SerializedName("detail")
|
||||
@field:SerializedName("detail")
|
||||
val detail: String,
|
||||
|
||||
@field:SerializedName("postal_code")
|
||||
@field:SerializedName("postal_code")
|
||||
val postalCode: String,
|
||||
|
||||
@field:SerializedName("order_id")
|
||||
@field:SerializedName("order_id")
|
||||
val orderId: Int,
|
||||
|
||||
@field:SerializedName("city_id")
|
||||
@field:SerializedName("city_id")
|
||||
val cityId: Int
|
||||
)
|
@ -0,0 +1,91 @@
|
||||
package com.alya.ecommerce_serang.data.api.response.order
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class OrderListResponse(
|
||||
|
||||
@field:SerializedName("orders")
|
||||
val orders: List<OrdersItem>,
|
||||
|
||||
@field:SerializedName("message")
|
||||
val message: String
|
||||
)
|
||||
|
||||
data class OrdersItem(
|
||||
|
||||
@field:SerializedName("receipt_num")
|
||||
val receiptNum: String,
|
||||
|
||||
@field:SerializedName("latitude")
|
||||
val latitude: String,
|
||||
|
||||
@field:SerializedName("created_at")
|
||||
val createdAt: String,
|
||||
|
||||
@field:SerializedName("voucher_code")
|
||||
val voucherCode: String? = null,
|
||||
|
||||
@field:SerializedName("updated_at")
|
||||
val updatedAt: String,
|
||||
|
||||
@field:SerializedName("street")
|
||||
val street: String,
|
||||
|
||||
@field:SerializedName("longitude")
|
||||
val longitude: String,
|
||||
|
||||
@field:SerializedName("shipment_status")
|
||||
val shipmentStatus: String,
|
||||
|
||||
@field:SerializedName("order_items")
|
||||
val orderItems: List<OrderItemsItem>,
|
||||
|
||||
@field:SerializedName("is_store_location")
|
||||
val isStoreLocation: Boolean,
|
||||
|
||||
@field:SerializedName("voucher_name")
|
||||
val voucherName: String? = null,
|
||||
|
||||
@field:SerializedName("address_id")
|
||||
val addressId: Int,
|
||||
|
||||
@field:SerializedName("payment_method_id")
|
||||
val paymentMethodId: Int,
|
||||
|
||||
@field:SerializedName("total_amount")
|
||||
val totalAmount: String,
|
||||
|
||||
@field:SerializedName("user_id")
|
||||
val userId: Int,
|
||||
|
||||
@field:SerializedName("province_id")
|
||||
val provinceId: Int,
|
||||
|
||||
@field:SerializedName("courier")
|
||||
val courier: String,
|
||||
|
||||
@field:SerializedName("subdistrict")
|
||||
val subdistrict: String,
|
||||
|
||||
@field:SerializedName("service")
|
||||
val service: String,
|
||||
|
||||
@field:SerializedName("shipment_price")
|
||||
val shipmentPrice: String,
|
||||
|
||||
@field:SerializedName("voucher_id")
|
||||
val voucherId: Int? = null,
|
||||
|
||||
@field:SerializedName("detail")
|
||||
val detail: String,
|
||||
|
||||
@field:SerializedName("postal_code")
|
||||
val postalCode: String,
|
||||
|
||||
@field:SerializedName("order_id")
|
||||
val orderId: Int,
|
||||
|
||||
@field:SerializedName("city_id")
|
||||
val cityId: Int
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.product
|
||||
|
||||
import com.alya.ecommerce_serang.data.api.dto.ProductsItem
|
||||
import com.google.gson.annotations.SerializedName
|
@ -1,13 +1,13 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.product
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class AllStoreResponse(
|
||||
|
||||
@field:SerializedName("store")
|
||||
@field:SerializedName("store")
|
||||
val store: AllStore,
|
||||
|
||||
@field:SerializedName("message")
|
||||
@field:SerializedName("message")
|
||||
val message: String
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.product
|
||||
|
||||
import com.alya.ecommerce_serang.data.api.dto.CategoryItem
|
||||
import com.google.gson.annotations.SerializedName
|
@ -1,13 +1,13 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.product
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class DetailStoreProductResponse(
|
||||
|
||||
@field:SerializedName("store")
|
||||
@field:SerializedName("store")
|
||||
val store: StoreProduct,
|
||||
|
||||
@field:SerializedName("message")
|
||||
@field:SerializedName("message")
|
||||
val message: String
|
||||
)
|
||||
|
@ -1,13 +1,13 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.product
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class ProductResponse(
|
||||
|
||||
@field:SerializedName("product")
|
||||
@field:SerializedName("product")
|
||||
val product: Product,
|
||||
|
||||
@field:SerializedName("message")
|
||||
@field:SerializedName("message")
|
||||
val message: String
|
||||
)
|
||||
|
@ -1,13 +1,13 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.product
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class ReviewProductResponse(
|
||||
|
||||
@field:SerializedName("reviews")
|
||||
@field:SerializedName("reviews")
|
||||
val reviews: List<ReviewsItem>,
|
||||
|
||||
@field:SerializedName("message")
|
||||
@field:SerializedName("message")
|
||||
val message: String
|
||||
)
|
||||
|
@ -1,19 +1,19 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.product
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class StoreResponse(
|
||||
|
||||
@field:SerializedName("shipping")
|
||||
@field:SerializedName("shipping")
|
||||
val shipping: List<ShippingItem>,
|
||||
|
||||
@field:SerializedName("payment")
|
||||
@field:SerializedName("payment")
|
||||
val payment: List<PaymentItem>,
|
||||
|
||||
@field:SerializedName("store")
|
||||
@field:SerializedName("store")
|
||||
val store: Store,
|
||||
|
||||
@field:SerializedName("message")
|
||||
@field:SerializedName("message")
|
||||
val message: String
|
||||
)
|
||||
|
@ -1,13 +1,13 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.profile
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
data class AddressResponse(
|
||||
|
||||
@field:SerializedName("addresses")
|
||||
@field:SerializedName("addresses")
|
||||
val addresses: List<AddressesItem>,
|
||||
|
||||
@field:SerializedName("message")
|
||||
@field:SerializedName("message")
|
||||
val message: String
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.profile
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
@ -1,4 +1,4 @@
|
||||
package com.alya.ecommerce_serang.data.api.response
|
||||
package com.alya.ecommerce_serang.data.api.response.profile
|
||||
|
||||
import com.alya.ecommerce_serang.data.api.dto.UserProfile
|
||||
import com.google.gson.annotations.SerializedName
|
@ -1,22 +1,27 @@
|
||||
package com.alya.ecommerce_serang.data.api.retrofit
|
||||
|
||||
import com.alya.ecommerce_serang.data.api.dto.CartItem
|
||||
import com.alya.ecommerce_serang.data.api.dto.CourierCostRequest
|
||||
import com.alya.ecommerce_serang.data.api.dto.CreateAddressRequest
|
||||
import com.alya.ecommerce_serang.data.api.dto.LoginRequest
|
||||
import com.alya.ecommerce_serang.data.api.dto.OrderRequest
|
||||
import com.alya.ecommerce_serang.data.api.dto.OtpRequest
|
||||
import com.alya.ecommerce_serang.data.api.dto.RegisterRequest
|
||||
import com.alya.ecommerce_serang.data.api.response.AddressResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.AllProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.CategoryResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.DetailStoreProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.LoginResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.OrderResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.OtpResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.ProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.ProfileResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.RegisterResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.ReviewProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.StoreResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.LoginResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.OtpResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.RegisterResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.cart.AddCartResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.cart.ListCartResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.order.CourierCostResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.order.CreateOrderResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.product.AllProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.product.CategoryResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.product.DetailStoreProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.product.ProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.product.ReviewProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.product.StoreResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.profile.AddressResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.profile.ProfileResponse
|
||||
import retrofit2.Response
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.GET
|
||||
@ -32,7 +37,7 @@ interface ApiService {
|
||||
@POST("otp")
|
||||
suspend fun getOTP(
|
||||
@Body otpRequest: OtpRequest
|
||||
):OtpResponse
|
||||
): OtpResponse
|
||||
|
||||
@POST("login")
|
||||
suspend fun login(
|
||||
@ -67,13 +72,31 @@ interface ApiService {
|
||||
@POST("order")
|
||||
suspend fun postOrder(
|
||||
@Body request: OrderRequest
|
||||
): Response<OrderResponse>
|
||||
): Response<CreateOrderResponse>
|
||||
|
||||
@GET("profile/address")
|
||||
suspend fun getAddress(
|
||||
): Response<AddressResponse>
|
||||
|
||||
@POST("profile/addaddress")
|
||||
suspend fun createAddress(
|
||||
@Body addressRequest: CreateAddressRequest
|
||||
): Response<AddressResponse>
|
||||
|
||||
|
||||
@GET("mystore")
|
||||
suspend fun getStore (): Response<StoreResponse>
|
||||
|
||||
@GET("cart_item")
|
||||
suspend fun getCart (): Response<ListCartResponse>
|
||||
|
||||
@POST("cart/add")
|
||||
suspend fun addCart(
|
||||
@Body cartRequest: CartItem
|
||||
): Response<AddCartResponse>
|
||||
|
||||
@POST("couriercost")
|
||||
suspend fun countCourierCost(
|
||||
@Body courierCost : CourierCostRequest
|
||||
): CourierCostResponse
|
||||
}
|
@ -2,9 +2,9 @@ package com.alya.ecommerce_serang.data.repository
|
||||
|
||||
import android.util.Log
|
||||
import com.alya.ecommerce_serang.data.api.dto.OrderRequest
|
||||
import com.alya.ecommerce_serang.data.api.response.OrderResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.ProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.StoreResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.order.CreateOrderResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.product.ProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.product.StoreResponse
|
||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiService
|
||||
import retrofit2.Response
|
||||
|
||||
@ -24,7 +24,7 @@ class OrderRepository(private val apiService: ApiService) {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun createOrder(orderRequest: OrderRequest): Response<OrderResponse> {
|
||||
suspend fun createOrder(orderRequest: OrderRequest): Response<CreateOrderResponse> {
|
||||
return apiService.postOrder(orderRequest)
|
||||
}
|
||||
|
||||
|
@ -3,8 +3,8 @@ package com.alya.ecommerce_serang.data.repository
|
||||
import android.util.Log
|
||||
import com.alya.ecommerce_serang.data.api.dto.CategoryItem
|
||||
import com.alya.ecommerce_serang.data.api.dto.ProductsItem
|
||||
import com.alya.ecommerce_serang.data.api.response.ProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.ReviewsItem
|
||||
import com.alya.ecommerce_serang.data.api.response.product.ProductResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.product.ReviewsItem
|
||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiService
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.withContext
|
||||
|
@ -4,8 +4,8 @@ import com.alya.ecommerce_serang.data.api.dto.LoginRequest
|
||||
import com.alya.ecommerce_serang.data.api.dto.OtpRequest
|
||||
import com.alya.ecommerce_serang.data.api.dto.RegisterRequest
|
||||
import com.alya.ecommerce_serang.data.api.dto.UserProfile
|
||||
import com.alya.ecommerce_serang.data.api.response.LoginResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.OtpResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.LoginResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.OtpResponse
|
||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiService
|
||||
|
||||
class UserRepository(private val apiService: ApiService) {
|
||||
|
@ -4,7 +4,7 @@ import androidx.lifecycle.LiveData
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.alya.ecommerce_serang.data.api.response.LoginResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.LoginResponse
|
||||
import com.alya.ecommerce_serang.data.repository.Result
|
||||
import com.alya.ecommerce_serang.data.repository.UserRepository
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -6,7 +6,7 @@ import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.alya.ecommerce_serang.data.api.dto.RegisterRequest
|
||||
import com.alya.ecommerce_serang.data.api.response.OtpResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.auth.OtpResponse
|
||||
import com.alya.ecommerce_serang.data.repository.Result
|
||||
import com.alya.ecommerce_serang.data.repository.UserRepository
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.alya.ecommerce_serang.ui.order
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.alya.ecommerce_serang.R
|
||||
|
||||
class AddAddressActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
setContentView(R.layout.activity_add_address)
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
||||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||
insets
|
||||
}
|
||||
}
|
||||
}
|
@ -7,11 +7,9 @@ import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.alya.ecommerce_serang.data.api.dto.CheckoutData
|
||||
import com.alya.ecommerce_serang.data.api.dto.OrderRequest
|
||||
import com.alya.ecommerce_serang.data.api.response.AddressesItem
|
||||
import com.alya.ecommerce_serang.data.api.response.OrderResponse
|
||||
import com.alya.ecommerce_serang.data.api.response.PaymentItem
|
||||
import com.alya.ecommerce_serang.data.api.response.profile.AddressesItem
|
||||
import com.alya.ecommerce_serang.data.api.response.product.PaymentItem
|
||||
import com.alya.ecommerce_serang.data.repository.OrderRepository
|
||||
import com.alya.ecommerce_serang.data.repository.Result
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
class CheckoutViewModel(private val repository: OrderRepository) : ViewModel() {
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.alya.ecommerce_serang.ui.order
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.view.ViewCompat
|
||||
import androidx.core.view.WindowInsetsCompat
|
||||
import com.alya.ecommerce_serang.R
|
||||
|
||||
class EditAddressActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
enableEdgeToEdge()
|
||||
setContentView(R.layout.activity_edit_address)
|
||||
ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
|
||||
val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
|
||||
v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
|
||||
insets
|
||||
}
|
||||
}
|
||||
}
|
@ -12,8 +12,8 @@ import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.alya.ecommerce_serang.BuildConfig.BASE_URL
|
||||
import com.alya.ecommerce_serang.R
|
||||
import com.alya.ecommerce_serang.data.api.dto.ProductsItem
|
||||
import com.alya.ecommerce_serang.data.api.response.Product
|
||||
import com.alya.ecommerce_serang.data.api.response.ReviewsItem
|
||||
import com.alya.ecommerce_serang.data.api.response.product.Product
|
||||
import com.alya.ecommerce_serang.data.api.response.product.ReviewsItem
|
||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiConfig
|
||||
import com.alya.ecommerce_serang.data.api.retrofit.ApiService
|
||||
import com.alya.ecommerce_serang.data.repository.ProductRepository
|
||||
|
@ -6,9 +6,9 @@ import androidx.lifecycle.MutableLiveData
|
||||
import androidx.lifecycle.ViewModel
|
||||
import androidx.lifecycle.viewModelScope
|
||||
import com.alya.ecommerce_serang.data.api.dto.ProductsItem
|
||||
import com.alya.ecommerce_serang.data.api.response.Product
|
||||
import com.alya.ecommerce_serang.data.api.response.ReviewsItem
|
||||
import com.alya.ecommerce_serang.data.api.response.Store
|
||||
import com.alya.ecommerce_serang.data.api.response.product.Product
|
||||
import com.alya.ecommerce_serang.data.api.response.product.ReviewsItem
|
||||
import com.alya.ecommerce_serang.data.api.response.product.Store
|
||||
import com.alya.ecommerce_serang.data.repository.ProductRepository
|
||||
import com.alya.ecommerce_serang.data.repository.Result
|
||||
import kotlinx.coroutines.launch
|
||||
|
@ -6,7 +6,7 @@ import android.view.ViewGroup
|
||||
import android.widget.TextView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.alya.ecommerce_serang.R
|
||||
import com.alya.ecommerce_serang.data.api.response.ReviewsItem
|
||||
import com.alya.ecommerce_serang.data.api.response.product.ReviewsItem
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.Locale
|
||||
import java.util.TimeZone
|
||||
|
Reference in New Issue
Block a user