Build a Cash Register Project no puedo ver el error de mi codigo llevo 5 dias con este problema no se que hacer alguien podra ayudarme por favor

este mi html

 <html>
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <meta name="description" content="Build a Cash Register Project" />
        <title>Build a Cash Register Project</title>
        <link rel="stylesheet" href="./styles.css" />
    </head>
    <body>
        <header>
            <h1>Cash Register Project</h1>
        </header>
        <main>
                <div id="change-due"></div>
                <label for="cash">Enter cash from customer:</label>
                <input id="cash" type="number"/>
                
                <button id="purchase-btn" type="button" value>Purchase</button>
                <div id="cash-drawer"></div>
        </main>
        <script src="./script.js"></script>
    </body>
</html>  

este es mi javascript

const cashInput = document.getElementById("cash");  
const changeDueText = document.getElementById("change-due");  
const purchaseBtn = document.getElementById("purchase-btn");  
//const cashDrawerText = document.getElementById("cash-drawer");  

let price = 19.5;  
let cid = [  
    ["PENNY", 0.5],  
    ["NICKEL", 0],  
    ["DIME", 0],  
    ["QUARTER", 0],  
    ["ONE", 0],  
    ["FIVE", 0],  
    ["TEN", 0],  
    ["TWENTY", 0],  
    ["ONE HUNDRED", 0]  
];  

const denominationValues = {  
    "PENNY": 0.01,  
    "NICKEL": 0.05,  
    "DIME": 0.10,  
    "QUARTER": 0.25,  
    "ONE": 1,  
    "FIVE": 5,  
    "TEN": 10,  
    "TWENTY": 20,  
    "ONE HUNDRED": 100  
};  

const getCID = () => {  
    return parseFloat(cid.reduce((accumulator, currVal) => accumulator + currVal[1], 0)).toFixed(2);  
};  

const updateChangeDueText = (customerChange) => {  
    let text = `Status: ${getCID() > 0 ? "OPEN" : "CLOSED"}`; // Cambiar lógica de cómo se determina el estado  

    for (const prop in customerChange) {  
        text += ` ${prop}: $${customerChange[prop].toFixed(2)}`; // Asegúrate de mostrar dos decimales  
    }  

    return text;  
};  

const processPayment = () => {  
    const isValidString = filterInput(cashInput.value);  

    if (!isValidString) {  
        alert("Please enter a valid cash amount.");  
        return;  
    }  

    const cash = parseFloat(cashInput.value);  
    let changeDue = cash - price;  

    if (cash < price) {  
        alert("Customer does not have enough money to purchase the item");  
        cashInput.value = "";  
        return;  
    } else if (cash === price) {  
        changeDueText.textContent = "No change due - customer paid with exact cash";  
        cashInput.value = "";  
        return;  
    }  

    const customerChange = {};  

    for (const denomination of cid) { // Se utiliza cid en lugar de cidReverse  
        while (changeDue >= denominationValues[denomination[0]] && denomination[1] > 0) {  
            changeDue = parseFloat((changeDue - denominationValues[denomination[0]]).toFixed(2));  
            denomination[1] = parseFloat((denomination[1] - denominationValues[denomination[0]]).toFixed(2));  
            customerChange[denomination[0]] = customerChange[denomination[0]] ?  
parseFloat((customerChange[denomination[0]] + denominationValues[denomination[0]]).toFixed(2)) 
: denominationValues[denomination[0]];  
        }  
    }  

    changeDueText.textContent = changeDue > 0 ? "Status: INSUFFICIENT_FUNDS" : updateChangeDueText(customerChange);  

    cashInput.value = "";  
    return;  
};  


const filterInput = (cashString) => {  
    return /^(\d+(\.\d{0,2})?)?$/.test(cashString); // Se corrige la expresión regular para aceptar hasta dos decimales  
};  

purchaseBtn.addEventListener("click", processPayment);  
cashInput.addEventListener("keydown", (event) => {  
    if (event.key === "Enter") {  
        processPayment();  
    }  

});

porfavor alguien me ayude

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

This is the link to the project, when you ask for help it’s important you include it.

there is something wrong with the way you calculate the change, with test first failed test you give back change in PENNIES when it’s expected change in QUARTERS, you need to give back the bigger coin first

igual sale el mismo error

no me doy cuenta donde puede estar el error

what have you changed? what is your updated code?

Error en el Botón de “Purchase”:

el value en la declaración del botón como propiedad, pero no le asignado ningún valor. Así se genera un error o una incongruencia. En HTML, el value en un botón es generalmente redundante cuando se usa el tipo button, así que se puede eliminar.

Lógica para Calcular los Cambios:

La lógica de mi processPayment debería comprobar si tengo suficiente cambio disponible. Si no es suficiente, se debe retornar el estado de “INSUFFICIENT_FUNDS”, pero parece que ya has implementado esta lógica.

Verificación de Efectivo Entrante:

La entrada de efectivo debería ser de al menos el precio del producto y estar verificada por la función filterInput, lo cual hecho correctamente.
Asegúrame de No Utilizar la Variable cid Sin Definir Su Cantidad Inicial aqui esta mi codigo https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures-v8/build-a-cash-register-project/build-a-cash-register

Unfortunately that is not your code, you will need to copy and paste your code here

When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').