openapi: 3.0.0
info:
  title: Leads LG
  version: 1.0.0
  description: This API was developed to get LG leads

components:
  schemas:
    Lead:
      type: object
      required:
        - id
        - name
        - email
        - phone
        - created_at
        - updated_at
      properties:
        id:
          type: uuid
          description: The auto-generated id of the lead
        name:
          type: string
          description: The name of the lead
        email:
          type: string
          description: The email of the lead
        phone:
          type: string
          description: The phone of the lead
        created_at:
          type: date
          description: The created date user
        updated_at:
          type: date
          description: The lats updated date user
      example:
        id: fa9fb2f0-4d3d-48a3-bd79-a9750bcc8d10
        name: 'John Doe'
        email: 'johndoe@emai.com'
        phone: '1199009900'
        created_at: 2024-02-03T06:38:34.000Z 
        updated_at: 2024-04-03T09:28:04.000Z 

tags:
  name: Lead

paths:
  /leads:
    post:
      summary: Create a Lead
      tags:
        - Lead
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                email:
                  type: string
                phone:
                  type: string
              example:
                name: 'John Doe'
                email: 'johndoe@email.com'
                phone: '1199009900'
      responses:
        201:
          description: Lead Created
        409:
          description: Conflict
  /leads/list:
    get:
      summary: Get the list of all leads
      tags:
        - Lead
      responses:
        200:
          description: The list of all leads
          content:
            application/json:
              schema:
                type: object
                properties:
                  leads:
                    type: array
                    items:
                      $ref: '#/components/schemas/Lead'
        404:
          description: Bad request