{"id":16225549,"url":"https://github.com/pitzzahh/automated-teller-machine-api","last_synced_at":"2025-03-19T12:31:00.118Z","repository":{"id":49768404,"uuid":"517063021","full_name":"pitzzahh/automated-teller-machine-API","owner":"pitzzahh","description":"API used for making atm applications (none-web-app)","archived":false,"fork":false,"pushed_at":"2023-05-15T07:59:30.000Z","size":828,"stargazers_count":4,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-28T18:42:51.867Z","etag":null,"topics":["automated-teller-machine","database","postgresql-database","spring-jdbc","spring-jdbctemplate"],"latest_commit_sha":null,"homepage":"","language":"Java","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/pitzzahh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-07-23T13:18:12.000Z","updated_at":"2023-12-16T13:13:10.000Z","dependencies_parsed_at":"2024-10-27T20:33:40.845Z","dependency_job_id":"1a0b9777-5ded-4d57-852a-67fbb4951a13","html_url":"https://github.com/pitzzahh/automated-teller-machine-API","commit_stats":{"total_commits":273,"total_committers":4,"mean_commits":68.25,"dds":0.1208791208791209,"last_synced_commit":"e9f5f951cc76cdd1063017ad270ae33953750f63"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitzzahh%2Fautomated-teller-machine-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitzzahh%2Fautomated-teller-machine-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitzzahh%2Fautomated-teller-machine-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pitzzahh%2Fautomated-teller-machine-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pitzzahh","download_url":"https://codeload.github.com/pitzzahh/automated-teller-machine-API/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243989576,"owners_count":20379648,"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":["automated-teller-machine","database","postgresql-database","spring-jdbc","spring-jdbctemplate"],"created_at":"2024-10-10T12:45:24.041Z","updated_at":"2025-03-19T12:30:59.854Z","avatar_url":"https://github.com/pitzzahh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# automated-teller-machine-API\nAPI used for making atm applications (none-web-app)\n\n![GitHub Issues](https://img.shields.io/github/issues/pitzzahh/automated-teller-machine-console)\n![Forks](https://img.shields.io/github/forks/pitzzahh/automated-teller-machine-console)\n![Stars](https://img.shields.io/github/stars/pitzzahh/automated-teller-machine-console)\n![License](https://img.shields.io/github/license/pitzzahh/automated-teller-machine-console)\n________________________________________\n## Quickstart\n### How to use the API\n* With Database (can use any DBMS)\n\n```java\nimport io.github.pitzzahh.atm.database.DatabaseConnection;\nimport io.github.pitzzahh.atm.dao.InDatabase;\nimport io.github.pitzzahh.atm.service.AtmService;\nimport io.github.pitzzahh.atm.dao.AtmDAO;\n\npublic class App {\n    private static final AtmDAO ATM_DAO = new InDatabase();\n    private static final DatabaseConnection DATABASE_CONNECTION = new DatabaseConnection();\n\n    public static void main(String[] args) {\n        AtmService atmService = new AtmService(ATM_DAO);\n        atmService.setDataSource().accept(\n                DATABASE_CONNECTION\n                        .setDriverClassName(\"org.postgresql.Driver\")\n                        .setUrl(\"jdbc:postgresql://localhost/{database_name}\")\n                        .setUsername(\"{username}\")\n                        .setPassword(\"{password}\")\n                        .getDataSource()\n        );\n    }\n}\n ```\n\n---\n\n* Without Database (in-memory)\n\n```java\nimport io.github.pitzzahh.atm.service.AtmService;\nimport io.github.pitzzahh.atm.dao.InMemory;\n\npublic class App {\n\n    public static void main(String[] args) {\n        AtmService atmService = new AtmService(new InMemory()); \n    }\n}\n ```\n\n## Saving clients\n\n\nTo save a client object, a method called `saveClient()` in `AtmService` is used. It is a Function that accepts a Client Object.\n```java\natmService.saveClient().apply(\n        new Client(\n                \"123123123\",\n                \"123123\",\n                new Person(\n                        \"Mark\",\n                        \"Silent\",\n                        Gender.PREFER_NOT_TO_SAY,\n                        \"Earth\",\n                        LocalDate.of(2018, Month.AUGUST, 10)\n                ),\n                5555,\n                false\n        )\n);\n// getting the client, returns a Client object, throws IllegalArgumentException if account number does not belong to any client.\nClient client = atmService.getClientByAccountNumber().apply(\"123123123\");\n// prints the client (using Print class from util-classes-API)\nprintln(client);\n// removes the client by account number\natmService.removeClientByAccountNumber().apply(\"123123123\");\n\n```\nTo get the client from the database, there are two methods that can be used, first is `getClientByAccountNumber()` a method that accepts a\n`String` containing an account number, second is `getAllClients()` a method that get all the client\nas a `Supplier\u003cMap\u003cString, Client\u003e\u003e`.\nBelow shows the two ways on how to get a client/clients.\n```java\n// getting client by account number\nClient client = atmService.getClientByAccountNumber().apply(\"123123123\");\n```\n```java\n// getting all the clients.\nSupplier\u003cMap\u003cString, Client\u003e \u003e clients = atmService.getAllClients();\n```\nTo remove a client, there are also two methods that can be used, first is removing client by account number,\nsecond is removing all the clients.\nBelow shows the two ways on how to remove a client/clients.\n```java\n// removes the client by account number\natmService.removeClientByAccountNumber().apply(\"123123123\");\n```\n```java\n// removes all the clients\natmService.removeAllClients();\n```\n### Add Maven Dependency\n![maven-central](https://img.shields.io/maven-central/v/io.github.pitzzahh/automated-teller-machine-API?color=blue)\n\nIf you use Maven, add the following configuration to your project's `pom.xml`\n\nBe sure to replace the **VERSION** key below with the one of the versions shown above\n\n```maven\n\u003cdependencies\u003e\n\n    \u003c!-- other dependencies are there --\u003e\n    \u003cdependency\u003e\n        \u003cgroupId\u003eio.github.pitzzahh\u003c/groupId\u003e\n        \u003cartifactId\u003eautomated-teller-machine-API\u003c/artifactId\u003e\n        \u003cversion\u003eVERSION\u003c/version\u003e\n    \u003c/dependency\u003e\n    \u003c!-- other dependencies are there --\u003e\n\n\u003c/dependencies\u003e\n```\n### Others\nDependencies\n- [util-classes](https://github.com/pitzzahh/util-classes)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpitzzahh%2Fautomated-teller-machine-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpitzzahh%2Fautomated-teller-machine-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpitzzahh%2Fautomated-teller-machine-api/lists"}