Passer commande #4

Merged
Marvin AUBERT merged 23 commits from PasserCommande into main 2026-06-14 21:46:25 +02:00
3 changed files with 15 additions and 6 deletions
Showing only changes of commit ae8daf5e2c - Show all commits
@@ -15,7 +15,18 @@ public final class CommandeConverter {
.ville(adressInfo.ville())
.codePostal(adressInfo.codePostal())
.pays(adressInfo.pays())
.modePaiement(modePaiement)
.modePaiement(commandeInfo.modePayement())
.build();
}
public static Commande toDomain(CommandeInfo commandeInfo, AdresseInfo adressInfo) {
return Commande.builder()
.lignesCommande(commandeInfo.listeLigne())
.rue(adressInfo.rue())
.ville(adressInfo.ville())
.codePostal(adressInfo.codePostal())
.pays(adressInfo.pays())
.modePaiement(commandeInfo.modePayement())
.build();
}
@@ -1,15 +1,13 @@
package fr.iut_fbleau.but3.dev62.mylibrary.commande.repository;
import fr.iut_fbleau.but3.dev62.mylibrary.book.entity.Book;
import fr.iut_fbleau.but3.dev62.mylibrary.commande.entity.Commande;
import fr.iut_fbleau.but3.dev62.mylibrary.customer.entity.Customer;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
public class ComandeRepository {
public class CommandeRepository {
private final List<Commande> commande = new ArrayList<>();
@@ -17,14 +17,14 @@ import static org.junit.jupiter.api.Assertions.*;
public class CommandeRepositoryTest {
private ComandeRepository repository;
private CommandeRepository repository;
private Commande commandeN1;
private Commande commandeN2;
private Commande commandeN3;
@BeforeEach
void setUp() {
repository = new ComandeRepository();
repository = new CommandeRepository();
UUID clientId = UUID.randomUUID();
List<LigneCommandeInfo> lignesCommande = new ArrayList<>();