{"id":31553487,"url":"https://github.com/mariosuarezdev/extensiones-soft-restaurant","last_synced_at":"2026-04-11T11:02:53.508Z","repository":{"id":313720033,"uuid":"1044453063","full_name":"mariosuarezDEV/Extensiones-Soft-Restaurant","owner":"mariosuarezDEV","description":"Esta API expone endpoints para consultar ventas (cheques) y sus detalles. Está desarrollada con Django REST Framework e implementa caché en Redis.","archived":false,"fork":false,"pushed_at":"2025-09-24T18:32:41.000Z","size":338,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T07:47:16.159Z","etag":null,"topics":["bootstrap","django","django-rest-framework","flask"],"latest_commit_sha":null,"homepage":"","language":"Python","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/mariosuarezDEV.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-25T17:51:59.000Z","updated_at":"2025-09-24T18:32:46.000Z","dependencies_parsed_at":"2025-09-08T04:03:43.422Z","dependency_job_id":"7966724e-583b-4b33-82a9-8fbbc7e1a537","html_url":"https://github.com/mariosuarezDEV/Extensiones-Soft-Restaurant","commit_stats":null,"previous_names":["mariosuarezdev/extensiones-soft-restaurant"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mariosuarezDEV/Extensiones-Soft-Restaurant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariosuarezDEV%2FExtensiones-Soft-Restaurant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariosuarezDEV%2FExtensiones-Soft-Restaurant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariosuarezDEV%2FExtensiones-Soft-Restaurant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariosuarezDEV%2FExtensiones-Soft-Restaurant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariosuarezDEV","download_url":"https://codeload.github.com/mariosuarezDEV/Extensiones-Soft-Restaurant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariosuarezDEV%2FExtensiones-Soft-Restaurant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31677819,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bootstrap","django","django-rest-framework","flask"],"created_at":"2025-10-04T20:25:16.975Z","updated_at":"2026-04-11T11:02:53.468Z","avatar_url":"https://github.com/mariosuarezDEV.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API de Ventas - Cheques\n\nEsta API expone endpoints para consultar **ventas** (cheques) y sus detalles.  \nEstá desarrollada con **Django REST Framework** e implementa **caché en Redis/Memcached** para optimizar las consultas (con expiración de 24 horas).\n\n## Endpoints\n\n### 1. Listar Ventas por Fecha\n\nObtiene todas las ventas registradas en una fecha específica.\n\n**URL**\n```\nGET /ventas/\n````\n\n**Parámetros Query**\n| Nombre | Tipo   | Requerido | Descripción |\n|--------|--------|-----------|-------------|\n| fecha  | string (YYYY-MM-DD) | ✅ | Fecha de las ventas a consultar |\n\n**Ejemplo de petición (httpie)**\n```bash\nhttp GET http://127.0.0.1:8000/ventas/?fecha==2025-08-27\n````\n\n**Respuesta exitosa (200)**\n\n```json\n[\n  {\n    \"folio\": 64229,\n    \"fecha\": \"2025-08-27T13:45:00Z\",\n    \"cliente\": \"Juan Pérez\",\n    \"total\": \"250.50\"\n  },\n  {\n    \"folio\": 64230,\n    \"fecha\": \"2025-08-27T14:10:00Z\",\n    \"cliente\": \"María López\",\n    \"total\": \"320.00\"\n  }\n]\n```\n\n**Errores**\n\n* `400 Bad Request` → Si no se envía el parámetro `fecha`.\n\n---\n\n### 2. Detalle de una Venta\n\nObtiene la información completa de una venta, incluyendo consumo (detalles) y pagos.\n\n**URL**\n\n```\nGET /ventas/{folio}/\n```\n\n**Parámetros de Ruta**\n\n| Nombre | Tipo | Requerido | Descripción                     |\n| ------ | ---- | --------- | ------------------------------- |\n| folio  | int  | ✅         | Identificador único de la venta |\n\n**Ejemplo de petición (httpie)**\n\n```bash\nhttp GET http://127.0.0.1:8000/ventas/64229/\n```\n\n**Respuesta exitosa (200)**\n\n```json\n{\n  \"Venta\": {\n    \"folio\": 64229,\n    \"fecha\": \"2025-08-27T13:45:00Z\",\n    \"cliente\": \"Juan Pérez\",\n    \"total\": \"250.50\"\n  },\n  \"Consumo\": [\n    {\n      \"producto\": \"Café Americano\",\n      \"cantidad\": 2,\n      \"precio\": \"30.00\",\n      \"subtotal\": \"60.00\"\n    },\n    {\n      \"producto\": \"Sandwich\",\n      \"cantidad\": 1,\n      \"precio\": \"50.00\",\n      \"subtotal\": \"50.00\"\n    }\n  ],\n  \"Pago\": [\n    {\n      \"metodo\": \"Efectivo\",\n      \"monto\": \"110.50\"\n    },\n    {\n      \"metodo\": \"Tarjeta\",\n      \"monto\": \"140.00\"\n    }\n  ]\n}\n```\n\n**Errores**\n\n* `404 Not Found` → Si el `folio` no existe.\n\n---\n\n## Cache\n\n* Cada petición se guarda en caché durante **24 horas (86400 segundos)**.\n* Claves de caché usadas:\n\n  * `ventas_{fecha}`\n  * `detalle_venta_{folio}`\n\n---\n\n## Ejecución local\n\n1. Levantar el servidor de Django:\n\n   ```bash\n   python manage.py runserver\n   ```\n\n2. Probar los endpoints con httpie o cURL.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariosuarezdev%2Fextensiones-soft-restaurant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariosuarezdev%2Fextensiones-soft-restaurant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariosuarezdev%2Fextensiones-soft-restaurant/lists"}