package library;

import java.time.LocalDate;
import java.util.List;

// El mismo estado de cuenta con el código de antes (step0) y el de después
// (step5): el refactoring cambió la estructura, no lo que el programa hace.
public class LibraryDemo {

    public static void main(String[] args) {
        LocalDate due = LocalDate.parse("2026-10-01");

        var before = new library.step0.LibraryDesk();
        var alice0 = new library.step0.Member("alice", library.step0.MemberType.STUDENT);
        var loans0 = List.of(
                new library.step0.Loan("Clean Code", library.step0.ItemKind.BOOK, due, due.plusDays(5)),
                new library.step0.Loan("Matrix", library.step0.ItemKind.DVD, due, due.plusDays(30)));
        IO.println("== step0");
        IO.print(before.statement(alice0, loans0));

        var after = new library.step5.LibraryDesk();
        var alice5 = new library.step5.Member("alice", library.step5.MemberType.STUDENT);
        var loans5 = List.of(
                new library.step5.Loan("Clean Code", library.step5.ItemKind.BOOK, due, due.plusDays(5)),
                new library.step5.Loan("Matrix", library.step5.ItemKind.DVD, due, due.plusDays(30)));
        IO.println("== step5");
        IO.print(after.statement(alice5, loans5));
    }
}
