Class CommissionService


  • @Service
    public class CommissionService
    extends Object
    This class handles all of the business logic for getting, putting, posting, and deleting items from the Commission on behalf of the CommissionService class, using methods from the CommissionRepository interface.
    • Method Detail

      • remove

        public Commission remove​(Commission commission,
                                 Profile profile)
        Method to delete a commission if the user is either the commissioner or the seller.
        Parameters:
        commission - The Commission to be deleted.
        profile - The {@link {Profile} of the user attempting to delete the commission.
        Returns:
        The Commission being deleted.
      • get

        public Optional<Commission> get​(long id)
        Method to return a commission that matches a specific ID.
        Parameters:
        id - The ID of the Commission being requested.
        Returns:
        An Optional containing the matching Commission.
      • getBySeller

        public List<Commission> getBySeller​(Profile seller)
        Method to return a list of (@link Commission} by the commissioned party, ordered by timestamp.
        Parameters:
        seller - An instance of Profile representing the commissioned party.
      • getWaitlist

        public List<Commission> getWaitlist​(Profile seller)
        Method to return a truncated list of Commission representing the user's waitlist.
        Parameters:
        seller - An instance of Profile representing the commissioned party.
      • getByCommissioner

        public List<Commission> getByCommissioner​(Profile commissioner)
        Method to return a list of Commission by the commissioning party, ordered by timestamp.
        Parameters:
        commissioner - An instance of Profile representing the commissioning party.