package com.twu.biblioteca;

import com.twu.biblioteca.auth.Auth;
import com.twu.biblioteca.auth.Librarian;

public class BibliotecaApp {
    private Store store;
    private void initialize(){
        store=Store.getNewInstance();
        store.addBook("xxxn","Crack","1990");
        store.addBook("poo boo","moel","1887");
        store.addBook("tau ao","moel","1887");
        store.addBook("kazuya","moel","1887");
        store.addBook("WDFD","moel","1887");
        store.addBook("lastOfus","moel","1887");
        store.addMovie("Dragon Lore","2014","Gabe Newell","7");
        store.addMovie("Friend Request","2001","Simon Verhoeven","5");
        store.addMovie("Milo Francisco","2002","Vello Maxson","6");
        /**
         * 2 costumers and 1 librarian
         */
        Auth.userSignUp("poo","000000", "000-1130", "Z@bil.com", "112112212");
        Auth.userSignUp("woo","000000", "000-1131", "Ssseev2@bil.com", "112112213");
        store.users.add(new Librarian("Carl","112233","100-1000"));
    }

    public void start(){
        Core.run();
    }
    public static void main(String[] args) {
        BibliotecaApp app=new BibliotecaApp();
        app.initialize();
        app.start();
    }
}

@@ -100,16 +100,53 @@
 brarian;
+%0Aimport com.twu.biblioteca.auth.User;
 %0A%0Apublic
@@ -751,19 +751,8 @@
 %22);%0A
-        /**
 %0A   
@@ -760,11 +760,10 @@
     
- * 
+//
 2 co
@@ -790,20 +790,8 @@
 ian%0A
-         */%0A
     
@@ -1022,25 +1022,433 @@
 ));%0A
+%0A
     
-%7D%0A%0A    public
+    //construct loan context for librarian use case%0A        User test_user = new User(%22wang%22,%22123456%22, %22000-1110%22, %22Z@bil.com%22, %22112112212%22);%0A        store.users.add(test_user);%0A        BookInfo test_book=new BookInfo(%22lastOfus%22,%22moel%22,%221887%22);%0A        store.loans.add (new Loan(test_user, test_book));%0A        store.books.stream().filter(x-%3Ex.equals(test_book)).findFirst().ifPresent(BookInfo::rent);%0A    %7D%0A%0A    private
  voi

construct loan context for librarian case