{"id":22066089,"url":"https://github.com/pcpratheesh/the_ledger_co","last_synced_at":"2026-05-13T07:10:00.602Z","repository":{"id":154439046,"uuid":"305578950","full_name":"pcpratheesh/THE_LEDGER_CO","owner":"pcpratheesh","description":"THE_LEDGER_CO , A Geektrust coding challenge","archived":false,"fork":false,"pushed_at":"2020-10-21T12:40:05.000Z","size":19270,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T00:36:26.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pcpratheesh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-20T03:26:16.000Z","updated_at":"2020-10-21T12:40:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"417c2990-9665-4939-9aaa-157d42c18447","html_url":"https://github.com/pcpratheesh/THE_LEDGER_CO","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2FTHE_LEDGER_CO","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2FTHE_LEDGER_CO/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2FTHE_LEDGER_CO/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcpratheesh%2FTHE_LEDGER_CO/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcpratheesh","download_url":"https://codeload.github.com/pcpratheesh/THE_LEDGER_CO/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245145712,"owners_count":20568183,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-30T19:25:39.755Z","updated_at":"2026-05-13T07:09:55.579Z","avatar_url":"https://github.com/pcpratheesh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# THE_LEDGER_CO\n\n\n## The challenge\n\n[Click Here to view the challenge](https://www.geektrust.in/coding-problem/backend/ledger-co)\n\nYou work at a startup called The Ledger Co., a marketplace for banks to lend money to borrowers and receive payments for the loans.\n\nThe interest for the loan is calculated by I = P*N*R where P is the principal amount, N is the number of years and R is the rate of interest. The total amount to repay will be A = P + I\n\nThe amount should be paid back monthly in the form of EMIs. The borrowers can also pay a lump sum (that is, an amount more than their monthly EMI). In such a case, the lump sum will be deducted from the total amount (A) which can reduce the number of EMIs. This doesn’t affect the EMI amount unless the remaining total amount is less than the EMI. All transactions happen through The Ledger Co.\n\nYou need to design a system to find out how much amount a user has paid the bank and how many EMIs are remaining .\n\n\n### Database configuration\nYou can change db connection details in .env file\n\nDomine : valid config value mysql, sqlite\n\n## EMI\nEmi has been calculated by simple interest rate\n**SI = P * R * T/100**\n\n* **SI** Simple Interest\n* **R**\t Rate of interest\n* **T**\t Time\n* **P**\t Principal Amount\n\n\nThe formula for calculating EMI using interest rate is:\n\n**EMI = (Principal + Interest)/Period in Months**\n\n\n\n## Assumptions and conditions added with Commands\n\n### Balance\n- It prints the total amount paid by the borrower, including all the Lump Sum amounts paid including that EMI number, and the no of EMIs remaining.\n- Only print Active emi payments\n  \n  for example : \n    \n    If IDIDI have **12** month emi payment with **85** as EMI amount. He have 12 active EMIs. On 1st payment he pays **170**. He payed **85** more as lumpsum. \n    Thus the extra paid **85** has been deducted from last emi and that EMI will be marked as fully paid.\n\n    So that the user have 10 active emi's remain to pay\n\n\n### Payment\n- EMIS can paid only one by one\n- Can't pay 4th emi without 3rd emi payment\n- Checking the emi already paid for a particular month\n- Payment Amount should be greaterthan or equals to the EMI monthly amount\n- If pay more than loan amount, remaining balance amount should be credit back to the user\n\n\n### Loan\n- Can't request multiple loan with the same bank and borrower name without completing all the emi payments.\n\n\n\n\n## Execution\n\n./main LOAN IDIDI bank 1000 1 2\n\n./main PAYMENT IDIDI bank 1000 5\n\n./main BALANCE IDIDI bank 0\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcpratheesh%2Fthe_ledger_co","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcpratheesh%2Fthe_ledger_co","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcpratheesh%2Fthe_ledger_co/lists"}