Skip to content

Commit

Permalink
Merge branch 'master' into dg-local-component
Browse files Browse the repository at this point in the history
  • Loading branch information
Jasperabez authored Nov 7, 2024
2 parents 2ae07c9 + 70b79ab commit 4216f2d
Show file tree
Hide file tree
Showing 25 changed files with 910 additions and 244 deletions.
317 changes: 276 additions & 41 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

346 changes: 249 additions & 97 deletions docs/UserGuide.md

Large diffs are not rendered by default.

84 changes: 84 additions & 0 deletions docs/diagrams/AssignSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
@startuml
!include style.puml
skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":EventToryParser" as EventToryParser LOGIC_COLOR
participant ":AssignCommandParser" as AssignCommandParser LOGIC_COLOR
participant "a:AssignCommand" as AssignCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("assign 1")
activate LogicManager

LogicManager -> EventToryParser : parseCommand("assign 1")
activate EventToryParser

create AssignCommandParser
EventToryParser -> AssignCommandParser
activate AssignCommandParser

AssignCommandParser --> EventToryParser
deactivate AssignCommandParser

EventToryParser -> AssignCommandParser : parse("1")
activate AssignCommandParser

create AssignCommand
AssignCommandParser -> AssignCommand
activate AssignCommand

AssignCommand --> AssignCommandParser : a
deactivate AssignCommand

AssignCommandParser --> EventToryParser : a
deactivate AssignCommandParser
destroy AssignCommandParser

EventToryParser --> LogicManager : a
deactivate EventToryParser

LogicManager -> AssignCommand : execute(m)
activate AssignCommand

AssignCommand -> Model : getUiState()

alt viewing Vendor Details
AssignCommand -> Model : getViewedVendor()
AssignCommand -> Model : resolveEvent(selectedIndex)

opt vendor already assigned to event
AssignCommand --> LogicManager : CommandException(MESSAGE_VENDOR_ALREADY_ASSIGNED_TO_EVENT)
end
AssignCommand -> Model : assignVendorToEvent(vendor, event)
else viewing Event Details
AssignCommand -> Model : getViewedEvent()
AssignCommand -> Model : resolveVendor(selectedIndex)

opt event already contains vendor
AssignCommand --> LogicManager : CommandException(MESSAGE_EVENT_ALREADY_ASSIGNED_TO_VENDOR)
end
AssignCommand -> Model : assignVendorToEvent(vendor, event)
else invalid view
AssignCommand -> LogicManager : CommandResult(MESSAGE_ASSIGN_FAILURE_INVALID_VIEW)
end

create CommandResult
AssignCommand -> CommandResult
activate CommandResult

CommandResult --> AssignCommand
deactivate CommandResult

AssignCommand --> LogicManager : r
deactivate AssignCommand

[<--LogicManager
deactivate LogicManager
@enduml
50 changes: 25 additions & 25 deletions docs/diagrams/DeleteSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,66 @@ skinparam ArrowFontStyle plain

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":EventToryParser" as EventToryParser LOGIC_COLOR
participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR
participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR
participant "d:DeleteEventCommand" as DeleteEventCommand LOGIC_COLOR
participant "r:CommandResult" as CommandResult LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant "m:Model" as Model MODEL_COLOR
end box

[-> LogicManager : execute("delete 1")
[-> LogicManager : execute("delete e/1")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("delete 1")
activate AddressBookParser
LogicManager -> EventToryParser : parseCommand("delete e/1")
activate EventToryParser

create DeleteCommandParser
AddressBookParser -> DeleteCommandParser
EventToryParser -> DeleteCommandParser
activate DeleteCommandParser

DeleteCommandParser --> AddressBookParser
DeleteCommandParser --> EventToryParser
deactivate DeleteCommandParser

AddressBookParser -> DeleteCommandParser : parse("1")
EventToryParser -> DeleteCommandParser : parse("e/1")
activate DeleteCommandParser

create DeleteCommand
DeleteCommandParser -> DeleteCommand
activate DeleteCommand
create DeleteEventCommand
DeleteCommandParser -> DeleteEventCommand
activate DeleteEventCommand

DeleteCommand --> DeleteCommandParser :
deactivate DeleteCommand
DeleteEventCommand --> DeleteCommandParser :
deactivate DeleteEventCommand

DeleteCommandParser --> AddressBookParser : d
DeleteCommandParser --> EventToryParser : d
deactivate DeleteCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
DeleteCommandParser -[hidden]-> AddressBookParser
DeleteCommandParser -[hidden]-> EventToryParser
destroy DeleteCommandParser

AddressBookParser --> LogicManager : d
deactivate AddressBookParser
EventToryParser --> LogicManager : d
deactivate EventToryParser

LogicManager -> DeleteCommand : execute(m)
activate DeleteCommand
LogicManager -> DeleteEventCommand : execute(m)
activate DeleteEventCommand

DeleteCommand -> Model : deletePerson(1)
DeleteEventCommand -> Model : deleteEvent(1)
activate Model

Model --> DeleteCommand
Model --> DeleteEventCommand
deactivate Model

create CommandResult
DeleteCommand -> CommandResult
DeleteEventCommand -> CommandResult
activate CommandResult

CommandResult --> DeleteCommand
CommandResult --> DeleteEventCommand
deactivate CommandResult

DeleteCommand --> LogicManager : r
deactivate DeleteCommand
DeleteEventCommand --> LogicManager : r
deactivate DeleteEventCommand

[<--LogicManager
deactivate LogicManager
Expand Down
8 changes: 4 additions & 4 deletions docs/diagrams/ParserClasses.puml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Class XYZCommand

package "Parser classes"{
Class "<<interface>>\nParser" as Parser
Class AddressBookParser
Class EventToryParser
Class XYZCommandParser
Class CliSyntax
Class ParserUtil
Expand All @@ -19,12 +19,12 @@ Class Prefix
}

Class HiddenOutside #FFFFFF
HiddenOutside ..> AddressBookParser
HiddenOutside ..> EventToryParser

AddressBookParser .down.> XYZCommandParser: <<create>>
EventToryParser .down.> XYZCommandParser: <<create>>

XYZCommandParser ..> XYZCommand : <<create>>
AddressBookParser ..> Command : <<use>>
EventToryParser ..> Command : <<use>>
XYZCommandParser .up.|> Parser
XYZCommandParser ..> ArgumentMultimap
XYZCommandParser ..> ArgumentTokenizer
Expand Down
Binary file modified docs/images/Ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/findAlexDavidResult.png
Binary file not shown.
Binary file modified docs/images/helpMessage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 54 additions & 16 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,57 @@
title: ""
---

# AddressBook Level-3

[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions)
[![codecov](https://codecov.io/gh/se-edu/addressbook-level3/branch/master/graph/badge.svg)](https://codecov.io/gh/se-edu/addressbook-level3)

![Ui](images/Ui.png)

**AddressBook is a desktop application for managing your contact details.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).

* If you are interested in using AddressBook, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start).
* If you are interested about developing AddressBook, the [**Developer Guide**](DeveloperGuide.html) is a good place to start.


**Acknowledgements**

* Libraries used: [JavaFX](https://openjfx.io/), [Jackson](https://github.com/FasterXML/jackson), [JUnit5](https://github.com/junit-team/junit5)
<style>
@keyframes gradient {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
</style>

<div style="text-align:center; margin-top: 50px;">
<h1>Welcome to EventTory!</h1>
<p><em>All your vendor and event management tool, all in one place 🎉</em></p>
<img src="images/Ui.png" alt="Ui" style="width: 80%; margin-top: 20px;">
</div>

<div style="text-align:center; margin-top: 30px;">
<a href="https://github.com/AY2425S1-CS2103-F13-2/tp/actions">
<img src="https://github.com/AY2425S1-CS2103-F13-2/tp/workflows/Java%20CI/badge.svg" alt="CI Status">
</a>
<a href="https://app.codecov.io/gh/AY2425S1-CS2103-F13-2/tp">
<img src="https://codecov.io/gh/AY2425S1-CS2103-F13-2/tp/branch/master/graph/badge.svg" alt="codecov">
</a>
</div>

<div style="margin-top: 50px;">
<h2>About EventTory 📋</h2>
<p><strong>EventTory is a desktop application for managing your vendors and events!</strong> While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface).</p>
</div>

<div style="text-align:center; margin-top: 30px; padding: 20px; background: linear-gradient(270deg, #1F398A, #14532D); background-size: 400% 400%; color: white; font-size: 1.5em; animation: gradient 5s ease infinite; border-radius: 16px; font-family: verdana">
From CLI users for CLI users 😎
</div>

<div style="margin-top: 30px;">
<h2>Features ✨</h2>
<ul>
<li>Manage vendors and events efficiently</li>
<li>Intuitive CLI for quick operations</li>
</ul>
</div>

<div style="margin-top: 30px;">
<h2>Get Started 🚀</h2>
<ul>
<li>If you are interested in using EventTory, head over to the <a href="UserGuide.html#quick-start"><strong>Quick Start</strong> section of the <em>User Guide</em></a>.</li>
<li>If you are interested about developing EventTory, the <a href="DeveloperGuide.html"><strong>Developer Guide</strong></a> is a good place to start.</li>
</ul>
</div>

<div style="margin-top: 50px;">
<h2>Acknowledgements 🙏</h2>
<ul>
<li>Libraries used: <a href="https://openjfx.io/">JavaFX</a>, <a href="https://github.com/FasterXML/jackson">Jackson</a>, <a href="https://github.com/junit-team/junit5">JUnit5</a></li>
</ul>
</div>
9 changes: 5 additions & 4 deletions src/main/java/seedu/eventtory/logic/Logic.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import javafx.beans.value.ObservableObjectValue;
import javafx.collections.ObservableList;
import seedu.eventtory.commons.core.GuiSettings;
import seedu.eventtory.commons.core.index.Index;
import seedu.eventtory.logic.commands.CommandResult;
import seedu.eventtory.logic.commands.exceptions.CommandException;
import seedu.eventtory.logic.parser.exceptions.ParseException;
Expand All @@ -31,7 +30,6 @@ public interface Logic {

/**
* Returns the EventTory.
*
* @see seedu.eventtory.model.Model#getEventTory()
*/
ReadOnlyEventTory getEventTory();
Expand Down Expand Up @@ -67,10 +65,13 @@ public interface Logic {
ObservableIntegerValue getStartingIndexOfAssignedEvents();

/** Return the display index of the given vendor in the filtered list */
Index getRelativeIndexOfVendor(Vendor vendor);
int getRelativeIndexOfVendor(Vendor vendor);

/** Return the display index of the given event in the filtered list */
Index getRelativeIndexOfEvent(Event event);
int getRelativeIndexOfEvent(Event event);

/** Return the display index of the selected object */
ObservableIntegerValue getIndexOfSelectedObject();

/**
* Returns the user prefs' EventTory file path.
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/seedu/eventtory/logic/LogicManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import javafx.collections.ObservableList;
import seedu.eventtory.commons.core.GuiSettings;
import seedu.eventtory.commons.core.LogsCenter;
import seedu.eventtory.commons.core.index.Index;
import seedu.eventtory.logic.commands.Command;
import seedu.eventtory.logic.commands.CommandResult;
import seedu.eventtory.logic.commands.exceptions.CommandException;
Expand Down Expand Up @@ -123,15 +122,20 @@ public ObservableList<Association> getAssociationList() {
}

@Override
public Index getRelativeIndexOfVendor(Vendor vendor) {
public int getRelativeIndexOfVendor(Vendor vendor) {
return model.getRelativeIndexOfVendor(vendor);
}

@Override
public Index getRelativeIndexOfEvent(Event event) {
public int getRelativeIndexOfEvent(Event event) {
return model.getRelativeIndexOfEvent(event);
}

@Override
public ObservableIntegerValue getIndexOfSelectedObject() {
return model.getIndexOfSelectedObject();
}

@Override
public Path getEventToryFilePath() {
return model.getEventToryFilePath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public CommandResult execute(Model model) throws CommandException {
Event eventToView = IndexResolverUtil.resolveEvent(model, targetIndex);

model.viewEvent(eventToView);
model.updateFilteredVendorList(Model.PREDICATE_SHOW_ALL_VENDORS);

return new CommandResult(String.format(MESSAGE_SUCCESS, Messages.format(eventToView)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static java.util.Objects.requireNonNull;
import static seedu.eventtory.logic.parser.CliSyntax.PREFIX_VENDOR;
import static seedu.eventtory.model.Model.PREDICATE_SHOW_ALL_EVENTS;

import seedu.eventtory.commons.core.index.Index;
import seedu.eventtory.logic.Messages;
Expand Down Expand Up @@ -33,7 +32,6 @@ public CommandResult execute(Model model) throws CommandException {
Vendor vendorToView = IndexResolverUtil.resolveVendor(model, targetIndex);

model.viewVendor(vendorToView);
model.updateFilteredEventList(PREDICATE_SHOW_ALL_EVENTS);

return new CommandResult(String.format(MESSAGE_SUCCESS, Messages.format(vendorToView)));
}
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/seedu/eventtory/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import javafx.beans.value.ObservableObjectValue;
import javafx.collections.ObservableList;
import seedu.eventtory.commons.core.GuiSettings;
import seedu.eventtory.commons.core.index.Index;
import seedu.eventtory.model.association.Association;
import seedu.eventtory.model.commons.exceptions.AssociationDeleteException;
import seedu.eventtory.model.event.Event;
Expand Down Expand Up @@ -136,12 +135,17 @@ public interface Model {
/**
* Returns the relative index of the vendor in the filtered list.
*/
Index getRelativeIndexOfVendor(Vendor vendor);
int getRelativeIndexOfVendor(Vendor vendor);

/**
* Returns the relative index of the event in the filtered list.
*/
Index getRelativeIndexOfEvent(Event event);
int getRelativeIndexOfEvent(Event event);

/**
* Returns the relative index of the selected object in the filtered list.
*/
ObservableIntegerValue getIndexOfSelectedObject();

/**
* Sets the selected vendor.
Expand Down
Loading

0 comments on commit 4216f2d

Please sign in to comment.