Clone the repo and cd to email
directory
yarn
yarn dev
variable | default | use |
---|---|---|
API_URI | localhost:3000 | api url |
PORT | 3001 | port in which email client will listen for requests |
MAIL_NAME | Grupo1-Dev | name that appears when email is received |
MAIL_USER | iic2173grupo1dev@gmail.com | mail account username |
MAIL_PASSWORD | arqui123 | mail account password |
API_MAILER_SECRET | apimailersecret | secret token to authenticate with api |
The email address clients must contact is IIC2173grupo1@gmail.com
- Subject: "Ayuda" (or any invalid header)
- Body: ""
This will send and email with all the possible Email formats you can send.
- Subject: "Compra"
- Body: "productId1;productId2;productId3;productId4"
This will result in buying the products with id productId1, productId2, productId3 and productId4
- Subject: "Productos"
- Body: "productId1;productId2;productId3;productId4"
Retrieve the information of the products with id productId1, productId2, productId3 and productId4.
- Subject: "Catalogo"
- Body: ""
Retrieve the information of all products.
- Subject: "Productos por categoria"
- Body: "idCategoria1;idCategoria2"
Retrieve the information of the categories with id is idCategoria1 and idCategoria2, with the information of the products that belong to that category.
- Subject: "Catalogo por categoria"
- Body: ""
Retrieve the information of all categories, with the information of the products that belong to the categories.
- Subject: "Categoria"
- Body: "idCategoria"
Retrieve the information of the category with id is idCategoria.
- Subject: "Categorias"
- Body: ""
Retrieve the information of all existing categories in the store.
This endpoint receive the status of a pre-made purchase to inform the client of the status of that request.
-
Route:
POST
/orderStatus/
-
Headers:
- Content-Type:
application/json
- Secret:
- Example through email
- Secret:
apimailersecret
- Secret:
- Example through email
- Content-Type:
-
Example Body:
{ "user": "persona@uc.cl", "products": [ { id: 104, name: 'Factor 50', price: 2300, passed: true }, { id: 1045, name: 'AXE', price: 1700, passed: true } ] "errors": { notMedicine: [ { id: 10, name: 'Paracetamol', price: 700, passed: false } ], notBeenBoughtToday: [ { id: 1042, name: 'OldSpice', price: 1700, passed: false }, { id: 105, name: 'Factor 30', price: 1700, passed: false } ] } "confirmationUrl": "<filtered order confirmation url>" }
or
{ "user": 'persona@uc.cl', "resolved": { "productId": 1042, "productName": 'OldSpice' } }
-
Success Response:
-
Status: 200
-
Content:
{ "message": "Order status received." }
-