From 938427dace1a9622a55e3f81845fb82af697d001 Mon Sep 17 00:00:00 2001 From: Kamal Wickramanayake Date: Fri, 20 Mar 2026 22:48:14 +0530 Subject: Added 11-point-of-sale sample application --- oop/11-point-of-sale/docs/01-requirements.txt | 7 +++ oop/11-point-of-sale/docs/02-domain-model.uxf | 16 ++++++ oop/11-point-of-sale/docs/03-design.uxf | 71 +++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 oop/11-point-of-sale/docs/01-requirements.txt create mode 100644 oop/11-point-of-sale/docs/02-domain-model.uxf create mode 100644 oop/11-point-of-sale/docs/03-design.uxf (limited to 'oop/11-point-of-sale/docs') diff --git a/oop/11-point-of-sale/docs/01-requirements.txt b/oop/11-point-of-sale/docs/01-requirements.txt new file mode 100644 index 0000000..4f99432 --- /dev/null +++ b/oop/11-point-of-sale/docs/01-requirements.txt @@ -0,0 +1,7 @@ +A POS system needs to be created. A customer comes to the cashier and the +cashier takes items from the cart and enters the item ids into the system. For +each item type, the system asks the number of items to be purchased. The +system creates a bill and adds line items to it. At the end, the total is +calculated and the tax should be added. The system should ask to enter the +amount of money the customer would give. The system should print the entire +bill with the balance to be given back to the customer. diff --git a/oop/11-point-of-sale/docs/02-domain-model.uxf b/oop/11-point-of-sale/docs/02-domain-model.uxf new file mode 100644 index 0000000..04dae9e --- /dev/null +++ b/oop/11-point-of-sale/docs/02-domain-model.uxf @@ -0,0 +1,16 @@ +10UMLClass45020010030CustomerUMLClass31010010030CashierUMLClass5052010080Item +-- +id: String +name: String +unitPriceUMLClass5033010030CartRelation8035040190lt=<<<<- +m2=*10;10;10;170UMLClass270340180100Bill +-- +id +total +tax +cashByCustomer +balanceUMLClass31053010040LineItem +-- +quantity: intRelation35043040120lt=<<<<<- +m2=*10;10;10;100UMLClass6010012030PointOfSaleSystemRelation14054019040lt=<- +m1=110;10;170;10 \ No newline at end of file diff --git a/oop/11-point-of-sale/docs/03-design.uxf b/oop/11-point-of-sale/docs/03-design.uxf new file mode 100644 index 0000000..8eaee19 --- /dev/null +++ b/oop/11-point-of-sale/docs/03-design.uxf @@ -0,0 +1,71 @@ +10Space for diagram notesUMLClass88047013070Item +-- +-id: String +-name: String +-unitPrice: BigDecimalUMLClass880340130100LineItem +-- +itemId: String +itemName: String +quantity: int +unitPrice: BigDecimal +Relation94025040110lt=<<<<<- +m2=*10;10;10;90UMLClass860140180120Bill +-- +id: int +total: BigDecimal +tax: BigDecimal +cashByCustomer: BigDecimal +balance: BigDecimal +-- +addLineItem(lineItem: LineItem)UMLClass900010060Cashier +-- +name: String +id: StringRelation9405030110lt=<-10;10;10;90UMLClass2702010060TextUI +-- +-- +-printBill() ++start()UMLClass48020250140<<interface>> +PointOfSale +-- +-- +createNewBill(): Bill +addLineItem(itemId: String, quantity: int) +cashByCustomer(amount: String) +searchItems(q: String): ListsavBill() +saveBill() +finishBillSession()Relation3603014030lt=<-120;10;10;10UMLClass490420240120<<interface>> +BillManager +-- +-- +createNewBill():Bill +addLineItem(itemId: String, quantity: int) +cashByCustomer(amount: String) +saveBill() +finishBillSession()Relation60032030120lt=<-10;100;10;10UMLClass89064010030TaxCalculatorUMLClass0370370100<<interface>> +ItemManager +-- +-- +createItem(id: String, name: String, unitPrice: BigDecimal): Item +findById(id: String): Item +searchItems(q: String): ListRelation180250320140lt=<-10;120;10;10;300;10UMLClass480210250120PointOfSaleImpl +-- +-- +createNewBill(): Bill +addLineItem(itemId: String, quantity: int) +cashByCustomer(amount: String) +searchItems(q: String): List +saveBill() +finishBillSession()Relation6001503080lt=<<.10;10;10;60UMLClass490600240120BillManagerImpl +-- +- currentBill:Bill +-- +createNewBill():Bill +addLineItem(itemId: String, quantity: int) +cashByCustomer(amount: String) +saveBill() +finishBillSession()Relation6005303090lt=<<.10;10;10;70UMLClass050037080ItemManagerImpl +-- +-- +createItem(id: String, name: String, unitPrice: BigDecimal) +findById(id: String): Item +searchItems(q: String): ListRelation1804603060lt=<<.10;10;10;40Relation36438019060lt=<-10;10;170;10;170;40 \ No newline at end of file -- cgit v1.2.3