package com.yono.messeripos.daos;

import androidx.lifecycle.LiveData;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.yono.messeripos.models.PaymentPending;
import com.yono.messeripos.models.ProductCartModels;

import java.util.List;

@Dao
public interface PaymentPendingDaos {
    @Query("SELECT * FROM paymentPending ORDER BY id DESC")
    public LiveData<List<PaymentPending>> getAll();

    @Query("SELECT * FROM paymentPending WHERE id_orders = :idOrders")
    public LiveData<List<PaymentPending>> getPaymentByIdOrder(String idOrders);

    @Insert(onConflict = OnConflictStrategy.IGNORE)
    public void insertPaymentPending(PaymentPending paymentPending);

    @Query("UPDATE paymentPending SET id_nfc = :idNfc WHERE id = :id")
    public void updateNfc (String idNfc, long id);
}
