diff --git a/src/main/java/com/libraryman_api/book/BookDto.java b/src/main/java/com/libraryman_api/book/BookDto.java new file mode 100644 index 0000000..b6a5d0e --- /dev/null +++ b/src/main/java/com/libraryman_api/book/BookDto.java @@ -0,0 +1,112 @@ +package com.libraryman_api.book; + +public class BookDto { + + + private int bookId; + private String title; + + private String author; + + private String isbn; + + private String publisher; + + + private int publishedYear; + private String genre; + + private int copiesAvailable; + + public BookDto(int bookId, String title, String author, String isbn, String publisher, int publishedYear, String genre, int copiesAvailable) { + this.bookId = bookId; + this.title = title; + this.author = author; + this.isbn = isbn; + this.publisher = publisher; + this.publishedYear = publishedYear; + this.genre = genre; + this.copiesAvailable = copiesAvailable; + } + + public BookDto() { + } + + public int getBookId() { + return bookId; + } + + public void setBookId(int bookId) { + this.bookId = bookId; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getAuthor() { + return author; + } + + public void setAuthor(String author) { + this.author = author; + } + + public String getIsbn() { + return isbn; + } + + public void setIsbn(String isbn) { + this.isbn = isbn; + } + + public String getPublisher() { + return publisher; + } + + public void setPublisher(String publisher) { + this.publisher = publisher; + } + + public int getPublishedYear() { + return publishedYear; + } + + public void setPublishedYear(int publishedYear) { + this.publishedYear = publishedYear; + } + + public String getGenre() { + return genre; + } + + public void setGenre(String genre) { + this.genre = genre; + } + + public int getCopiesAvailable() { + return copiesAvailable; + } + + public void setCopiesAvailable(int copiesAvailable) { + this.copiesAvailable = copiesAvailable; + } + + @Override + public String toString() { + return "BookDto{" + + "bookId=" + bookId + + ", title='" + title + '\'' + + ", author='" + author + '\'' + + ", isbn='" + isbn + '\'' + + ", publisher='" + publisher + '\'' + + ", publishedYear=" + publishedYear + + ", genre='" + genre + '\'' + + ", copiesAvailable=" + copiesAvailable + + '}'; + } +} diff --git a/src/main/java/com/libraryman_api/borrowing/BorrowingsDto.java b/src/main/java/com/libraryman_api/borrowing/BorrowingsDto.java new file mode 100644 index 0000000..9ed52ac --- /dev/null +++ b/src/main/java/com/libraryman_api/borrowing/BorrowingsDto.java @@ -0,0 +1,113 @@ +package com.libraryman_api.borrowing; + +import com.libraryman_api.book.Book; +import com.libraryman_api.book.BookDto; +import com.libraryman_api.fine.Fines; +import com.libraryman_api.member.Members; +import com.libraryman_api.member.MembersDto; + +import java.util.Date; + +public class BorrowingsDto { + + private int borrowingId; + + + private BookDto book; + + + private Fines fine; + + + private MembersDto member; + + private Date borrowDate; + + + private Date dueDate; + + + private Date returnDate; + + public BorrowingsDto(int borrowingId, BookDto book, Fines fine, MembersDto member, Date borrowDate, Date dueDate, Date returnDate) { + this.borrowingId = borrowingId; + this.book = book; + this.fine = fine; + this.member = member; + this.borrowDate = borrowDate; + this.dueDate = dueDate; + this.returnDate = returnDate; + } + + public BorrowingsDto() { + } + + public int getBorrowingId() { + return borrowingId; + } + + public void setBorrowingId(int borrowingId) { + this.borrowingId = borrowingId; + } + + public BookDto getBook() { + return book; + } + + public void setBook(BookDto book) { + this.book = book; + } + + public Fines getFine() { + return fine; + } + + public void setFine(Fines fine) { + this.fine = fine; + } + + public MembersDto getMember() { + return member; + } + + public void setMember(MembersDto member) { + this.member = member; + } + + public Date getBorrowDate() { + return borrowDate; + } + + public void setBorrowDate(Date borrowDate) { + this.borrowDate = borrowDate; + } + + public Date getDueDate() { + return dueDate; + } + + public void setDueDate(Date dueDate) { + this.dueDate = dueDate; + } + + public Date getReturnDate() { + return returnDate; + } + + public void setReturnDate(Date returnDate) { + this.returnDate = returnDate; + } + + @Override + public String toString() { + return "BorrowingsDto{" + + "borrowingId=" + borrowingId + + ", book=" + book + + ", fine=" + fine + + ", member=" + member + + ", borrowDate=" + borrowDate + + ", dueDate=" + dueDate + + ", returnDate=" + returnDate + + '}'; + } +} diff --git a/src/main/java/com/libraryman_api/member/MembersDto.java b/src/main/java/com/libraryman_api/member/MembersDto.java new file mode 100644 index 0000000..d4f67fe --- /dev/null +++ b/src/main/java/com/libraryman_api/member/MembersDto.java @@ -0,0 +1,93 @@ +package com.libraryman_api.member; + +import java.util.Date; + +public class MembersDto { + + + private int memberId; + + private String name; + + private String email; + + private String password; + + + private Role role; + + + private Date membershipDate; + + public MembersDto(int memberId, String name, String email, String password, Role role, Date membershipDate) { + this.memberId = memberId; + this.name = name; + this.email = email; + this.password = password; + this.role = role; + this.membershipDate = membershipDate; + } + + public MembersDto() { + } + + public int getMemberId() { + return memberId; + } + + public void setMemberId(int memberId) { + this.memberId = memberId; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public Role getRole() { + return role; + } + + public void setRole(Role role) { + this.role = role; + } + + public Date getMembershipDate() { + return membershipDate; + } + + public void setMembershipDate(Date membershipDate) { + this.membershipDate = membershipDate; + } + + @Override + public String toString() { + return "MembersDto{" + + "memberId=" + memberId + + ", name='" + name + '\'' + + ", email='" + email + '\'' + + ", password='" + password + '\'' + + ", role=" + role + + ", membershipDate=" + membershipDate + + '}'; + } +}