Repository: AY2425S2-CS2103-F10-2/tp
Pull request #111: Create command for delete policy
Author: login: leedeen01
Created: 2025-03-27T14:46:43Z | Merged: 2025-03-28T06:56:48Z

Closes #102 

Linked issue #102: Delete policy

Diff:
diff --git a/src/main/java/seedu/address/logic/LogicManager.java b/src/main/java/seedu/address/logic/LogicManager.java
index 0b2e87907fb..c8217c06c46 100644
--- a/src/main/java/seedu/address/logic/LogicManager.java
+++ b/src/main/java/seedu/address/logic/LogicManager.java
@@ -56,7 +56,6 @@ public CommandResult execute(String commandText) throws CommandException, ParseE
         try {
             storage.saveAddressBook(model.getAddressBook());
             storage.savePolicyBook(model.getPolicyBook());
-
         } catch (AccessDeniedException e) {
             throw new CommandException(String.format(FILE_OPS_PERMISSION_ERROR_FORMAT, e.getMessage()), e);
         } catch (IOException ioe) {
diff --git a/src/main/java/seedu/address/logic/commands/DeletePolicyCommand.java b/src/main/java/seedu/address/logic/commands/DeletePolicyCommand.java
new file mode 100644
index 00000000000..b0d5d9f71a0
--- /dev/null
+++ b/src/main/java/seedu/address/logic/commands/DeletePolicyCommand.java
@@ -0,0 +1,69 @@
+package seedu.address.logic.commands;
+
+import static java.util.Objects.requireNonNull;
+
+import java.util.List;
+
+import seedu.address.commons.core.index.Index;
+import seedu.address.commons.util.ToStringBuilder;
+import seedu.address.logic.Messages;
+import seedu.address.logic.commands.exceptions.CommandException;
+import seedu.address.model.Model;
+import seedu.address.model.policy.Policy;
+
+/**
+ * Deletes a policy identified using it's displayed index from the policy book.
+ */
+public class DeletePolicyCommand extends Command {
+
+    public static final String COMMAND_WORD = "deletepolicy";
+
+    public static final String MESSAGE_USAGE = COMMAND_WORD
+            + ": Deletes the policy identified by the index number used in the displayed policy list.\n"
+            + "Parameters: INDEX (must be a positive integer)\n"
+            + "Example: " + COMMAND_WORD + " 1";
+
+    public static final String MESSAGE_DELETE_POLICY_SUCCESS = "Deleted Policy: %1$s";
+
+    private final Index targetIndex;
+
+    public DeletePolicyCommand(Index targetIndex) {
+        this.targetIndex = targetIndex;
+    }
+
+    @Override
+    public CommandResult execute(Model model) throws CommandException {
+        requireNonNull(model);
+        List<Policy> lastShownList = model.getFilteredPolicyList();
+
+        if (targetIndex.getZeroBased() >= lastShownList.size()) {
+            throw new CommandException(Messages.MESSAGE_INVALID_POLICY_DISPLAYED_INDEX);
+        }
+
+        Policy policyToDelete = lastShownList.get(targetIndex.getZeroBased());
+        model.deletePolicy(policyToDelete);
+        return new CommandResult(String.format(MESSAGE_DELETE_POLICY_SUCCESS, Messages.formatPolicy(policyToDelete)));
+    }
+
+    @Override
+    public boolean equals(Object other) {
+        if (other == this) {
+            return true;
+        }
+
+        // instanceof handles nulls
+        if (!(other instanceof DeletePolicyCommand)) {
+            return false;
+        }
+
+        DeletePolicyCommand otherDeletePolicyCommand = (DeletePolicyCommand) other;
+        return targetIndex.equals(otherDeletePolicyCommand.targetIndex);
+    }
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this)
+                .add("targetIndex", targetIndex)
+                .toString();
+    }
+}
diff --git a/src/main/java/seedu/address/logic/parser/ClientNestParser.java b/src/main/java/seedu/address/logic/parser/ClientNestParser.java
index 2ab663d60b4..95cd014c741 100644
--- a/src/main/java/seedu/address/logic/parser/ClientNestParser.java
+++ b/src/main/java/seedu/address/logic/parser/ClientNestParser.java
@@ -13,6 +13,7 @@
 import seedu.address.logic.commands.ClearCommand;
 import seedu.address.logic.commands.Command;
 import seedu.address.logic.commands.DeleteCommand;
+import seedu.address.logic.commands.DeletePolicyCommand;
 import seedu.address.logic.commands.EditCommand;
 import seedu.address.logic.commands.EditPolicyCommand;
 import seedu.address.logic.commands.ExitCommand;
@@ -105,6 +106,9 @@ public Command parseCommand(String userInput) throws ParseException {
         case EditPolicyCommand.COMMAND_WORD:
             return new EditPolicyCommandParser().parse(arguments);
 
+        case DeletePolicyCommand.COMMAND_WORD:
+            return new DeletePolicyCommandParser().parse(arguments);
+
         default:
             logger.finer("This user input caused a ParseException: " + userInput);
             throw new ParseException(MESSAGE_UNKNOWN_COMMAND);
diff --git a/src/main/java/seedu/address/logic/parser/DeletePolicyCommandParser.java b/src/main/java/seedu/address/logic/parser/DeletePolicyCommandParser.java
new file mode 100644
index 00000000000..69ffd267bb2
--- /dev/null
+++ b/src/main/java/seedu/address/logic/parser/DeletePolicyCommandParser.java
@@ -0,0 +1,28 @@
+package seedu.address.logic.parser;
+
+import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
+
+import seedu.address.commons.core.index.Index;
+import seedu.address.logic.commands.DeletePolicyCommand;
+import seedu.address.logic.parser.exceptions.ParseException;
+
+/**
+ * Parses input arguments and creates a new DeletePolicyCommand object
+ */
+public class DeletePolicyCommandParser implements Parser<DeletePolicyCommand> {
+
+    /**
+     * Parses the given {@code String} of arguments in the context of the DeletePolicyCommand
+     * and returns a DeletePolicyCommand object for execution.
+     * @throws ParseException if the user input does not conform the expected format
+     */
+    public DeletePolicyCommand parse(String args) throws ParseException {
+        try {
+            Index index = ParserUtil.parseIndex(args);
+            return new DeletePolicyCommand(index);
+        } catch (ParseException pe) {
+            throw new ParseException(
+                    String.format(MESSAGE_INVALID_COMMAND_FORMAT, DeletePolicyCommand.MESSAGE_USAGE), pe);
+        }
+    }
+}
diff --git a/src/main/resources/view/HelpWindow.fxml b/src/main/resources/view/HelpWindow.fxml
index 84734c92c2d..2b60ccc887d 100644
--- a/src/main/resources/view/HelpWindow.fxml
+++ b/src/main/resources/view/HelpWindow.fxml
@@ -15,7 +15,7 @@
 <?import javafx.scene.layout.AnchorPane?>
 <fx:root resizable="true" title="Help" type="javafx.stage.Stage" xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1" maxWidth="1100.0" maxHeight="500.0">
   <icons>
-    <Image url="@/images/help_icon.png" />
+    <Image url="@/images/ClientNest_32.png" />
   </icons>
   <scene>
     <Scene>
diff --git a/src/main/resources/view/MainWindow.fxml b/src/main/resources/view/MainWindow.fxml
index 91e1185c1f1..7f21e9aa2f2 100644
--- a/src/main/resources/view/MainWindow.fxml
+++ b/src/main/resources/view/MainWindow.fxml
@@ -54,7 +54,7 @@
 
           <SplitPane fx:id="splitPane" orientation="HORIZONTAL" VBox.vgrow="ALWAYS">
               <!-- Person List Pane -->
-              <VBox fx:id="personList" styleClass="pane-with-border" minWidth="170" prefWidth="170">
+              <VBox fx:id="personList" styleClass="pane-with-border" minWidth="200" prefWidth="200">
                   <padding>
                       <Insets top="10" right="5" bottom="10" left="10" />
                   </padding>
@@ -62,7 +62,7 @@
               </VBox>
 
               <!-- Policy List Pane -->
-              <VBox fx:id="policyList" styleClass="pane-with-border" minWidth="170" prefWidth="170">
+              <VBox fx:id="policyList" styleClass="pane-with-border" minWidth="150" prefWidth="150">
                   <padding>
                       <Insets top="10" right="5" bottom="10" left="5" />
                   </padding>
@@ -70,7 +70,7 @@
               </VBox>
 
               <!-- Birthday Panel -->
-              <StackPane fx:id="birthdayPanelPlaceholder" minWidth="180" prefWidth="200" maxWidth="300" styleClass="pane-with-border"/>
+              <StackPane fx:id="birthdayPanelPlaceholder" minWidth="250" prefWidth="200" maxWidth="300" styleClass="pane-with-border"/>
           </SplitPane>
 
         <StackPane fx:id="statusbarPlaceholder" VBox.vgrow="NEVER" />
diff --git a/src/main/resources/view/PersonListPanel.fxml b/src/main/resources/view/PersonListPanel.fxml
index a1bb6bbace8..665a76f687b 100644
--- a/src/main/resources/view/PersonListPanel.fxml
+++ b/src/main/resources/view/PersonListPanel.fxml
@@ -2,7 +2,12 @@
 
 <?import javafx.scene.control.ListView?>
 <?import javafx.scene.layout.VBox?>
+<?import javafx.scene.control.Label?>
 
 <VBox xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
+    <Label text="Clients"
+           style="-fx-font-weight: bold; -fx-text-fill: white; -fx-padding: 10;"
+           maxWidth="1.7976931348623157E308"
+           alignment="CENTER" />
   <ListView fx:id="personListView" VBox.vgrow="ALWAYS" />
 </VBox>
diff --git a/src/main/resources/view/PolicyListPanel.fxml b/src/main/resources/view/PolicyListPanel.fxml
index d011d967f5e..f8415fdbf00 100644
--- a/src/main/resources/view/PolicyListPanel.fxml
+++ b/src/main/resources/view/PolicyListPanel.fxml
@@ -2,7 +2,12 @@
 
 <?import javafx.scene.control.ListView?>
 <?import javafx.scene.layout.VBox?>
+<?import javafx.scene.control.Label?>
 
 <VBox xmlns="http://javafx.com/javafx/17" xmlns:fx="http://javafx.com/fxml/1">
+        <Label text="Policies"
+           style="-fx-font-weight: bold; -fx-text-fill: white; -fx-padding: 10;"
+           maxWidth="1.7976931348623157E308"
+           alignment="CENTER" />
     <ListView fx:id="policyListView" VBox.vgrow="ALWAYS" />
 </VBox>
diff --git a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java
index 391b4a445be..a6c9dc8c572 100644
--- a/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java
+++ b/src/test/java/seedu/address/logic/commands/DeleteCommandTest.java
@@ -78,7 +78,7 @@ public void execute_invalidIndexFilteredList_throwsCommandException() {
         showPersonAtIndex(model, INDEX_FIRST_PERSON);
 
         Index outOfBoundIndex = INDEX_SECOND_PERSON;
-        // ensures that outOfBoundIndex is still in bounds of address book list
+
         assertTrue(outOfBoundIndex.getZeroBased() < model.getAddressBook().getPersonList().size());
 
         DeleteCommand deleteCommand = new DeleteCommand(outOfBoundIndex);
diff --git a/src/test/java/seedu/address/logic/commands/DeletePolicyCommandTest.java b/src/test/java/seedu/address/logic/commands/DeletePolicyCommandTest.java
new file mode 100644
index 00000000000..784579182aa
--- /dev/null
+++ b/src/test/java/seedu/address/logic/commands/DeletePolicyCommandTest.java
@@ -0,0 +1,86 @@
+package seedu.address.logic.commands;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
+import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
+import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_POLICY;
+import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND_POLICY;
+import static seedu.address.testutil.TypicalPersons.getTypicalAddressBook;
+import static seedu.address.testutil.TypicalPolicy.getTypicalPolicyBook;
+
+import org.junit.jupiter.api.Test;
+
+import seedu.address.commons.core.index.Index;
+import seedu.address.commons.core.user.UserProfile;
+import seedu.address.logic.Messages;
+import seedu.address.model.Model;
+import seedu.address.model.ModelManager;
+import seedu.address.model.UserPrefs;
+import seedu.address.model.policy.Policy;
+import seedu.address.storage.Storage;
+
+/**
+ * Contains integration tests (interaction with the Model) and unit tests for
+ * {@code DeletePolicyCommand}.
+ */
+public class DeletePolicyCommandTest {
+
+    private Storage storage;
+    private Model model = new ModelManager(getTypicalAddressBook(), getTypicalPolicyBook(),
+                                             new UserPrefs(), new UserProfile(), storage);
+
+    @Test
+    public void execute_validIndexUnfilteredList_success() {
+        Policy policyToDelete = model.getFilteredPolicyList().get(INDEX_FIRST_POLICY.getZeroBased());
+        DeletePolicyCommand deletePolicyCommand = new DeletePolicyCommand(INDEX_FIRST_POLICY);
+
+        String expectedMessage = String.format(DeletePolicyCommand.MESSAGE_DELETE_POLICY_SUCCESS,
+                Messages.formatPolicy(policyToDelete));
+
+        Model expectedModel = new ModelManager(getTypicalAddressBook(), model.getPolicyBook(),
+                                                new UserPrefs(), model.getUserProfile(), storage);
+        expectedModel.deletePolicy(policyToDelete);
+
+        assertCommandSuccess(deletePolicyCommand, model, expectedMessage, expectedModel);
+    }
+
+    @Test
+    public void execute_invalidIndexUnfilteredList_throwsCommandException() {
+        Index outOfBoundIndex = Index.fromOneBased(model.getFilteredPolicyList().size() + 1);
+        DeletePolicyCommand deletePolicyCommand = new DeletePolicyCommand(outOfBoundIndex);
+
+        assertCommandFailure(deletePolicyCommand, model, Messages.MESSAGE_INVALID_POLICY_DISPLAYED_INDEX);
+    }
+
+    @Test
+    public void equals() {
+        DeletePolicyCommand deleteFirstCommand = new DeletePolicyCommand(INDEX_FIRST_POLICY);
+        DeletePolicyCommand deleteSecondCommand = new DeletePolicyCommand(INDEX_SECOND_POLICY);
+
+        // same object -> returns true
+        assertTrue(deleteFirstCommand.equals(deleteFirstCommand));
+
+        // same values -> returns true
+        DeletePolicyCommand deleteFirstCommandCopy = new DeletePolicyCommand(INDEX_FIRST_POLICY);
+        assertTrue(deleteFirstCommand.equals(deleteFirstCommandCopy));
+
+        // different types -> returns false
+        assertFalse(deleteFirstCommand.equals(1));
+
+        // null -> returns false
+        assertFalse(deleteFirstCommand.equals(null));
+
+        // different policy -> returns false
+        assertFalse(deleteFirstCommand.equals(deleteSecondCommand));
+    }
+
+    @Test
+    public void toStringMethod() {
+        Index targetIndex = Index.fromOneBased(1);
+        DeletePolicyCommand deletePolicyCommand = new DeletePolicyCommand(targetIndex);
+        String expected = DeletePolicyCommand.class.getCanonicalName() + "{targetIndex=" + targetIndex + "}";
+        assertEquals(expected, deletePolicyCommand.toString());
+    }
+}
diff --git a/src/test/java/seedu/address/logic/parser/DeletePolicyCommandParserTest.java b/src/test/java/seedu/address/logic/parser/DeletePolicyCommandParserTest.java
new file mode 100644
index 00000000000..b2d9d519f14
--- /dev/null
+++ b/src/test/java/seedu/address/logic/parser/DeletePolicyCommandParserTest.java
@@ -0,0 +1,34 @@
+package seedu.address.logic.parser;
+
+import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
+import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure;
+import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess;
+import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_POLICY;
+
+import org.junit.jupiter.api.Test;
+
+import seedu.address.logic.commands.DeletePolicyCommand;
+
+public class DeletePolicyCommandParserTest {
+
+    private DeletePolicyCommandParser parser = new DeletePolicyCommandParser();
+
+    @Test
+    public void parse_validArgs_returnsDeleteCommand() {
+        assertParseSuccess(parser, "1", new DeletePolicyCommand(INDEX_FIRST_POLICY));
+    }
+
+    @Test
+    public void parse_invalidArgs_throwsParseException() {
+        assertParseFailure(parser, "a", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
+                DeletePolicyCommand.MESSAGE_USAGE));
+        assertParseFailure(parser, "0", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
+                DeletePolicyCommand.MESSAGE_USAGE));
+        assertParseFailure(parser, "-1", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
+                DeletePolicyCommand.MESSAGE_USAGE));
+        assertParseFailure(parser, "", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
+                DeletePolicyCommand.MESSAGE_USAGE));
+        assertParseFailure(parser, " ", String.format(MESSAGE_INVALID_COMMAND_FORMAT,
+                DeletePolicyCommand.MESSAGE_USAGE));
+    }
+}


Reviews:
user: login: FabianHeng
state: APPROVED
author_association: NONE
submitted_at: 2025-03-28T06:56:31Z

Review comments:
diff_hunk: @@ -0,0 +1,69 @@
+package seedu.address.logic.commands;
+
+import static java.util.Objects.requireNonNull;
+
+import java.util.List;
+
+import seedu.address.commons.core.index.Index;
+import seedu.address.commons.util.ToStringBuilder;
+import seedu.address.logic.Messages;
+import seedu.address.logic.commands.exceptions.CommandException;
+import seedu.address.model.Model;
+import seedu.address.model.policy.Policy;
+
+/**
+ * Deletes a policy identified using it's displayed index from the policy book.
+ */
+public class DeletePolicyCommand extends Command {
+
+    public static final String COMMAND_WORD = "deletepolicy";
+
+    public static final String MESSAGE_USAGE = COMMAND_WORD
+            + ": Deletes the policy identified by the index number used in the displayed policy list.\n"
+            + "Parameters: INDEX (must be a positive integer)\n"
+            + "Example: " + COMMAND_WORD + " 1";
+
+    public static final String MESSAGE_DELETE_POLICY_SUCCESS = "Deleted Policy: %1$s";
path: src/main/java/seedu/address/logic/commands/DeletePolicyCommand.java
user: login: FabianHeng
body: Good use of static variables.
created_at: 2025-03-28T06:55:25Z
author_association: NONE
diff_hunk: @@ -105,6 +106,9 @@ public Command parseCommand(String userInput) throws ParseException {
         case EditPolicyCommand.COMMAND_WORD:
             return new EditPolicyCommandParser().parse(arguments);
 
+        case DeletePolicyCommand.COMMAND_WORD:
+            return new DeletePolicyCommandParser().parse(arguments);
path: src/main/java/seedu/address/logic/parser/ClientNestParser.java
user: login: FabianHeng
body: Perhaps you can add some test cases here?
created_at: 2025-03-28T06:55:42Z
author_association: NONE
diff_hunk: @@ -0,0 +1,86 @@
+package seedu.address.logic.commands;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure;
+import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess;
+import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_POLICY;
+import static seedu.address.testutil.TypicalIndexes.INDEX_SECOND_POLICY;
+import static seedu.address.testutil.TypicalPersons.getTypicalAddressBook;
+import static seedu.address.testutil.TypicalPolicy.getTypicalPolicyBook;
+
+import org.junit.jupiter.api.Test;
+
+import seedu.address.commons.core.index.Index;
+import seedu.address.commons.core.user.UserProfile;
+import seedu.address.logic.Messages;
+import seedu.address.model.Model;
+import seedu.address.model.ModelManager;
+import seedu.address.model.UserPrefs;
+import seedu.address.model.policy.Policy;
+import seedu.address.storage.Storage;
+
+/**
+ * Contains integration tests (interaction with the Model) and unit tests for
+ * {@code DeletePolicyCommand}.
+ */
+public class DeletePolicyCommandTest {
+
+    private Storage storage;
+    private Model model = new ModelManager(getTypicalAddressBook(), getTypicalPolicyBook(),
+                                             new UserPrefs(), new UserProfile(), storage);
+
+    @Test
+    public void execute_validIndexUnfilteredList_success() {
+        Policy policyToDelete = model.getFilteredPolicyList().get(INDEX_FIRST_POLICY.getZeroBased());
+        DeletePolicyCommand deletePolicyCommand = new DeletePolicyCommand(INDEX_FIRST_POLICY);
+
+        String expectedMessage = String.format(DeletePolicyCommand.MESSAGE_DELETE_POLICY_SUCCESS,
+                Messages.formatPolicy(policyToDelete));
+
+        Model expectedModel = new ModelManager(getTypicalAddressBook(), model.getPolicyBook(),
+                                                new UserPrefs(), model.getUserProfile(), storage);
+        expectedModel.deletePolicy(policyToDelete);
+
+        assertCommandSuccess(deletePolicyCommand, model, expectedMessage, expectedModel);
+    }
+
+    @Test
+    public void execute_invalidIndexUnfilteredList_throwsCommandException() {
+        Index outOfBoundIndex = Index.fromOneBased(model.getFilteredPolicyList().size() + 1);
+        DeletePolicyCommand deletePolicyCommand = new DeletePolicyCommand(outOfBoundIndex);
+
+        assertCommandFailure(deletePolicyCommand, model, Messages.MESSAGE_INVALID_POLICY_DISPLAYED_INDEX);
+    }
+
+    @Test
+    public void equals() {
+        DeletePolicyCommand deleteFirstCommand = new DeletePolicyCommand(INDEX_FIRST_POLICY);
+        DeletePolicyCommand deleteSecondCommand = new DeletePolicyCommand(INDEX_SECOND_POLICY);
+
+        // same object -> returns true
+        assertTrue(deleteFirstCommand.equals(deleteFirstCommand));
+
+        // same values -> returns true
+        DeletePolicyCommand deleteFirstCommandCopy = new DeletePolicyCommand(INDEX_FIRST_POLICY);
+        assertTrue(deleteFirstCommand.equals(deleteFirstCommandCopy));
+
+        // different types -> returns false
+        assertFalse(deleteFirstCommand.equals(1));
+
+        // null -> returns false
+        assertFalse(deleteFirstCommand.equals(null));
+
+        // different policy -> returns false
+        assertFalse(deleteFirstCommand.equals(deleteSecondCommand));
+    }
+
+    @Test
path: src/test/java/seedu/address/logic/commands/DeletePolicyCommandTest.java
user: login: FabianHeng
body: Good and meaningful test cases.
created_at: 2025-03-28T06:56:15Z
author_association: NONE
diff_hunk: @@ -0,0 +1,34 @@
+package seedu.address.logic.parser;
+
+import static seedu.address.logic.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
+import static seedu.address.logic.parser.CommandParserTestUtil.assertParseFailure;
+import static seedu.address.logic.parser.CommandParserTestUtil.assertParseSuccess;
+import static seedu.address.testutil.TypicalIndexes.INDEX_FIRST_POLICY;
+
+import org.junit.jupiter.api.Test;
+
+import seedu.address.logic.commands.DeletePolicyCommand;
+
+public class DeletePolicyCommandParserTest {
+
+    private DeletePolicyCommandParser parser = new DeletePolicyCommandParser();
+
+    @Test
+    public void parse_validArgs_returnsDeleteCommand() {
+        assertParseSuccess(parser, "1", new DeletePolicyCommand(INDEX_FIRST_POLICY));
+    }
+
+    @Test
path: src/test/java/seedu/address/logic/parser/DeletePolicyCommandParserTest.java
user: login: FabianHeng
body: LGTM
created_at: 2025-03-28T06:56:22Z
author_association: NONE

PR comments:
user: login: codecov[bot]
created_at: 2025-03-27T15:02:14Z
body: ## [Codecov](https://app.codecov.io/gh/AY2425S2-CS2103-F10-2/tp/pull/111?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103-F10-2) Report
Attention: Patch coverage is `96.15385%` with `1 line` in your changes missing coverage. Please review.

| [Files with missing lines](https://app.codecov.io/gh/AY2425S2-CS2103-F10-2/tp/pull/111?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103-F10-2) | Patch % | Lines |
|---|---|---|
| [...a/seedu/address/logic/parser/ClientNestParser.java](https://app.codecov.io/gh/AY2425S2-CS2103-F10-2/tp/pull/111?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fseedu%2Faddress%2Flogic%2Fparser%2FClientNestParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103-F10-2#diff-c3JjL21haW4vamF2YS9zZWVkdS9hZGRyZXNzL2xvZ2ljL3BhcnNlci9DbGllbnROZXN0UGFyc2VyLmphdmE=) | 0.00% | [1 Missing :warning: ](https://app.codecov.io/gh/AY2425S2-CS2103-F10-2/tp/pull/111?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103-F10-2) |

| [Files with missing lines](https://app.codecov.io/gh/AY2425S2-CS2103-F10-2/tp/pull/111?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103-F10-2) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...rc/main/java/seedu/address/logic/LogicManager.java](https://app.codecov.io/gh/AY2425S2-CS2103-F10-2/tp/pull/111?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fseedu%2Faddress%2Flogic%2FLogicManager.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103-F10-2#diff-c3JjL21haW4vamF2YS9zZWVkdS9hZGRyZXNzL2xvZ2ljL0xvZ2ljTWFuYWdlci5qYXZh) | `86.20% <ø> (ø)` | `9.00 <0.00> (ø)` | |
| [...du/address/logic/commands/DeletePolicyCommand.java](https://app.codecov.io/gh/AY2425S2-CS2103-F10-2/tp/pull/111?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fseedu%2Faddress%2Flogic%2Fcommands%2FDeletePolicyCommand.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103-F10-2#diff-c3JjL21haW4vamF2YS9zZWVkdS9hZGRyZXNzL2xvZ2ljL2NvbW1hbmRzL0RlbGV0ZVBvbGljeUNvbW1hbmQuamF2YQ==) | `100.00% <100.00%> (ø)` | `7.00 <7.00> (?)` | |
| [...ddress/logic/parser/DeletePolicyCommandParser.java](https://app.codecov.io/gh/AY2425S2-CS2103-F10-2/tp/pull/111?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fseedu%2Faddress%2Flogic%2Fparser%2FDeletePolicyCommandParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103-F10-2#diff-c3JjL21haW4vamF2YS9zZWVkdS9hZGRyZXNzL2xvZ2ljL3BhcnNlci9EZWxldGVQb2xpY3lDb21tYW5kUGFyc2VyLmphdmE=) | `100.00% <100.00%> (ø)` | `2.00 <2.00> (?)` | |
| [...a/seedu/address/logic/parser/ClientNestParser.java](https://app.codecov.io/gh/AY2425S2-CS2103-F10-2/tp/pull/111?src=pr&el=tree&filepath=src%2Fmain%2Fjava%2Fseedu%2Faddress%2Flogic%2Fparser%2FClientNestParser.java&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=AY2425S2-CS2103-F10-2#diff-c3JjL21haW4vamF2YS9zZWVkdS9hZGRyZXNzL2xvZ2ljL3BhcnNlci9DbGllbnROZXN0UGFyc2VyLmphdmE=) | `74.07% <0.00%> (-2.85%)` | `13.00 <0.00> (ø)` | |

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
author_association: NONE
user: login: FabianHeng
created_at: 2025-03-28T06:56:44Z
body: LGTM
author_association: NONE