{"id":18694340,"url":"https://github.com/9elements/academy-exercise-es-6-classes","last_synced_at":"2025-10-26T05:08:33.370Z","repository":{"id":14533554,"uuid":"67236819","full_name":"9elements/academy-exercise-es-6-classes","owner":"9elements","description":"In this tutorial you'll learn how to use ES6 classes using Babel and webpack.","archived":false,"fork":false,"pushed_at":"2023-01-05T23:16:43.000Z","size":2185,"stargazers_count":4,"open_issues_count":18,"forks_count":2,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-12T00:37:19.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/9elements.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-02T16:08:12.000Z","updated_at":"2024-12-16T19:03:44.000Z","dependencies_parsed_at":"2023-01-11T20:22:07.444Z","dependency_job_id":null,"html_url":"https://github.com/9elements/academy-exercise-es-6-classes","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/9elements%2Facademy-exercise-es-6-classes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9elements%2Facademy-exercise-es-6-classes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9elements%2Facademy-exercise-es-6-classes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/9elements%2Facademy-exercise-es-6-classes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/9elements","download_url":"https://codeload.github.com/9elements/academy-exercise-es-6-classes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248530569,"owners_count":21119597,"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-07T11:10:10.689Z","updated_at":"2025-10-26T05:08:28.325Z","avatar_url":"https://github.com/9elements.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# User Stories\n\n- In a bank you have business accounts and private accounts.\n- You can transfer money between accounts using transactions.\n- For private accounts the transaction fee is 0.01 € for business accounts the transaction fee is 0.02 €.\n\n# Tasks\n\n- [ ] write an `Account` class\n  - [ ] The class should hold a reference to the `ledger`\n  - [ ] It should also have a `name` to identify the account\n- [ ] implement a `Transaction` class\n  - [ ] A transaction consists of an optional `sender` (Type: Account)\n  - [ ] `receiver` (Type: Account)\n  - [ ] `amount` (Type: Number)\n  - [ ] `reference` (Type: String)\n- [ ] implement a `Ledger` class that keeps all transactions\n  - [ ] It should keep an array of `transactions`\n  - [ ] Have a member variable `bankAccount` the keeps a reference for the bank account\n  - [ ] Implement a function `addTransaction(transaction)`\n  - [ ] Implement a function `calculateAmountForAccount(account)` using `reduce`\n  - [ ] Implement a function `findTransactionsForAccount(account)` using `filter`\n- [ ] Add convenience functions to `Account`\n  - [ ] add a `send` function that generates two transactions\n    - [ ] The actual transaction\n    - [ ] A transaction for the fee for the bank\n  - [ ] add a getter to calculate the `amount`\n  - [ ] add a getter to retrieve all `transactions` that are related to the account\n- [ ] specialize `Account` class into a `BusinessAccount`\n  - [ ] override the `send` function to respect different transaction fees for businesses\n\n# Help\n\nYou can see the tests in `integration-test`. Try to run write the classes so they are satisfying the tests. You can also follow the commits in the `solution` branch to see the solution.\n\n# Commands\n\n```\nnpm install # install all dependencies\nnpm test # runs all tests\nnpm start # starts a dev server on localhost:8000\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9elements%2Facademy-exercise-es-6-classes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F9elements%2Facademy-exercise-es-6-classes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F9elements%2Facademy-exercise-es-6-classes/lists"}