{"id":16778282,"url":"https://github.com/dgf/billing","last_synced_at":"2025-03-16T19:26:14.060Z","repository":{"id":144958886,"uuid":"139145546","full_name":"dgf/billing","owner":"dgf","description":"Billing Service","archived":false,"fork":false,"pushed_at":"2018-08-10T07:39:25.000Z","size":246,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T06:11:57.625Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dgf.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":"2018-06-29T12:15:22.000Z","updated_at":"2018-08-10T07:39:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c9438e8-2a88-4d00-8afe-5b61de7975e7","html_url":"https://github.com/dgf/billing","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/dgf%2Fbilling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgf%2Fbilling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgf%2Fbilling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgf%2Fbilling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgf","download_url":"https://codeload.github.com/dgf/billing/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243918643,"owners_count":20368746,"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-10-13T07:27:20.114Z","updated_at":"2025-03-16T19:26:14.038Z","avatar_url":"https://github.com/dgf.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Aplatanao Billing\n\n[![Build Status](https://travis-ci.org/dgf/billing.svg?branch=master)](https://travis-ci.org/dgf/billing)\n\nMore a development template than a usable billing application.\n\nDemonstration of a model driven and process based development on an actual Java stack.\n\n## Requirements\n\n### Database\n\nAdapt the `connection.properties` configuration for an existing [PostgreSQL] database.\n\nOr use a local [dockerized PostgreSQL]\n\n    # docker run --rm --name billing-postgres -p 5432:5432 -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=billing postgres:9\n\n### Migrations\n\nAll database changes are managed with [Flyway] migrations.\n\nRetrieve the actual migration meta data from the configured database with the [Flyway Maven Plugin]\n\n    $ mvn -P migration initialize flyway:info\n\nMigrate the database to the latest version.\n\n    $ mvn -P migration initialize flyway:migrate\n\n## Development\n\nBuild the whole project with all [Maven] modules.\n\n    $ mvn clean install\n\nStart the service with the [Spring Boot Maven Plugin]\n\n    $ cd service \u0026\u0026 mvn spring-boot:run\n\n### Useful development tools\n\n- IntelliJ [IDEA] to code and for SQL\n- [Swagger Editor] for Open API definitions\n- [Camunda Modeler] for BPMN definitions\n- [Apache JMeter] for integration testing and benchmarking\n\n### Migrations\n\nChange your database and record the necessary statements in [Flyway SQL Migrations]\n\n    $ ls -al migrations/src/main/resources/db/migration/\n    ...\n    -rw-r--r-- 1 dgf dgf   77 ago  4 12:59 V1__Create_extensions_and_schema.sql\n    -rw-r--r-- 1 dgf dgf  549 ago  4 12:59 V2__Create_invoice_table.sql\n    ...\n\nAdapt your changes with the [Flyway Maven Plugin]\n\n    $ cd migrations \u0026\u0026 mvn clean initialize flyway:migrate\n\n### Persistence\n\nGenerate JPA entity classes for the actual connected database with the [Hibernate Tools Maven Plugin]\n\n    $ cd persistence \u0026\u0026 mvn clean verify\n\n### REST API\n\nAdapt the OpenAPI 2.0 definition `specification/api.yaml`\n\nGenerate the JAX-RS interfaces and POJOs with the [Swagger Codegen Maven Plugin]\n\n    $ cd specification \u0026\u0026 mvn clean verify\n\n### Data type mappings\n\n- JAX-RS 2.1 + JPA 2.1 https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html\n- OpenAPI 2.0 https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types\n- GraphQL June 2018 Edition http://facebook.github.io/graphql/June2018/#sec-Type-System\n- PostgreSQL 9.4\n  - https://www.postgresql.org/docs/9.4/static/datatype.html\n  - https://www.tutorialspoint.com/postgresql/postgresql_data_types.htm\n\n| Common name | OpenAPI 2.0        | JAX-RS 2.1         | JPA 2.1            | PostgreSQL 9.4 | Restrictions                                          |\n| ----------- | ------------------ | ------------------ | ------------------ | -------------- |------------------------------------------------------ |\n| integer     | integer \u003e int32    | j.l.Integer        | short              | **smallint**   | 2 bytes: -32768 to +32767                             |\n| integer     | integer \u003e int32    | j.l.Integer        | j.l.Integer        | **integer**    | 4 bytes: -2147483648 to +2147483647                   |\n| long        | integer \u003e int64    | j.l.Long           | j.l.Long           | **bigint**     | 8 bytes: -9223372036854775808 to +9223372036854775807 |\n| string      | string             | j.l.String         | j.l.String         | varchar(**n**) | **n** characters                                      |\n| UUID        | string             | j.l.String         | j.u.UUID           | **uuid**       | 16 bytes                                              |\n| date        | string \u003e date      | j.t.LocalDate      | j.t.LocalDate      | **date**       | 4713 BC to 5874897 AD                                 |\n| date time   | string \u003e date-time | j.t.OffsetDateTime | j.t.OffsetDateTime | **timestamp**  | 4713 BC\t294276 AD 1 microsecond / 14 digits           |\n\n### Typical Failures\n\n#### build it with an invalid database connection\n\nEvent:\nA call of Maven results in the following error:\n\n    $ mvn clean install\n    ...\n    [ERROR] Failed to execute goal org.hibernate:hibernate-tools-maven-plugin:5.3.4.Final:hbm2java\n    (Entity generation) on project persistence: Execution Entity generation of goal\n    org.hibernate:hibernate-tools-maven-plugin:5.3.4.Final:hbm2java failed:\n    Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]:\n    Error calling Driver#connect: Connection to localhost:5432 refused.\n    Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.\n    Connection refused (Connection refused) -\u003e [Help 1]\n\nSolution:\ncheck the connection parameters and the access to your database from the machine the service should run on.\n\n### TBD\n\n- [x] re-add custom revengStrategy parameter for the Hibernate Codegen configuration, see https://github.com/hibernate/hibernate-tools/pull/1017\n- [ ] support Java long value literal restrictions for the @Min and @Max annotations in Swagger Codegen\n- [ ] support referenced type definitions in Swagger Codegen to reuse common restrictions like year and code\n\n[Apache JMeter]: https://jmeter.apache.org/\n[Camunda]: https://camunda.com/\n[Camunda Modeler]: https://camunda.com/products/modeler/\n[dockerized PostgreSQL]: https://hub.docker.com/_/postgres/\n[Flyway]: https://flywaydb.org/\n[Flyway Maven Plugin]: https://flywaydb.org/documentation/maven/\n[Flyway SQL Migrations]: https://flywaydb.org/documentation/migrations#sql-based-migrations\n[Hibernate Tools]: https://hibernate.org/tools/\n[Hibernate Tools Maven Plugin]: https://github.com/hibernate/hibernate-tools/tree/master/maven\n[IDEA]: https://www.jetbrains.com/idea/\n[Maven]: https://maven.apache.org/\n[PostgreSQL]: https://www.postgresql.org\n[Spring Boot]: https://spring.io/projects/spring-boot\n[Spring Boot Maven Plugin]: https://docs.spring.io/spring-boot/docs/current/reference/html/build-tool-plugins-maven-plugin.html\n[Swagger Codegen Maven Plugin]: https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin\n[Swagger Editor]: https://editor.swagger.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgf%2Fbilling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgf%2Fbilling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgf%2Fbilling/lists"}