Skip to content

Commit

Permalink
Merge branch 'master' into Update-DG
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrainx authored Oct 27, 2023
2 parents d9bc043 + 9d64da8 commit bb1068e
Show file tree
Hide file tree
Showing 63 changed files with 3,940 additions and 96 deletions.
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ dependencies {
}

shadowJar {
archiveFileName = 'addressbook.jar'
archiveFileName = 'propertymatch.jar'
}

run {
enableAssertions = true
}

defaultTasks 'clean', 'test'
214 changes: 210 additions & 4 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

93 changes: 90 additions & 3 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ When command fails:
* `Missing name parameter for add customers command` for missing name parameter
* `Missing phone parameter for add customers command` for missing phone parameter
* `Missing email parameter for add customers command` for missing email parameter
* `Invalid Command` for mispelling of command

* `Invalid Command` for misspelling of command

### Listing all customers : `listcust`

Expand All @@ -130,7 +129,6 @@ No additional parameters are needed for this command and they will be ignored if

When command succeeds: Customer list will be updated to show all properties in your database.


### Listing all properties : `listprop`

Updates the Property List to show all properties in your database.
Expand Down Expand Up @@ -184,6 +182,95 @@ When command fails:
* `No such property index` for wrong parameter or index beyond list size
* `Invalid command` for misspelling of command

### Finding a customer : `findcust`

Finds and returns a customer or a list of customers whose name contains the substring inputted.

Format: `findcust String`

* Finds and returns the customer(s) whose name contains the `String` substring.
* The String must be in the same language as the name, i.e English.
* The String should only contain the relevant alphabets

Examples:
* `list` followed by `findcust F` finds and returns the customer(s) with names that begin with "F" in the customer list.
* `list` followed by `findcust F J` finds and returns the customer(s) with names that begin with "F" and/or "J" in the customer list.


When command succeeds:
* `1 customer listed`

When command fails:
* `Invalid command format` for missing parameter
* `Unknown command` for misspelling of command

### Finding a property : `findprop`

Finds and returns a property or a list of properties whose name contains the substring inputted.

Format: `findprop String`

* Finds and returns the property or properties whose name contains the `String` substring.
* The String must be in the same language as the name, i.e English.
* The String should only contain the relevant alphabets

Examples:
* `list` followed by `findprop F` finds and returns the property or properties with names that begin with "F" in the property list.
* `list` followed by `findprop F J` finds and returns the property or properties with names that begin with "F" and/or "J" in the property list.


When command succeeds:
* `1 property listed`

When command fails:
* `Invalid command format` for missing parameter
* `Unknown command` for misspelling of command

### Filter customers : `filtercust`

Format: `filtercust [b/BUDGET] [c/CHARACTERISTIC]…​`

Parameter:
* `b/BUDGET` (optional) : The budget of the customer (Integer)
* `c/CHARACTERISTIC` (optional) : The characteristics of the property the customer is looking for (String)

Notes:
* Even though both `BUDGET` and `CHARACTERISTIC` are optional, at least one of them should exist.

Examples:
* `filtercust b/100000`
* `filtercust b/250000 c/white`
* `filtercust c/white`

When command succeeds:
* `4 customers listed!` when there are 4 customers fulfilling the filter.

When command fails:
* `Invalid command format!` for missing both `BUDGET` and `CHARACTERISTIC` parameters.
* `Unknown command` for misspelling of command.

### Filter properties : `filterprop`

Format: `filtercust [pr/PRICE] [c/CHARACTERISTIC]…​`

Parameter:
* `pr/PRICE` (optional) : The price of the property (Integer)
* `c/CHARACTERISTIC` (optional) : The characteristics of the property (String)

Notes:
* Even though both `PROPERTY` and `CHARACTERISTIC` are optional, at least one of them should exist.

Examples:
* `filterprop pr/100000`
* `filterprop pr/250000 c/white`
* `filterprop c/white`

When command succeeds:
* `4 properties listed!` when there are 4 properties fulfilling the filter.

When command fails:
* `Invalid command format!` for missing both `PRICE` and `CHARACTERISTIC` parameters.
* `Unknown command` for misspelling of command.

### Exiting the program : `exit`

Expand Down
72 changes: 72 additions & 0 deletions docs/diagrams/EditCustomerSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":EditCustomerCommandParser" as EditCustomerCommandParser LOGIC_COLOR
participant "command:EditCustomerCommand" as EditCustomerCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

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

[-> LogicManager : execute("editcust 1 n/Janet")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("edistcust 1 n/Janet")
activate AddressBookParser

create EditCustomerCommandParser
AddressBookParser -> EditCustomerCommandParser : new EditCustomerCommandParser("1 n/Janet")
activate EditCustomerCommandParser

EditCustomerCommandParser --> AddressBookParser
deactivate EditCustomerCommandParser

AddressBookParser -> EditCustomerCommandParser : parse("1 n/Janet")
activate EditCustomerCommandParser

create EditCustomerCommand
EditCustomerCommandParser -> EditCustomerCommand : new EditCustomerCommand(1, editCustomerDescriptor)
activate EditCustomerCommand

EditCustomerCommand --> EditCustomerCommandParser : command
deactivate EditCustomerCommand

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

AddressBookParser --> LogicManager : command
deactivate AddressBookParser

LogicManager -> EditCustomerCommand : execute()
activate EditCustomerCommand

EditCustomerCommand -> EditCustomerCommand : createEditedCustomer(customerToEdit, editCustomerDescriptor)
activate EditCustomerCommand
EditCustomerCommand --> EditCustomerCommand : editedCustomer
deactivate EditCustomerCommand

EditCustomerCommand -> Model : setCustomer(CustomerToEdit, editedCustomer)

EditCustomerCommand -> Model : updateFilteredCustomerList(PREDICATE_SHOW_ALL_CUSTOMERS)

create CommandResult
EditCustomerCommand -> CommandResult : new CommandResult("Edited customer: " + editedCustomer)
activate CommandResult

CommandResult --> EditCustomerCommand
deactivate CommandResult

EditCustomerCommand --> LogicManager : commandResult
deactivate EditCustomerCommand

[<--LogicManager : commandResult
deactivate LogicManager
@enduml
89 changes: 89 additions & 0 deletions docs/diagrams/FilterCustomerSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":FilterCustomerCommandParser" as FilterCustomerCommandParser LOGIC_COLOR
participant ":Budget" as Budget LOGIC_COLOR
participant ":Tag" as Tag LOGIC_COLOR
participant ":BudgetAndTagsInRangePredicate" as BudgetAndTagsInRangePredicate LOGIC_COLOR
participant "command:FilterCustomerCommand" as FilterCustomerCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

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

[-> LogicManager : execute("filtercust b/100000 c/pink")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("filtercust b/100000 c/pink")
activate AddressBookParser

create FilterCustomerCommandParser
AddressBookParser -> FilterCustomerCommandParser : new FilterCustomerCommandParser("b/100000 c/pink")
activate FilterCustomerCommandParser

FilterCustomerCommandParser --> AddressBookParser
deactivate FilterCustomerCommandParser

AddressBookParser -> FilterCustomerCommandParser : parse("b/100000 c/pink")
activate FilterCustomerCommandParser

create Budget
FilterCustomerCommandParser -> Budget: new Budget(100000)
activate Budget

Budget --> FilterCustomerCommandParser: budget
deactivate Budget

create Tag
FilterCustomerCommandParser -> Tag: new Tag("pink")
activate Tag

Tag --> FilterCustomerCommandParser: tag
deactivate Tag

create BudgetAndTagsInRangePredicate
FilterCustomerCommandParser -> BudgetAndTagsInRangePredicate: new BudgetAndTagsInRangePredicate(budget, tags)
activate BudgetAndTagsInRangePredicate

BudgetAndTagsInRangePredicate --> FilterCustomerCommandParser: budgetAndTagsInRangePredicate
deactivate BudgetAndTagsInRangePredicate

create FilterCustomerCommand
FilterCustomerCommandParser -> FilterCustomerCommand : new FilterCustomerCommand(budgetAndTagsInRangePredicate)
activate FilterCustomerCommand

FilterCustomerCommand --> FilterCustomerCommandParser : command
deactivate FilterCustomerCommand

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

AddressBookParser --> LogicManager : command
deactivate AddressBookParser

LogicManager -> FilterCustomerCommand : execute()
activate FilterCustomerCommand

FilterCustomerCommand -> Model : updateFilteredCustomerList(budgetAndTagsInRangePredicate)

create CommandResult
FilterCustomerCommand -> CommandResult : new CommandResult(numberOfFilteredCustomer + " customers listed!")
activate CommandResult

CommandResult --> FilterCustomerCommand
deactivate CommandResult

FilterCustomerCommand --> LogicManager : commandResult
deactivate FilterCustomerCommand

[<--LogicManager : commandResult
deactivate LogicManager
@enduml
65 changes: 65 additions & 0 deletions docs/diagrams/FindCustomerSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":FindCustomerCommandParser" as FindCustomerCommandParser LOGIC_COLOR
participant "command:FindCustomerCommand" as FindCustomerCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
end box

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

[-> LogicManager : execute("findcust Jack")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("findcust Jack")
activate AddressBookParser

create FindCustomerCommandParser
AddressBookParser -> FindCustomerCommandParser : new FindCustomerCommandParser()
activate FindCustomerCommandParser

FindCustomerCommandParser --> AddressBookParser
deactivate FindCustomerCommandParser

AddressBookParser -> FindCustomerCommandParser : parse("Jack")
activate FindCustomerCommandParser

create FindCustomerCommand
FindCustomerCommandParser -> FindCustomerCommand : new FindCustomerCommand(predicate)
activate FindCustomerCommand

FindCustomerCommand --> FindCustomerCommandParser : command
deactivate FindCustomerCommand

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

AddressBookParser --> LogicManager : command
deactivate AddressBookParser

LogicManager -> FindCustomerCommand : execute()
activate FindCustomerCommand

FindCustomerCommand -> Model : updateFilteredCustomerList(predicate)

create CommandResult
FindCustomerCommand -> CommandResult : new CommandResult(num + "customers listed!")
activate CommandResult

CommandResult --> FindCustomerCommand
deactivate CommandResult

FindCustomerCommand --> LogicManager
deactivate FindCustomerCommand

[<--LogicManager : commandResult
deactivate LogicManager
@enduml
Binary file added docs/images/EditCustomerSequenceDiagram.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 added docs/images/FilterCustomerSequenceDiagram.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 added docs/images/FindCustomerSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/team/saraozn.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ The user interacts with it using a CLI, and it has a GUI created with JavaFX. It
Given below are my contributions to the project.

* **New Feature**: TO BE ADDED
* What it does:
* Justification:
* Highlights:
* Credits:
* What it does:
* Justification:
* Highlights:
* Credits:

* **Code contributed**: [RepoSense link]()

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/seedu/address/MainApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
public class MainApp extends Application {

public static final Version VERSION = new Version(0, 2, 2, true);
public static final Version VERSION = new Version(1, 2, 1, true);

private static final Logger logger = LogsCenter.getLogger(MainApp.class);

Expand Down Expand Up @@ -87,8 +87,9 @@ private Model initModelManager(Storage storage, ReadOnlyUserPrefs userPrefs) {
try {
addressBookOptional = storage.readAddressBook();
if (!addressBookOptional.isPresent()) {
logger.info("Data file " + storage.getAddressBookFilePath() + " not found.");
logger.info("Creating a new data file " + storage.getAddressBookFilePath()
+ " populated with a sample PropertyMatch.");
+ " populated with a sample AddressBook.");
}
initialData = addressBookOptional.orElseGet(SampleDataUtil::getSampleAddressBook);
} catch (DataLoadingException e) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/address/logic/Messages.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ public class Messages {
public static final String MESSAGE_UNKNOWN_COMMAND = "Unknown command";
public static final String MESSAGE_INVALID_COMMAND_FORMAT = "Invalid command format! \n%1$s";
public static final String MESSAGE_INVALID_CUSTOMER_DISPLAYED_INDEX = "The customer index provided is invalid";

public static final String MESSAGE_INVALID_PROPERTY_DISPLAYED_INDEX = "The property index provided is invalid";
public static final String MESSAGE_CUSTOMERS_LISTED_OVERVIEW = "%1$d customers listed!";
public static final String MESSAGE_DUPLICATE_FIELDS =
"Multiple values specified for the following single-valued field(s): ";
Expand Down
Loading

0 comments on commit bb1068e

Please sign in to comment.