Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from abc import ABC, abstractmethod
- class Item(ABC):
- def __init__(self):
- pass
- class Book(Item):
- def __init__(self, title, author, genre, publish_date):
- self.title = title
- self.author = author
- self.genre = genre
- self.publish_date = publish_date
- class BookCopy(Book):
- def __init__(self, title, author, genre, publish_date, copy_id):
- super().__init__(title, author, genre, publish_date)
- self.copy_id = copy_id
- self.is_reserved = False
- self.is_rented = False
- class InvertedIndex:
- def __init__(self):
- pass
- def construct_index(self):
- pass
- def add_book_to_index(self):
- pass
- class Rack:
- def __init__(self, capacity, rack_id):
- self.capacity = capacity
- self.rack_id = rack_id
- self.rack_spot_map = {}
- def store_book_copy(self, book_copy):
- available_spot = self.get_available_spot()
- available_spot.store(book_copy)
- self.rack_spot_map[book_copy.copy_id] = available_spot.rack_spot_id
- def get_available_spot(self):
- return
- class Inventory:
- def __init__(self):
- pass
- def add_book_copies(self, copies):
- pass
- def search_book(self, parameters):
- pass
- class RentalHistory:
- def __init__(self):
- # member, copy, checkout, expected return, actual return
- pass
- class Transactions:
- def __init__(self):
- # transactionId, memberid, transaction, amount_change, total_amount
- pass
- class Member:
- def __init__(self, name, member_id):
- self.name = name
- self.member_id = member_id
- self.books_rented = []
- # memberid, name, books rented
- def search_book(self, parameters):
- pass
- def rent_book(self, book):
- pass
- def reserve_book(self, book):
- pass
- class IdGeneratorService:
- def generate(self):
- import time
- return time.time()
- class Library:
- def __init__(self, name):
- self.name = name
- self.inventory = Inventory()
- self.transactions = Transactions()
- self.rentalHistory = RentalHistory()
- print("Hi Welcome to library")
- def search_book(self, parameters):
- return self.inventory.search_book(parameters)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement