{"id":23616980,"url":"https://github.com/migmm/event-management-system","last_synced_at":"2025-09-11T01:08:13.502Z","repository":{"id":269037057,"uuid":"903204443","full_name":"migmm/event-management-system","owner":"migmm","description":"Event management system","archived":false,"fork":false,"pushed_at":"2024-12-22T23:07:20.000Z","size":210,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T07:11:46.567Z","etag":null,"topics":["cap","hana","hana-cloud","sap","sap-btp","sap-hana"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/migmm.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,"zenodo":null}},"created_at":"2024-12-14T01:47:19.000Z","updated_at":"2024-12-21T16:13:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"1237418b-d9e2-41ab-bef3-b04158c2e21e","html_url":"https://github.com/migmm/event-management-system","commit_stats":null,"previous_names":["migmm/event-management-system"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/migmm/event-management-system","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migmm%2Fevent-management-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migmm%2Fevent-management-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migmm%2Fevent-management-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migmm%2Fevent-management-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/migmm","download_url":"https://codeload.github.com/migmm/event-management-system/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/migmm%2Fevent-management-system/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274557583,"owners_count":25307516,"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-10T02:00:12.551Z","response_time":83,"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":["cap","hana","hana-cloud","sap","sap-btp","sap-hana"],"created_at":"2024-12-27T18:15:40.318Z","updated_at":"2025-09-11T01:08:13.493Z","avatar_url":"https://github.com/migmm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API EVENTS MANAGER\n\u003cimg align=\"center\" src=\"assets/sap-logo.png\" alt=\"Sap logo\"/\u003e\n\nHay una [Versión en español](README_es.md) de este archivo.\n\nThis README provides an overview of the Event Tickets API, including instructions on how to use it, available routes, and details about its implementation.\n\nThis project is part of a *Deliverable for the SAP CAP Bootcamp at Globant.*\n\n## Introduction\n\nThe deliverable involves delivering a project built with SAP CAP and deployed on Cloud Foundry.\n\nThe API allows for the management of events and users. It provides CRUD operations for each entity and includes a custom endpoint.\n\n## Features\n\n- Actions and functions were used depending on the requirement.\n- Data was used from an external Business Partner API.\n- Custom routes were created in addition to the ones provided by CAP.\n- Validations were implemented for data entry.\n- Auto-generation of ID for the database, as in ID CAP mode there is no auto-increment feature.\n- The email was set as unique to test the errors thrown by CAP.\n- Custom endpoints implemented:\n      registerParticipant\n      getEventParticipants\n      cancelEvent\n      reopenEvent\n      fetchParticipantDetails\n\n## Requirements\n\n    Node.js (v18 or higher)\n    npm (v6 or higher)\n    CAP Framework\n    HANA Database\n\n## How to Run the Application\n\nClone the repository:\n\n```sh\n\ngit clone https://github.com/migmm/events-manager.git\ncd events-manager\n```\n\nInstall the dependencies:\n\n```sh\nnpm install\n```\n\nStart the service:\n\n```sh\ncds watch --profile hybrid\n```\n\nYou need to have HANA activated to load and work with the provided data tables.\n\n## Deployment\n\nFor the extra logic, JavaScript was used with this.before and this.on.\n\nAn additional entity was created to store data from the API Business Partner.\n\nThe entities were separated from the services.\n\nTo make the code more readable, data entry verifications were performed using this.before.\n\nErrors were modeled to be consistent with those returned by SAP CAP.\n\n## Relationships Between Entities\n\nThe relationships between entities are: Event to Participant (1:N ) explicitly, and Participant to BusinessPartner implicitly, as it is a foreign key and is handled by CAP.\n\n\u003cimg align=\"center\" src=\"assets/relations.png\" alt=\"Database relations\"/\u003e\n\n## Validations and Verifications\n\nValidations were implemented at both the entity level and in the JavaScript code.\nIn the entities, the type, range, and format were validated.\n\nVerifications were performed according to the requirements, e.g., whether the participant added to an event is added correctly. For this, the CAP after hook was used.\n\n## Requests\n\nBelow are requests with working data, omitting requests that would generate error messages. These requests with erroneous data are included both in the [HTTP file](rest-client.http) and the [Postman collection](Event%20Management%20API.postman_collection.json) for testing purposes.\n\n#### Base URL and port\n```sh\n@port=40037\n@api_base_url = http://localhost:{{port}}/odata/v4/management/\n```\n\n#### Events\n##### Get all events\n```sh\nGET {{api_base_url}}Events\nAccept: application/json\n```\n\n##### Create a new event\n```sh\nPOST {{api_base_url}}Events\nContent-Type: application/json\n\n{\n  \"Name\": \"Tech Conference 2024\",\n  \"StartDate\": \"2024-07-01\",\n  \"EndDate\": \"2024-07-03\",\n  \"Location\": \"New York City\",\n  \"Description\": \"Annual Technology Conference\",\n  \"IsActive\": true,\n  \"IsCancelled\": false,\n  \"CancellationReason\": null\n}\n```\n\n##### Update an event\n```sh\nPATCH {{api_base_url}}Events(1)\nContent-Type: application/json\n\n{\n  \"Description\": \"Updated description for Tech Conference 2024\"\n}\n```\n\n##### Delete an event\n```sh\nDELETE {{api_base_url}}Events(1)\n```\n\n#### Participantes\n\n##### Get all participants\n```sh\nGET {{api_base_url}}Participants\nAccept: application/json\n```\n\n##### Create a participant\n```sh\nPOST {{api_base_url}}Participants\nContent-Type: application/json\n\n{\n  \"FirstName\": \"John\",\n  \"LastName\": \"Doe\",\n  \"Email\": \"johndoe@xample.com\",\n  \"Phone\": \"123456789\",\n  \"BusinessPartnerID\": \"1000000\"\n}\n```\n\n##### Update a participant (BusinessPartnerID cannot be changed)\n```sh\nPATCH {{api_base_url}}Participants(1)\nContent-Type: application/json\n\n{\n  \"BusinessPartnerID\": \"987654321\"\n}\n```\n\n##### Delete a participant\n```sh\nDELETE {{api_base_url}}Participants(1)\n```\n    Custom logic\n\n##### Fetch Participant Details\n```sh\nGET {{api_base_url}}fetchParticipantDetails(ParticipantID=2)\nAccept: application/json\n\n```\n\n##### Register a participant for an event\n```sh\nPOST {{api_base_url}}registerParticipant\nContent-Type: application/json\n\n{\n  \"eventID\": 2,\n  \"participantID\": 2\n}\n```\n\n##### Cancel an event\n```sh\nPOST {{api_base_url}}cancelEvent\nContent-Type: application/json\n\n{\n  \"eventID\": 2,\n  \"reason\": \"Weather conditions\"\n}\n```\n\n##### Reopen an event\n```sh\nPOST {{api_base_url}}reopenEvent\nContent-Type: application/json\n\n{\n  \"eventID\": 2\n}\n```\n\n##### Retrieve participants for a specific event\n```sh\nGET {{api_base_url}}getEventParticipants(eventID=2)\nAccept: application/json\n```\n\n## Testing\n\nTo make testing easier, it was decided to *not include* authentication.\n\nAn [HTTP file](rest-client.http) was included for local and deployed testing in VS Code using the Rest Client extension, as well as a [Postman collection](Event%20Management%20API.postman_collection.json), including both correct and incorrect data.\n\nTo use the HTTP file locally or remotely, uncomment or comment line 14 as follows:\n\n    Testing locally:\n    ### @api_base_url = https://2fda7038trial-trial-spnpjyiq-events-man-event-managemen5a33b8dd.cfapps.us10-001.hana.ondemand.com/odata/v4/management/\n\n    Testing the deployed API:\n    @api_base_url = https://2fda7038trial-trial-spnpjyiq-events-man-event-managemen5a33b8dd.cfapps.us10-001.hana.ondemand.com/odata/v4/management/\n\n## Messages\n\nError messages and success messages were formatted to match the standard CAP format.\n\n- Error message formatted to the CAP standard\n\n```sh\n{\n  \"error\": {\n    \"code\": \"404\",\n    \"message\": \"Business Partner with ID 10000 does not exist.\",\n    \"@Common.numericSeverity\": 4\n  }\n}\n```\n\n##  Sources\n\nhttps://community.sap.com/t5/technology-q-a/error-during-request-to-remote-service-failed-to-load-destination/qaq-p/13773565\n\nhttps://api.sap.com/api/API_BUSINESS_PARTNER/resource/Business_Partner\n\nhttps://developers.sap.com/tutorials/spa-consume-actions-cap-setupenv..html\n\nhttps://cap.cloud.sap/docs/guides/using-services\n\nhttps://community.sap.com/t5/technology-blogs-by-sap/understanding-entity-relationships-in-cds/ba-p/13552921\n\nhttps://developers.sap.com/mission.hana-cloud-cap.html","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmigmm%2Fevent-management-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmigmm%2Fevent-management-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmigmm%2Fevent-management-system/lists"}