Skip to content

Skycatch/acopio-api

Repository files navigation

Acopio API

API to connect to collection centers db

API para conectarse a la base de datos de centros de acopio

API Documentation / Documentación del API

productos / GET (products)

  • url: /productos/
  • method / método: GET
  • url params / parámetros de la url: none
  • success reponse / respuesta exitosa:
    • code / código: 200
    • content / contenido:
      [
        {
          nombreProducto: <string>,
          idProductos: <int>,
          idCentroDeAcopio: <int>, // center id
          ultimaFechaActualizacion: <date>, // last update date
          estadoProducto: <boolean> // product state
        },
        ...
      ]
    

acopios / GET (collection centers)

  • url: /acopios/
  • method / método: GET
  • url params / parámetros de la url: none
  • success reponse / respuesta exitosa:
    • code / código: 200
    • content / contenido:
      [
        {
          idCentroDeAcopio: <int>, // center
          nombreCentroDeAcopio: <string>, // center name
          direccionCentroDeAcopio: <text>, // center address
          ultimaFechaActualizacion: <date>,
          estadoProducto: <boolean>
        },
        ...
      ]
    

acopios/:id / GET (collection centers)

  • url: /acopios/:id
  • method / método: GET
  • url params / parámetros de la url:
    • id : id for the collection center / id del centro de acopio
  • success reponse / respuesta exitosa:
    • code / código: 200
    • content / contenido:
      {
        idCentroDeAcopio: <int>, // center
        nombreCentroDeAcopio: <string>, // center name
        direccionCentroDeAcopio: <text>, // center address
        ultimaFechaActualizacion: <date>,
        estadoProducto: <boolean>
      }
    

acopios/ POST (collection centers)

  • url: /acopios/
  • method: POST
  • post params / parámetros del mensaje:
    • nombreCentroDeAcopio: (required / requerido) Gathering center name / nombre del centro de acopio
    • direccionDentroDeAcopio: (required / requerido) Gathering center address / dirección del centro de acopio
    • estadoDeAcopio: (optional / opcional, default: true) Flag indicating if item is still needed / *Bandera indicando si el producto es aún requerido
  • success reponse / respuesta exitosa:
    • code / código: 201
    • content / contenido:
      {
        idCentroDeAcopio: <int>, // center
        nombreCentroDeAcopio: <string>, // center name
        direccionCentroDeAcopio: <text>, // center address
        ultimaFechaActualizacion: <date>,
        estadoProducto: <boolean>
      }
    
  • headers / encabezados
    • requires authentication / requiere autenticación

acopios/:id PUT (collection centers)

  • url: /acopios/:id
  • method: PUT
  • url params / parámetros de la url
    • id : id for the collection center / id del centro de acopio
  • post params / parámetros del mensaje:
    • nombreCentroDeAcopio: (optional / opcional) Gathering center name / nombre del centro de acopio
    • direccionDentroDeAcopio: (optional / opcional) Gathering center address / dirección del centro de acopio
    • estadoDeAcopio: (optional / opcional, default: true) Flag indicating if item is still needed / *Bandera indicando si el producto es aún requerido
  • success reponse / respuesta exitosa:
    • code / código: 200
    • content / contenido:
      {
        idCentroDeAcopio: <int>, // center
        nombreCentroDeAcopio: <string>, // center name
        direccionCentroDeAcopio: <text>, // center address
        ultimaFechaActualizacion: <date>,
        estadoProducto: <boolean>
      }
    
  • headers / encabezados
    • requires authentication / requiere autenticación

acopios/:id/productos GET (collection centers/products)

  • url: /acopios/:id/productos
  • method: GET
  • url params / parámetros de la url
    • id : id for the collection center / id del centro de acopio
  • success reponse / respuesta exitosa:
    • code / código: 200
    • content / contenido:
      [
        {
          nombreProducto: <string>,
          idProductos: <int>,
          idCentroDeAcopio: <int>, // center id
          ultimaFechaActualizacion: <date>, // last update date
          estadoProducto: <boolean> // product state
        },
        ...
      ]
    

responsables/ GET (person in charge)

  • url: /responsables/
  • method: GET
  • url params / parámetros de la url: none / ninguno
  • success reponse / respuesta exitosa:
    • code / código: 200
    • content / contenido:
      [
        {
          idResponsablesDeCentros: <int>,
          nombreResponsable: <string>, // name of person in charge
          telefonoResponsable: <string>, // phone of person in charge
          TwitterResponsable: <string>, // Twitter username of person in charge
          emailResponsable: <string> // Email of person in charge
        }
        ...
      ]
    

responsables/:id GET (person in charge)

  • url: /responsables/:id
  • method: GET
  • url params / parámetros de la url:
    • id : id for person in charge / id del responsable
  • success reponse / respuesta exitosa:
    • code / código: 200
    • content / contenido:
      {
        idResponsablesDeCentros: <int>,
        nombreResponsable: <string>, // name of person in charge
        telefonoResponsable: <string>, // phone of person in charge
        TwitterResponsable: <string>, // Twitter username of person in charge
        emailResponsable: <string> // Email of person in charge
      }
    

Authentication

TBD


Running the project / Cómo correr el proyecto

With docker-compose: docker-compose up Without docker, you should set the environment variables and use npm start

Con docker-compose: docker-compose up Sin docker, agrega las variables de ambiente y usa: npm start

Configuration / Configuración

Everything is through environment variables. Check env.dist for the required values and config/config.js for all of the available overrides.

Todo se hace por variables de ambiente. Revisa env.dist para los valores requeridos y config/config.js para ver todos los valores que se pueden cambiar.

About

API para centro de acopio

Resources

License

Contributing

Stars

12 stars

Watchers

32 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors