package com.example.tabbuy.data.local.dao

import androidx.room.*
import com.example.tabbuy.data.local.entity.KeranjangEntity

@Dao
interface KeranjangDao {
    @Query("SELECT * FROM keranjang")
    suspend fun getAllKeranjang(): List<KeranjangEntity>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(keranjang: KeranjangEntity)

    @Update
    suspend fun update(keranjang: KeranjangEntity)

    @Delete
    suspend fun delete(keranjang: KeranjangEntity)

    @Query("DELETE FROM keranjang")
    suspend fun clearKeranjang()
}
