{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/fieldwirelabs/json-schema/fieldwirelabs-rfi-full-schema.json",
  "title": "rfi_full",
  "description": "Entity that represents an Rfi document",
  "x-generated": "2026-12-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/fieldwirelabs-fieldwire-regional-api-openapi.yml#/components/schemas/rfi_full",
  "type": "object",
  "required": [
    "id",
    "creator_user_id",
    "last_editor_user_id",
    "project_id",
    "name",
    "created_at",
    "device_created_at",
    "device_updated_at",
    "updated_at",
    "assignee_id"
  ],
  "nullable": false,
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "nullable": false,
      "description": "ID of the entity"
    },
    "creator_user_id": {
      "type": "integer",
      "format": "int32",
      "nullable": false,
      "description": "ID of the user who created this entity"
    },
    "last_editor_user_id": {
      "type": "integer",
      "format": "int32",
      "nullable": false,
      "description": "ID of the user who most recently edited this entity"
    },
    "project_id": {
      "type": "string",
      "format": "uuid",
      "nullable": false,
      "description": "ID of the project this entity belongs to"
    },
    "name": {
      "type": "string",
      "nullable": false,
      "description": "Name of the Rfi. Must be unique between Rfis under the same parent."
    },
    "location_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "ID of the location associated with this RFI."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "nullable": false,
      "description": "Time when the server created the entity"
    },
    "deleted_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Time the server deleted the entity"
    },
    "device_created_at": {
      "type": "string",
      "format": "date-time",
      "nullable": false,
      "description": "Time when the device created the entity"
    },
    "device_updated_at": {
      "type": "string",
      "format": "date-time",
      "nullable": false,
      "description": "Time when the device last updated the entity"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "nullable": false,
      "description": "Time when the server last updated the entity"
    },
    "answer": {
      "type": [
        "string",
        "null"
      ],
      "description": "The answer to the Rfi"
    },
    "question": {
      "type": [
        "string",
        "null"
      ],
      "description": "The question of the Rfi"
    },
    "suggestion": {
      "type": [
        "string",
        "null"
      ],
      "description": "The suggestion for the question of the Rfi"
    },
    "impact_notes": {
      "type": [
        "string",
        "null"
      ],
      "description": "The impact notes of the Rfi"
    },
    "due_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "When the Rfi is due by"
    },
    "reference_number": {
      "type": [
        "string",
        "null"
      ],
      "description": "The reference number of the Rfi"
    },
    "rfi_number": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "The number extracted from consolidated number associated with the Rfi"
    },
    "consolidated_number": {
      "type": "string",
      "nullable": false,
      "description": "The consolidated number associated with the Rfi"
    },
    "assignee_id": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "The id of the user assigned to the Rfi"
    },
    "voided_by_user_id": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "The id of the user who voided the Rfi"
    },
    "voided_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Time the server voided the entity"
    },
    "rfi_assignee": {
      "$ref": "#/$defs/rfi_user"
    },
    "submitted_by_user_id": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "The id of the user submitted the Rfi"
    },
    "last_answered_by_user_id": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "The id of the user who last answered the Rfi"
    },
    "original_assignee_id": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "description": "The id of the user who was last assigned the Rfi before the Rfi was open to answering on behalf"
    },
    "original_rfi_assignee": {
      "$ref": "#/$defs/rfi_user"
    },
    "to_pm_group_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The id of the PmGroup receiving the Rfi. Only set when Rfi is submitted."
    },
    "creator_pm_group_id": {
      "type": [
        "string",
        "null"
      ],
      "format": "uuid",
      "description": "The id of the PmGroup that the Rfi creator was in when the Rfi was created"
    },
    "status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "draft",
        "submitted",
        "answered",
        "closed",
        "void",
        null
      ],
      "description": "The status of the Rfi as an enum, e.g. draft, submitted"
    },
    "previous_status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "draft",
        "open",
        "pending",
        "closed",
        "void",
        null
      ],
      "description": "The previous status of the Rfi as an enum, e.g. draft, submitted"
    },
    "mapped_status": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "draft",
        "open",
        "pending",
        "closed",
        "void",
        null
      ],
      "description": "The status of the Rfi as an enum, e.g. draft, submitted"
    },
    "impact": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "no_impact",
        "cost",
        "schedule",
        "cost_and_schedule",
        null
      ],
      "description": "The impact of the Rfi as an enum, e.g. cost, schedule, both"
    },
    "resolved_conflict": {
      "type": "boolean",
      "nullable": false,
      "description": "Specifies if PUT/PATCH request was rejected - do not store this field!"
    },
    "return_to_lead_company": {
      "type": "boolean",
      "nullable": false,
      "description": "Specifies whether a reassigned RFI is to be returned back to the lead/creator company"
    },
    "company_code": {
      "type": "string",
      "description": "Code of the PmGroup that created this Rfi",
      "nullable": false
    },
    "watchers": {
      "type": "array",
      "nullable": false,
      "description": "Array containing rfi watchers user ids",
      "items": {
        "type": "integer",
        "format": "int32"
      }
    },
    "reviewers": {
      "type": [
        "array",
        "null"
      ],
      "description": "Array containing meta data about reviewers",
      "items": {
        "type": "object",
        "description": "Reviewer meta data object",
        "required": [
          "name",
          "company",
          "responded",
          "primary_approver"
        ],
        "nullable": false,
        "properties": {
          "name": {
            "type": "string",
            "nullable": false,
            "description": "Reviewers name"
          },
          "company": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reviewers company"
          },
          "responded": {
            "type": "boolean",
            "nullable": false,
            "description": "Whether or not the reviewer has responded"
          },
          "primary_approver": {
            "type": "boolean",
            "nullable": false,
            "description": "Whether or not the reviewer is the primary approver"
          }
        },
        "additionalProperties": false
      }
    },
    "date_asked": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "When the Rfi was first asked"
    },
    "date_answered": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "When the Rfi was last answered"
    },
    "response_time": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Difference between date_asked and date_answered in days"
    },
    "rfi_plan_relations": {
      "type": "array",
      "nullable": false,
      "description": "Array containing related plan ids",
      "items": {
        "type": "object",
        "description": "Relational information between rfi and plan",
        "required": [
          "rfi_id",
          "floorplan_id",
          "sheet_id",
          "data"
        ],
        "nullable": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "ID of rfi plan relation object"
          },
          "rfi_id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "ID of related rfi"
          },
          "floorplan_id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "ID of related plan"
          },
          "sheet_id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "ID of related sheet"
          },
          "data": {
            "type": "object",
            "nullable": false,
            "description": "JSON information about relationship, such as markup placement"
          },
          "creator_user_id": {
            "type": "integer",
            "format": "int32",
            "nullable": false,
            "description": "ID of the user who created this entity"
          },
          "last_editor_user_id": {
            "type": "integer",
            "format": "int32",
            "nullable": false,
            "description": "ID of the user who most recently edited this entity"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false,
            "description": "Time when the server created the entity"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Time the server deleted the entity"
          },
          "device_created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false,
            "description": "Time when the device created the entity"
          },
          "device_updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false,
            "description": "Time when the device last updated the entity"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false,
            "description": "Time when the server last updated the entity"
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "ID of the project this entity belongs to"
          },
          "resolved_conflict": {
            "type": "boolean",
            "nullable": false,
            "description": "Specifies if PUT/PATCH request was rejected - do not store this field!"
          }
        },
        "additionalProperties": false
      }
    },
    "related_tasks": {
      "type": "array",
      "nullable": false,
      "description": "Array containing related tasks",
      "items": {
        "type": "object",
        "description": "Task object with relevant information to show a related task item",
        "required": [
          "name",
          "id",
          "number",
          "assignee",
          "bubbles",
          "checklist",
          "category",
          "status_color",
          "relation_creator_user_id"
        ],
        "nullable": false,
        "properties": {
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the task"
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "ID of related task"
          },
          "number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Number of the task"
          },
          "assignee": {
            "type": "string",
            "nullable": false,
            "description": "Initials of the assignee"
          },
          "bubbles": {
            "type": "integer",
            "format": "int32",
            "description": "Amount of bubbles attached to task"
          },
          "checklist": {
            "type": "object",
            "description": "Object containing checklist information",
            "required": [
              "checked",
              "total"
            ],
            "properties": {
              "checked": {
                "type": "integer",
                "format": "int32",
                "description": "Amount of checked items"
              },
              "total": {
                "type": "integer",
                "format": "int32",
                "description": "Total amount of checkable items"
              }
            },
            "additionalProperties": false
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "description": "Short form name of the team of the task"
          },
          "status_color": {
            "type": [
              "string",
              "null"
            ],
            "description": "Color of the task status"
          },
          "relation_creator_user_id": {
            "type": "integer",
            "format": "int32",
            "nullable": false,
            "description": "ID of user that created the relationship"
          }
        },
        "additionalProperties": false
      }
    },
    "related_rfis": {
      "type": "array",
      "nullable": false,
      "description": "Array containing related rfis",
      "items": {
        "type": "object",
        "nullable": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "ID of the entity"
          },
          "name": {
            "type": "string",
            "nullable": false,
            "description": "Name of the Rfi. Must be unique between Rfis under the same parent."
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "draft",
              "submitted",
              "answered",
              "closed",
              "void",
              null
            ],
            "description": "The status of the Rfi as an enum, e.g. draft, submitted"
          },
          "company_code": {
            "type": "string",
            "description": "Code of the PmGroup that created this Rfi",
            "nullable": false
          },
          "number": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "The number associated with the Rfi"
          }
        },
        "additionalProperties": false
      }
    },
    "attachments": {
      "type": "array",
      "nullable": false,
      "description": "Array containing attachment objects",
      "items": {
        "type": "object",
        "description": "Entity that encapsulates an attachment on an RFI.",
        "required": [
          "id",
          "creator_user_id",
          "project_id",
          "kind",
          "attached_to",
          "rfi_id",
          "created_at",
          "device_created_at",
          "resolved_conflict",
          "device_updated_at",
          "updated_at"
        ],
        "nullable": false,
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "ID of the RFI Attachment object."
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the file if there is one."
          },
          "creator_user_id": {
            "type": "integer",
            "format": "int32",
            "nullable": false,
            "description": "ID of the user who created this entity"
          },
          "last_editor_user_id": {
            "type": "integer",
            "format": "int32",
            "nullable": false,
            "description": "ID of the user who last interacted modified this entity"
          },
          "project_id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "ID of the project this entity belongs to"
          },
          "rfi_id": {
            "type": "string",
            "format": "uuid",
            "nullable": false,
            "description": "The RFI on which these attachments will exist."
          },
          "rfi_response_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The RFI response on which these attachments will exist."
          },
          "attached_to": {
            "type": "string",
            "enum": [
              "question",
              "answer"
            ],
            "nullable": false,
            "description": "Where under the RFI this attachment was added: question, or answer."
          },
          "kind": {
            "type": "string",
            "enum": [
              "new_file",
              "existing_file",
              "over_limit_file",
              "cropped_plan",
              "new_photo",
              "existing_photo"
            ],
            "nullable": false,
            "description": "Allowable kinds of RFI Attachments."
          },
          "fw_object_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The ID of the FW object which this RFIAttachment comes from."
          },
          "original_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL of the file originally uploaded by the user"
          },
          "file_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL of the potentially processed file"
          },
          "thumb_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "Thumb URL of the file if there is one"
          },
          "file_size": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int32",
            "description": "Size of file if there is one"
          },
          "captured_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Time when a photo attachment was taken"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false,
            "description": "Time when the server created the entity"
          },
          "device_created_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false,
            "description": "Time when the device created the entity"
          },
          "resolved_conflict": {
            "type": [
              "boolean",
              "null"
            ],
            "description": "Specifies if PUT/PATCH request was rejected - do not store this field!"
          },
          "device_updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false,
            "description": "Time when the device last updated the entity"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "nullable": false,
            "description": "Time when the server last updated the entity"
          },
          "deleted_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Time the server deleted the entity"
          },
          "flattened_file_url": {
            "type": [
              "string",
              "null"
            ],
            "description": "URL of the file that has the markups flattened too"
          }
        },
        "additionalProperties": false
      }
    },
    "closed_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Time the server last closed the entity"
    },
    "closed_by": {
      "allOf": [
        {
          "$ref": "#/$defs/rfi_user"
        }
      ]
    },
    "voided_by": {
      "allOf": [
        {
          "$ref": "#/$defs/rfi_user"
        }
      ]
    }
  },
  "additionalProperties": false,
  "$defs": {
    "rfi_user": {
      "type": [
        "object",
        "null"
      ],
      "description": "Entity that represents a RfiUser document",
      "required": [
        "id",
        "project_id",
        "rfi_id",
        "creator_user_id",
        "last_editor_user_id",
        "created_at",
        "updated_at"
      ],
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "nullable": false,
          "description": "ID of the entity"
        },
        "project_id": {
          "type": "string",
          "format": "uuid",
          "nullable": false,
          "description": "ID of the project this entity belongs to"
        },
        "rfi_id": {
          "type": "string",
          "format": "uuid",
          "nullable": false,
          "description": "ID of the Rfi this entity belongs to"
        },
        "project_userable_id": {
          "type": "integer",
          "format": "int32",
          "nullable": false,
          "description": "ID of the ProjectUser if user kind, ExternalProjectUser if non-user kind."
        },
        "project_userable_type": {
          "type": "string",
          "nullable": false,
          "description": "ProjectUser or ExternalProjectUser, i.e non-user or user kind"
        },
        "user_id": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "ID of the User. Belongs to User entity."
        },
        "is_assignee": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "indication for whether this RfiUser is an assignee on the Rfi"
        },
        "is_watcher": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "indication for whether this RfiUser is a watcher on the Rfi"
        },
        "is_reviewer": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "indication for whether this RfiUser is a reviewer on the Rfi"
        },
        "kind": {
          "type": "string",
          "nullable": false,
          "description": "kind of user"
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "description": "users email, if non_user"
        },
        "language": {
          "type": [
            "string",
            "null"
          ],
          "description": "users language, if non_user"
        },
        "user": {
          "type": [
            "object",
            "null"
          ],
          "description": "the associated project-user attributes",
          "properties": {
            "user_id": {
              "type": "integer",
              "format": "int32",
              "nullable": false,
              "description": "ID of the User. Belongs to User entity."
            },
            "full_name": {
              "type": "string",
              "nullable": false,
              "description": "User full name: first name + last name."
            },
            "project_id": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid",
              "description": "The ID of the Project that project user belongs to. PmGroup information is scoped to this project."
            },
            "role": {
              "type": "string",
              "enum": [
                "admin",
                "member",
                "follower"
              ],
              "nullable": false,
              "description": "role that the project-user holds in this project"
            },
            "pm_group_id": {
              "type": [
                "string",
                "null"
              ],
              "format": "uuid",
              "description": "The id of the PmGroup that user belongs to within a project."
            },
            "pm_group_name": {
              "type": [
                "string",
                "null"
              ],
              "description": "The name of the PmGroup that user belongs to within a project."
            },
            "pm_role": {
              "type": [
                "string",
                "null"
              ],
              "enum": [
                "contributor",
                "manager",
                null
              ],
              "description": "project management role that the project-user holds in this project"
            }
          },
          "additionalProperties": false
        },
        "device_created_at": {
          "type": "string",
          "format": "date-time",
          "nullable": false,
          "description": "Time when the device created the entity"
        },
        "device_updated_at": {
          "type": "string",
          "format": "date-time",
          "nullable": false,
          "description": "Time when the device last updated the entity"
        },
        "deleted_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "Time the server deleted the entity"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "nullable": false,
          "description": "Time when the server created the entity"
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "nullable": false,
          "description": "Time when the server last updated the entity"
        },
        "creator_user_id": {
          "type": "integer",
          "format": "int32",
          "nullable": false,
          "description": "ID of the user who created this entity"
        },
        "last_editor_user_id": {
          "type": "integer",
          "format": "int32",
          "nullable": false,
          "description": "ID of the user who most recently edited this entity"
        },
        "resolved_conflict": {
          "type": "boolean",
          "nullable": false,
          "description": "Specifies if PUT/PATCH request was rejected - do not store this field!"
        }
      },
      "additionalProperties": false
    }
  }
}