mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-23 01:00:23 +00:00
falta el update carrito del backend
This commit is contained in:
@ -0,0 +1,28 @@
|
||||
package com.imprimelibros.erp.pedido;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class PedidoService {
|
||||
|
||||
public int hasDescuentoFidelidad() {
|
||||
// descuento entre el 1% y el 6% para clientes fidelidad (mas de 1500€ en el ultimo año)
|
||||
double totalGastado = 1600.0; // Ejemplo, deberías obtenerlo del historial del cliente
|
||||
if(totalGastado < 1200) {
|
||||
return 0;
|
||||
} else if(totalGastado >= 1200 && totalGastado < 1999) {
|
||||
return 1;
|
||||
} else if(totalGastado >= 2000 && totalGastado < 2999) {
|
||||
return 2;
|
||||
} else if(totalGastado >= 3000 && totalGastado < 3999) {
|
||||
return 3;
|
||||
} else if(totalGastado >= 4000 && totalGastado < 4999) {
|
||||
return 4;
|
||||
} else if(totalGastado >= 5000 && totalGastado < 9999) {
|
||||
return 5;
|
||||
} else if(totalGastado >= 10000) {
|
||||
return 6;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user