Skip to content

Commit

Permalink
Merge pull request #180 from yorklim/AddPolicy
Browse files Browse the repository at this point in the history
Remove policy type
  • Loading branch information
solomonng2001 authored Apr 11, 2024
2 parents 6d3cd66 + 2ae7f29 commit b70d606
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 30 deletions.
9 changes: 1 addition & 8 deletions src/main/java/seedu/address/model/policy/Policy.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public class Policy {
* The Policy id.
*/
public final String policyId;
private final PolicyType policyType;


/**
* Instantiates a new Policy.
Expand All @@ -48,7 +46,6 @@ public Policy(String policyName, String policyId) {
checkArgument(isValidId(policyId), MESSAGE_CONSTRAINTS_ID);
this.policyName = policyName;
this.policyId = policyId;
this.policyType = PolicyType.DEFAULT;
}

public String getPolicyId() {
Expand All @@ -59,10 +56,6 @@ public String getPolicyName() {
return policyName;
}

public PolicyType getPolicyType() {
return policyType;
}

/**
* Is id boolean.
*
Expand Down Expand Up @@ -104,7 +97,7 @@ public boolean hasSameId(Policy policy) {
}
@Override
public String toString() {
return "Name:" + policyName + ", Type:" + policyType + ", Policy ID:" + policyId;
return "Name:" + policyName + ", Policy ID:" + policyId;
}

@Override
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/seedu/address/model/policy/PolicyType.java

This file was deleted.

3 changes: 0 additions & 3 deletions src/main/java/seedu/address/ui/ClientPolicyTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public class ClientPolicyTable extends UiPart<Region> {
private TableColumn<Policy, String> policyId;
@FXML
private TableColumn<Policy, String> policyName;
// @FXML
// private TableColumn<Policy, String> policyType;

/**
* Creates an empty {@code ClientPolicyTable}.
Expand All @@ -39,7 +37,6 @@ public ClientPolicyTable(PolicyList policyList) {
super(FXML);
policyId.setCellValueFactory(new PropertyValueFactory<Policy, String>("policyId"));
policyName.setCellValueFactory(new PropertyValueFactory<Policy, String>("policyName"));
// policyType.setCellValueFactory(new PropertyValueFactory<Policy, String>("policyType"));
policyTableView.setItems(policyList.policyList);
}

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/view/ClientPolicyTable.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<columns>
<TableColumn fx:id="policyId" editable="false" minWidth="80.0" prefWidth="100.0" reorderable="false" text="Policy ID" />
<TableColumn fx:id="policyName" editable="false" minWidth="120.0" prefWidth="300.0" reorderable="false" text="Policy Name" />
<!-- <TableColumn fx:id="policyType" editable="false" minWidth="120.0" prefWidth="300.0" reorderable="false" text="Policy Type" /> -->
</columns>
<columnResizePolicy>
<TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
Expand Down
7 changes: 1 addition & 6 deletions src/test/java/seedu/address/model/policy/PolicyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public void getPolicyName() {
assertEquals(policy.getPolicyName(), VALID_NAME);
}

@Test
public void getPolicyType() {
assertEquals(policy.getPolicyType(), PolicyType.DEFAULT);
}

@Test
public void isIdTestTrue() {
assertTrue(policy.isID(VALID_ID));
Expand Down Expand Up @@ -70,7 +65,7 @@ public void hasSameIdTestFalse() {

@Test
public void toStringMethod() {
assertEquals(policy.toString(), "Name:" + VALID_NAME + ", Type:DEFAULT, Policy ID:" + VALID_ID);
assertEquals("Name:" + VALID_NAME + ", Policy ID:" + VALID_ID, policy.toString());
}

@Test
Expand Down

0 comments on commit b70d606

Please sign in to comment.