package com.web.dto;

import com.web.dto.ResponsePayment;
import com.web.entity.Cart;
import com.web.entity.User;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class PaymentSession {

    private ResponsePayment responsePayment;
    private String fullname;
    private String phone;
    private String address;
    private String note;

    private User user; // nếu login
    private List<Cart> cartList; // giỏ hàng cho guest hoặc user

    public PaymentSession() {
    }

    // Constructor khi chưa có giỏ hàng (ví dụ thanh toán online)
    public PaymentSession(ResponsePayment responsePayment, String fullname, String phone, String address, String note) {
        this.responsePayment = responsePayment;
        this.fullname = fullname;
        this.phone = phone;
        this.address = address;
        this.note = note;
    }

    // Constructor full: dùng cho guest hoặc user đã login
    public PaymentSession(ResponsePayment responsePayment, String fullname, String phone, String address, String note,
                          User user, List<Cart> cartList) {
        this.responsePayment = responsePayment;
        this.fullname = fullname;
        this.phone = phone;
        this.address = address;
        this.note = note;
        this.user = user;
        this.cartList = cartList;
    }
}
