https://github.com/kabragaurav/billingsystem
Billing System
https://github.com/kabragaurav/billingsystem
billing-system gof-patterns lld
Last synced: about 1 year ago
JSON representation
Billing System
- Host: GitHub
- URL: https://github.com/kabragaurav/billingsystem
- Owner: kabragaurav
- Created: 2024-06-21T04:42:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-21T14:35:30.000Z (about 2 years ago)
- Last Synced: 2025-03-15T03:41:18.653Z (over 1 year ago)
- Topics: billing-system, gof-patterns, lld
- Language: Java
- Homepage: https://kabragaurav.github.io/BillingSystem/
- Size: 81.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Billing System
by Gaurav Kabra
### Read it as a webpage here.
### Design
Below system uses:
- Factory design pattern
- Strategy design pattern
- Facade design pattern
- Adapter design pattern
- Observer design pattern
Please go over the GOF Design Patterns Repo to be familiar with the design patterns.

### Sample Run
```text
Buying products for customer Gaurav Kabra
Paying amount 850.0
Paid an amount of 850.0 via UPI!
Paid amount 850.0
Sent SMS invoice to 82098xxxxx
Sent email invoice to gauravxxxxx.xxx****@gmail.com
Purchase complete!
```
### Validations
Below ones should be implemented
- Discount cannot be more than price of product
- Not more than two phone number and email addresses can be registered at a time in Customer profile
- Extensible to new Payment methods (Facade)
- Some products may not be eligible for return/replacement. In that case, return date offset or replacement date offset will be null.
- finalPrice in Invoice need not be stored and will be derivable from price and discount as `finalPrice = price - discount`
- There can be multiple pays done by customer for an invoice. Partially by UPI, partially by credit card.
- An invoice is printed only when PayStatus for all transactions is SUCCESS.
- Payment can fail due to cancelled by user, rejected by bank (daily limit, suspected theft, insufficient balance) or errored due to incorrect details.
- As soon as invoice is generated, using customerId, details are sent over SMS/WhatsApp/Email.
- Max size of String and max size and type of Blob.