{"id":20475228,"url":"https://github.com/vomnes/c2FyYmFjYW5l","last_synced_at":"2025-05-09T01:32:03.205Z","repository":{"id":68249962,"uuid":"230165932","full_name":"vomnes/c2FyYmFjYW5l","owner":"vomnes","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-14T17:56:24.000Z","size":15399,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-16T17:37:52.728Z","etag":null,"topics":["docker","docker-compose","golang","javaspring","junit5","mongodb","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Go","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/vomnes.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}},"created_at":"2019-12-25T23:50:31.000Z","updated_at":"2020-01-17T15:57:44.000Z","dependencies_parsed_at":"2023-05-13T01:30:19.213Z","dependency_job_id":null,"html_url":"https://github.com/vomnes/c2FyYmFjYW5l","commit_stats":null,"previous_names":["vomnes/test-sarbacane"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vomnes%2Fc2FyYmFjYW5l","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vomnes%2Fc2FyYmFjYW5l/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vomnes%2Fc2FyYmFjYW5l/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vomnes%2Fc2FyYmFjYW5l/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vomnes","download_url":"https://codeload.github.com/vomnes/c2FyYmFjYW5l/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253174394,"owners_count":21865857,"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":["docker","docker-compose","golang","javaspring","junit5","mongodb","unit-testing"],"created_at":"2024-11-15T15:15:06.692Z","updated_at":"2025-05-09T01:32:02.439Z","avatar_url":"https://github.com/vomnes.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# c2FyYmFjYW5l\n\n## Launch the service\nDocker is required.\n\n**Create the docker images:**  \n`sh create-docker-images.sh`\nor\n`docker-compose build`\n\n**Build and run the docker containers:**  \n`sh run.sh`\nor\n`docker-compose up`  \nThis command run the unit tests for each microservice and then launch it.\n\n## CSV Extractor\nThis microservice is an API that use :\n- Java Spring\n- Junit 5 for the tests\n\n#### POST - /uploadCSV\nThis route allows to extract a contact list from a CSV.\n\nTake as parameter in the **'form-data'** body an item named **'file'** that contains a file with the contact list :\n- A file must be selected\n- This file must be a CSV type\n- The CSV delimiters handled are \";\" and \",\"\n- The CSV file must at least contains a valid 'email' or 'phone number'\n- Field names are not necessary\n\nOther details :\n- If a email address is found his value is stored in 'email'\n- If a phone number is found his value is stored in 'phoneNumber'\n- If an element in email row is found but his content is not an email this data is cleared\n- If an element in 'n° de mobile' row is found but his content is not an french phone number this data is cleared\n- Content that doesn't have a field name is affected to 'col{rowIndex}' field name\n\nThe extracted data will be formatted in JSON and send to the route 'POST /v1/contacts' of the Manage Contacts microservice.  \nIf you want to get the formatted JSON in the HTTP response (no connection with 'POST /v1/contacts') you just need to add in the request header `Content-Test: 'true'`.\n\n## Manage Contacts\nThis microservice is an API that use :\n- Golang\n- Unit testing with the Golang standard library\n- MongoDB (3.4.6) for the database containing the collections `Contacts` and `FieldNames`\n\n#### POST - /v1/contacts\nThis route allows to store the contact list in the body in the mongodb database.\n\n```\nJSON Body :\n[\n  {\n    \"phoneNumber\"   string,\n    \"email\"         string,\n    \"xFieldName\"    string,\n    ...\n  }\n  ...\n]\n```\n\nDetails :\n- Email are cleared if invalid\n- PhoneNumber must be french number to be valid else cleared\n- PhoneNumber are formatted for insertion with +33\nNot inserted if :\n- Email or PhoneNumber exists already in the database\n- Email \u0026 PhoneNumber are empty (or invalid for email)\n- New contact doesn't contains an email or phoneNumber\nIf failed to insert contacts the list of those contact is returned in the response JSON\n\nReturn HTTP Code 201 Status Created for success\n\n## Database - MongoDB\nThe name of the database in MongoDB is *sarbacanes_contacts*.\n\n### Collections\n#### Contacts\n```\n{\n  \"_id\"           string,\n  \"email\"         string,\n  \"phoneNumber\"   string,\n  \"createdat\"     time,\n  \"updatedat\"     time,\n  \"informations\"  [\n    {\n      \"fieldName_id\": string,\n      \"value\":        string\n    }\n    ...\n  ]\n}\n```\n\n#### FieldNames\n```\n{\n  \"_id\":          string,\n  \"captionName\":  string\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvomnes%2Fc2FyYmFjYW5l","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvomnes%2Fc2FyYmFjYW5l","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvomnes%2Fc2FyYmFjYW5l/lists"}