Skip to content

Commit 0ce394f

Browse files
committed
Adding group member logic
1 parent bda780d commit 0ce394f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

splitwise/src/main/java/com/example/splitwise/SplitWise.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.example.splitwise.controller.BalanceSheetController;
44
import com.example.splitwise.controller.GroupController;
55
import com.example.splitwise.controller.UserController;
6+
import com.example.splitwise.entity.user.Group;
67
import lombok.AllArgsConstructor;
78

89
@AllArgsConstructor
@@ -23,6 +24,12 @@ public class SplitWise {
2324
*/
2425
public void demo() {
2526
setupUserAndGroup();
27+
28+
//Step1: add members to the group
29+
Group group = groupController.getGroup("G1001");
30+
group.addMember(userController.getUser("U2001"));
31+
group.addMember(userController.getUser("U3001"));
32+
2633
}
2734

2835
private void setupUserAndGroup() {

0 commit comments

Comments
 (0)