export const response_empresa_plan = {
  description: 'Plan actualizado exitosamente',
  schema: {
    type: 'object',
    properties: {
      success: { type: 'boolean', example: true },
      message: { type: 'string', example: 'Plan actualizado exitosamente' },
      data: {
        type: 'object',
        properties: {
          id: { type: 'string', format: 'uuid', example: 'd63b8f2f-d9f8-4d20-968f-b5f9bc6a75eb' },
          empresa_id: { type: 'string', format: 'uuid', example: '7eeeedd9-fa1d-4db5-b2e2-0adf6a39789a' },
          plan_id: { type: 'string', format: 'uuid', example: '1528964f-b4ba-46e8-9b29-bc0de389cfe0' },
          fecha_inicio: { type: 'object' },
          fecha_fin: { type: 'object' },
          estado: { type: 'string', example: 'Activo' },
          fecha_prox_cobro: { type: 'object' },
          fecha_cancelacion: { type: 'object', nullable: true, example: null },
          descripcion: { type: 'string', example: 'Upgrade a plan Pro' },
          costo_mensual: { type: 'number', example: 10000 },
          created_at: { type: 'object' },
          updated_at: { type: 'object' },
        },
      },
    },
  },
};

export const response_empresa_find = {
  description: 'Empresa encontrada',
  schema: {
    type: 'object',
    properties: {
      message: { type: 'string' },
      data: {
        type: 'object',
        properties: {
          id: { type: 'string' },
          ruc: { type: 'string' },
          dv: { type: 'string' },
          razon_social: { type: 'string' },
          nombre_fantasia: { type: ['string', 'null'] },
          tipo_contribuyente: {
            type: 'object',
            properties: {
              id: { type: 'string' },
              codigo: { type: 'number' },
              descripcion: { type: 'string' },
            },
          },
          celular: { type: 'string' },
          celular_validado: { type: 'boolean' },
          email: { type: 'string' },
          email_validado: { type: 'boolean' },
          active: { type: 'boolean' },
          produccion: { type: 'boolean' },
          created_at: { type: 'string', format: 'date-time' },
          updated_at: { type: 'string', format: 'date-time' },
          empresas_sucursales: { type: 'array', items: { type: 'object' } },
          estado_empresa: {
            type: 'object',
            properties: {
              id: { type: 'string' },
              descripcion: { type: 'string' },
              activo: { type: ['string', 'null'] },
              created_at: { type: 'string', format: 'date-time' },
              updated_at: { type: 'string', format: 'date-time' },
              codigo: { type: 'string' },
            },
          },
          actividades_economicas: { type: 'array', items: { type: 'object' } },
          tipo_contribuyente_empresas: {
            type: 'object',
            properties: {
              id: { type: 'string' },
              codigo: { type: 'number' },
              descripcion: { type: 'string' },
              created_at: { type: 'string', format: 'date-time' },
              updated_at: { type: 'string', format: 'date-time' },
              usuario: { type: ['string', 'null'] },
            },
          },
          empresas_timbrado: { type: 'array', items: { type: 'object' } },
          empresas_puntos_expedicion: { type: 'array', items: { type: 'object' } },
          empresas_correo: { type: 'array', items: { type: 'object' } },
          suscripciones: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                id: { type: 'string' },
                plan_id: { type: 'string' },
                fecha_inicio: { type: 'string', format: 'date-time' },
                fecha_fin: { type: 'string', format: 'date-time' },
                estado: { type: 'string' },
                fecha_prox_cobro: { type: 'string', format: 'date-time' },
                fecha_cancelacion: { type: ['string', 'null'], format: 'date-time' },
                descripcion: { type: 'string' },
                costo_mensual: { type: 'string' },
                created_at: { type: 'string', format: 'date-time' },
                updated_at: { type: 'string', format: 'date-time' },
                suscripcion_modulos: {
                  type: 'array',
                  items: {
                    type: 'object',
                    properties: {
                      id: { type: 'string' },
                      suscripcion_id: { type: 'string' },
                      modulo_id: { type: 'string' },
                      tipo: { type: 'string' },
                      costo_adicional: { type: 'string' },
                      active: { type: 'boolean' },
                      created_at: { type: 'string', format: 'date-time' },
                      updated_at: { type: 'string', format: 'date-time' },
                    },
                  },
                },
                planes: {
                  type: 'object',
                  properties: {
                    id: { type: 'string' },
                    codigo: { type: 'string' },
                    descripcion: { type: 'string' },
                    precio: { type: 'string' },
                    periodo_prueba: { type: 'string' },
                  },
                },
              },
            },
          },
        },
      },
    },
  },
};

export const response_timbrado = {
  description: 'Timbrado creado correctamente',
  schema: {
    type: 'object',
    properties: {
      message: { type: 'string' },
      data: {
        type: 'object',
        properties: {
          id: { type: 'string' },
          empresa_id: { type: 'string' },
          numero_inicial: { type: 'string' },
          numero_final: { type: 'string' },
          fecha_inicio: { type: 'string', format: 'date-time' },
          fecha_fin: { type: 'string', format: 'date-time' },
          estado: { type: 'string' },
          created_at: { type: 'string', format: 'date-time' },
          updated_at: { type: 'string', format: 'date-time' },
        },
      },
    },
  },
};

export const response_empresa_all = {
  description: 'Empresas obtenidas exitosamente',
  schema: {
    type: 'object',
    properties: {
      message: { type: 'string' },
      data: {
        type: 'array',
        items: {
          type: 'object',
          properties: {
            id: { type: 'string' },
            ruc: { type: 'string' },
            dv: { type: 'string' },
            razon_social: { type: 'string' },
            nombre_fantasia: { type: ['string', 'null'] },
            tipo_contribuyente: {
              type: 'object',
              properties: {
                id: { type: 'string' },
                codigo: { type: 'number' },
                descripcion: { type: 'string' },
              },
            },
            celular: { type: 'string' },
            celular_validado: { type: 'boolean' },
            email: { type: 'string' },
            email_validado: { type: 'boolean' },
            active: { type: 'boolean' },
            produccion: { type: 'boolean' },
            created_at: { type: 'string', format: 'date-time' },
            updated_at: { type: 'string', format: 'date-time' },
            empresas_sucursales: { type: 'array', items: { type: 'object' } },
            estado_empresa: {
              type: 'object',
              properties: {
                id: { type: 'string' },
                descripcion: { type: 'string' },
                activo: { type: ['string', 'null'] },
                created_at: { type: 'string', format: 'date-time' },
                updated_at: { type: 'string', format: 'date-time' },
                codigo: { type: 'string' },
              },
            },
            actividades_economicas: { type: 'array', items: { type: 'object' } },
            tipo_contribuyente_empresas: {
              type: 'object',
              properties: {
                id: { type: 'string' },
                codigo: { type: 'number' },
                descripcion: { type: 'string' },
                created_at: { type: 'string', format: 'date-time' },
                updated_at: { type: 'string', format: 'date-time' },
                usuario: { type: ['string', 'null'] },
              },
            },
            suscripciones: {
              type: 'array',
              items: {
                type: 'object',
                properties: {
                  id: { type: 'string' },
                  plan_id: { type: 'string' },
                  fecha_inicio: { type: 'string', format: 'date-time' },
                  fecha_fin: { type: 'string', format: 'date-time' },
                  estado: { type: 'string' },
                  fecha_prox_cobro: { type: 'string', format: 'date-time' },
                  fecha_cancelacion: { type: ['string', 'null'], format: 'date-time' },
                  descripcion: { type: 'string' },
                  costo_mensual: { type: 'string' },
                  created_at: { type: 'string', format: 'date-time' },
                  updated_at: { type: 'string', format: 'date-time' },
                  suscripcion_modulos: {
                    type: 'array',
                    items: {
                      type: 'object',
                      properties: {
                        id: { type: 'string' },
                        suscripcion_id: { type: 'string' },
                        modulo_id: { type: 'string' },
                        tipo: { type: 'string' },
                        costo_adicional: { type: 'string' },
                        active: { type: 'boolean' },
                        created_at: { type: 'string', format: 'date-time' },
                        updated_at: { type: 'string', format: 'date-time' },
                      },
                    },
                  },
                  planes: {
                    type: 'object',
                    properties: {
                      id: { type: 'string' },
                      codigo: { type: 'string' },
                      descripcion: { type: 'string' },
                      precio: { type: 'string' },
                      periodo_prueba: { type: 'string' },
                    },
                  },
                },
              },
            },
          },
        },
      },
      total: { type: 'number' },
      page: { type: 'number' },
      limit: { type: 'number' },
      lastPage: { type: 'number' },
    },
  },
};

export const body_empresa_certificado = {
  schema: {
    type: 'object',
    properties: {
      file: { type: 'string', format: 'binary' },
      pin: { type: 'string' },
    },
    required: ['file', 'pin'],
  },
};

export const response_empresa_register = {
  description: 'Certificado validado exitosamente',
  schema: {
    type: 'object',
    properties: {
      success: { type: 'boolean', example: true },
      message: { type: 'string', example: 'Certificado validado exitósamente' },
      data: {
        type: 'object',
        properties: {
          status: { type: 'string', example: 'success' },
          message: { type: 'string', example: 'Certificado validado exitósamente' },
          data: {
            type: 'object',
            properties: {
              serialNumber: { type: 'string', example: '48a497a834bb8057' },
              titular: { type: 'string', example: 'GUILLERMO LUIS ORTIZ BENITEZ' },
            },
          },
        },
      },
    },
  },
};
