{"id":20039059,"url":"https://github.com/defra/rpa-mit-reference-data","last_synced_at":"2025-09-20T07:32:55.244Z","repository":{"id":173638561,"uuid":"649712913","full_name":"DEFRA/rpa-mit-reference-data","owner":"DEFRA","description":"A minimal api for suppling reference data (.NET 6)","archived":false,"fork":false,"pushed_at":"2024-04-30T10:08:38.000Z","size":180,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-02T06:29:50.829Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","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/DEFRA.png","metadata":{"files":{"readme":"README.md","changelog":"changelog/db.changelog-1.0.xml","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":"2023-06-05T13:24:34.000Z","updated_at":"2024-04-30T10:08:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"ea69866a-958f-4538-931c-1f48275d1329","html_url":"https://github.com/DEFRA/rpa-mit-reference-data","commit_stats":null,"previous_names":["defra/rpa-mit-referencedata","defra/rpa-mit-reference-data"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/DEFRA/rpa-mit-reference-data","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-reference-data","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-reference-data/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-reference-data/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-reference-data/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DEFRA","download_url":"https://codeload.github.com/DEFRA/rpa-mit-reference-data/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DEFRA%2Frpa-mit-reference-data/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276064273,"owners_count":25578997,"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","status":"online","status_checked_at":"2025-09-20T02:00:10.207Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-13T10:35:12.696Z","updated_at":"2025-09-20T07:32:55.191Z","avatar_url":"https://github.com/DEFRA.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reference Data\r\n\r\nThis repository hosts a minimal API, designed to supply invoice template reference data that ensures that only valid manual invoices can be produced, these endpoints help in querying different data sets related to the invoices and their respective codes in the system. Each endpoint is designed to return data in a structured format based on the query parameters provided.\r\n\r\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=rpa-mit-reference-data\u0026metric=alert_status)](https://sonarcloud.io/summary/new_code?id=rpa-mit-reference-data) [![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=rpa-mit-reference-data\u0026metric=code_smells)](https://sonarcloud.io/summary/new_code?id=rpa-mit-reference-data) [![Coverage](https://sonarcloud.io/api/project_badges/measure?project=rpa-mit-reference-data\u0026metric=coverage)](https://sonarcloud.io/summary/new_code?id=rpa-mit-reference-data) [![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=rpa-mit-reference-data\u0026metric=ncloc)](https://sonarcloud.io/summary/new_code?id=rpa-mit-reference-data)\r\n## Requirements\r\n\r\nAmend as needed for your distribution, this assumes you are using windows with WSL.\r\n\r\n- \u003cdetails\u003e\r\n    \u003csummary\u003e .NET 8 SDK \u003c/summary\u003e\r\n    \r\n    #### Basic instructions for installing the .NET 8 SDK on a debian based system.\r\n  \r\n    Amend as needed for your distribution.\r\n\r\n    ```bash\r\n    wget https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb -O packages-microsoft-prod.deb\r\n    sudo dpkg -i packages-microsoft-prod.deb\r\n    sudo apt-get update \u0026\u0026 sudo apt-get install -y dotnet-sdk-8.0\r\n    ```\r\n\u003c/details\u003e\r\n\r\n- \u003cdetails\u003e\r\n    \u003csummary\u003e EF Core Tools \u003c/summary\u003e\r\n    \r\n    ```bash\r\n    dotnet tool install --global dotnet-ef\r\n    ```\r\n\u003c/details\u003e\r\n\r\n-  PostgreSQL database\r\n-  [Docker](https://docs.docker.com/desktop/install/linux-install/)\r\n---\r\n## Create the database\r\n\r\nCreate the postgres database in docker\r\n\r\n```bash\r\ndocker pull postgres\r\n```\r\n\r\n```bash\r\ndocker run --name MY_POSTGRES_DB -e POSTGRES_PASSWORD=password -p 5432:5432 -d postgres\r\n```\r\n\r\n---\r\n## Local Setup\r\n\r\nTo run this service locally complete the following steps.\r\n### Set up user secrets\r\n\r\nUse the secrets-template to create a secrets.json in the same folder location.\r\n\r\n**Example** values that work in local environments for these 2 keys.\r\n\r\n```json\r\n{\r\n    \"AzureADPostgreSQLResourceID\": \"https://ossrdbms-aad.database.windows.net/.default\",\r\n    \"DbConnectionTemplate\": \"Server={0};Port={1};Database={2};User Id={3};Password={4};\"\r\n}\r\n```\r\n\r\nOnce this is done run the following command to add the projects user secrets\r\n\r\n```bash\r\ncat secrets.json | dotnet user-secrets set\r\n```\r\n\r\nThese values can also be created as environment variables or as a development app settings file, but the preferred method is via user secrets.\r\n\r\n### Apply DB migrations\r\n\r\nWe use EF Core to handle database migrations. Run the following command to update migrations on database.\r\n\r\n**NOTE** - You will need to create the database in postgres before migrating.\r\n\r\n```bash\r\ndotnet ef database update\r\n```\r\n\r\n### Start the Api\r\n\r\n```bash\r\ncd RPA.MIT.ReferenceData.Api\r\n```\r\n\r\n```bash\r\ndotnet run\r\n```\r\n\r\n\r\n---\r\n## Running in Docker\r\n\r\nTo create the application as a docker container run the following command in the parent directory.\r\n\r\n```bash\r\ndocker compose up\r\n```\r\n\r\n---\r\n## Endpoints\r\n\r\n### HTTP\r\n\r\n#### Accounts\r\nRetrieves a list of valid account codes based on the provided filters.\r\n```http\r\nGET /accounts/{invoiceType?}/{organisation?}/{schemeType?}/{paymentType?}\r\n```\r\n\r\n#### Combinations\r\nRetrieves a list of valid combinations of account/scheme and delivery body codes based on the provided filters.\r\n```http\r\nGET /combinations/{invoiceType?}/{organisation?}/{schemeType?}/{paymentType?}\r\n```\r\n\r\n#### Delivery Body Codes\r\nRetrieves a list of valid delivery body codes based on the provided filters.\r\n```http\r\nGET /deliveryBodies/{invoiceType?}/{organisation?}/{schemeType?}/{paymentType?}\r\n```\r\n\r\n#### Fund Codes\r\nRetrieves a list of valid fund codes based on the provided filters.\r\n```http\r\nGET /funds/{invoiceType?}/{organisation?}/{schemeType?}/{paymentType?}\r\n```\r\n\r\n#### Marketing Year Codes\r\nRetrieves a list of valid marketing year codes based on the provided filters.\r\n```http\r\nGET /marketingYears/{invoiceType?}/{organisation?}/{schemeType?}/{paymentType?}\r\n```\r\n\r\n#### Scheme Codes\r\nRetrieves a list of valid scheme codes based on the provided filters.\r\n```http\r\nGET /schemes/{invoiceType?}/{organisation?}/{schemeType?}/{paymentType?}\r\n```\r\n\r\n#### Invoice Type Codes\r\nRetrieves a list of all valid invoice type codes.\r\n```http\r\nGET /invoiceTypes\r\n```\r\n\r\n#### Organisation Codes\r\nRetrieves a list of all valid organisation codes, can be filtered by invoice type.\r\n```http\r\nGET /organisations\r\n```\r\n\r\n#### Payment Type Codes\r\nRetrieves a list of all valid payment type codes, can be filtered by invoice type and/or organisation.\r\n```http\r\nGET /paymentTypes\r\n```\r\n\r\n#### Scheme Type Codes\r\nRetrieves a list of all valid scheme type codes, can be filtered by invoice type and/or organisation.\r\n```http\r\nGET /schemeTypes\r\n```\r\n\r\n#### Swagger\r\n\r\nSwagger is also available in development environments with more detailed information on the endpoints and their expected payloads.\r\n```http\r\n/swagger\r\n```\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Frpa-mit-reference-data","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefra%2Frpa-mit-reference-data","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefra%2Frpa-mit-reference-data/lists"}