Floppa-equipe-16 / floppa

API for a marketplace or auction website
MIT License
0 stars 0 forks source link

Obtention produit #30

Closed JeromeLev141 closed 1 year ago

JeromeLev141 commented 1 year ago

Obtention produit

Description

En tant qu'utilisateur, je peux accéder aux informations d'un produit.

Critères de succès

Détails techniques

Requête

Route

GET /products/{productId}

Réponse

Status

200 OK

Body

{
  id: string,
  createdAt: DateTime,
  title: string,
  description: string,
  suggestedPrice: Amount,
  category: ProductCategory,
  seller: {
    id: string,
    name: string,
  },
  offers: {
    count: number,
    avgAmount: Amount | null,
  }
}

Exemple : avec offres

{
  "id": "123",
  "createdAt": "2020-06-30T23:54:23.382Z",
  "title": "Nice hairbrush",
  "description": "Pink and all.",
  "suggestedPrice": 34.21,
  "category": "beauty",
  "seller": {
    "id": "abc",
    "name": "John Doe",
  },
  "offers": {
    "count": 2,
    "avgAmount": 36.43
  }
}

Exemple : sans offre

{
  "id": "123",
  "createdAt": "2020-06-30T23:54:23.382Z",
  "title": "Nice hairbrush",
  "description": "Pink and all.",
  "suggestedPrice": 34.21,
  "category": "beauty",
  "seller": {
    "id": "abc",
    "name": "John Doe",
  },
  "offers": {
    "count": 0,
  }
}

Exceptions