---
name: job
lang: go
domain: infra
version: "1.0.0"
algebraic: product
definition: |
  type Job struct {
      ID          string
      Type        string
      Payload     string
      Status      JobStatus
      Priority    int
      Attempts    int
      MaxAttempts int
      ScheduledAt time.Time
      StartedAt   *time.Time
      CompletedAt *time.Time
      Result      *string
      Error       *string
      CreatedAt   time.Time
  }
description: "Unidad de trabajo asincrono almacenada en SQLite. Payload es un JSON string. Status evoluciona de pending a running y luego a completed, failed o dead."
tags: [job, queue, async, background, sqlite, infra]
uses_types: [job_status_go_infra]
file_path: "functions/infra/job_queue_types.go"
---

## Notas

Tipo producto. Los campos `StartedAt`, `CompletedAt`, `Result` y `Error` son punteros — son nil hasta que el job alcanza el estado correspondiente. `Payload` es siempre un JSON string (minimo "{}").
