{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/upgrowth-dz/json-schema/upgrowth-dz-jo-act-schema.json",
  "title": "JoAct",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/upgrowth-dz-openapi.yml#/components/schemas/JoAct",
  "type": "object",
  "required": [
    "year",
    "issue",
    "ord",
    "type",
    "title",
    "named_in_titles"
  ],
  "properties": {
    "year": {
      "type": "integer",
      "description": "The year of the issue."
    },
    "issue": {
      "type": "integer",
      "description": "The number of the issue within its year."
    },
    "ord": {
      "type": "integer",
      "description": "The place of the act in the issue."
    },
    "type": {
      "type": "string",
      "description": "The kind of act as the Journal officiel prints it."
    },
    "number": {
      "type": [
        "string",
        "null"
      ],
      "description": "Its number, when it has one."
    },
    "title": {
      "type": "string",
      "description": "Its official title."
    },
    "page": {
      "type": [
        "integer",
        "null"
      ],
      "description": "The page of the issue where it starts."
    },
    "part": {
      "type": "integer",
      "description": "The part of the text returned, from 1."
    },
    "parts": {
      "type": "integer",
      "description": "How many parts of 20,000 characters the text has."
    },
    "chars": {
      "type": "integer",
      "description": "The length of the whole text, in characters."
    },
    "text": {
      "type": "string",
      "description": "This part of the text, as published."
    },
    "article": {
      "type": "string",
      "description": "With the article parameter: the article found, for example 87 bis (part, parts and text are then absent)."
    },
    "article_text": {
      "type": "string",
      "description": "With the article parameter: that article as printed in the issue, not consolidated."
    },
    "url": {
      "type": "string",
      "description": "The page of the issue on upgrowth.dz.",
      "format": "uri"
    },
    "pdf_url": {
      "type": [
        "string",
        "null"
      ],
      "description": "The official PDF of the issue (joradp.dz)."
    },
    "named_in_titles": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer"
          },
          "issue": {
            "type": "integer"
          },
          "ord": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "page": {
            "type": [
              "integer",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "pdf_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "relation": {
            "type": "string",
            "enum": [
              "amends",
              "completes",
              "repeals",
              "applies",
              "approves",
              "corrects",
              "cites"
            ],
            "description": "What its title says it does to this act: the last phrase before the citation (modifiant, complétant, abrogeant, application, portant approbation, Rectificatif), else cites."
          }
        }
      }
    },
    "named_in_titles_total": {
      "type": "integer",
      "description": "How many acts name this one in their title; named_in_titles holds the newest 50 of them, oldest first."
    },
    "named_in_titles_truncated": {
      "type": "boolean",
      "description": "True when named_in_titles_total is above 50, so older acts are not listed."
    },
    "relations": {
      "type": "object",
      "required": [
        "amends",
        "completes",
        "repeals",
        "applies",
        "approves",
        "corrects",
        "cites"
      ],
      "properties": {
        "amends": {
          "type": "integer"
        },
        "completes": {
          "type": "integer"
        },
        "repeals": {
          "type": "integer"
        },
        "applies": {
          "type": "integer"
        },
        "approves": {
          "type": "integer"
        },
        "corrects": {
          "type": "integer"
        },
        "cites": {
          "type": "integer"
        }
      }
    },
    "repealed_by": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "year": {
            "type": "integer"
          },
          "issue": {
            "type": "integer"
          },
          "ord": {
            "type": "integer"
          },
          "type": {
            "type": "string"
          },
          "number": {
            "type": [
              "string",
              "null"
            ]
          },
          "title": {
            "type": "string"
          },
          "page": {
            "type": [
              "integer",
              "null"
            ]
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "pdf_url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "last_amended_by": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "year": {
              "type": "integer"
            },
            "issue": {
              "type": "integer"
            },
            "ord": {
              "type": "integer"
            },
            "type": {
              "type": "string"
            },
            "number": {
              "type": [
                "string",
                "null"
              ]
            },
            "title": {
              "type": "string"
            },
            "page": {
              "type": [
                "integer",
                "null"
              ]
            },
            "url": {
              "type": "string",
              "format": "uri"
            },
            "pdf_url": {
              "type": [
                "string",
                "null"
              ]
            }
          }
        },
        {
          "type": "null"
        }
      ],
      "description": "The newest listed act whose title amends or completes this one, or null. What the titles say, not that this act is in force."
    },
    "relation_basis": {
      "type": "string",
      "enum": [
        "title"
      ],
      "description": "Every relation is read from the titles, never from the state of the law."
    },
    "amends": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "relation": {
            "type": "string",
            "enum": [
              "amends",
              "completes",
              "repeals"
            ],
            "description": "What this act's title says it does to that act."
          },
          "year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "issue": {
            "type": [
              "integer",
              "null"
            ]
          },
          "ord": {
            "type": [
              "integer",
              "null"
            ]
          },
          "type": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "title": {
            "type": [
              "string",
              "null"
            ]
          },
          "page": {
            "type": [
              "integer",
              "null"
            ]
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "pdf_url": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      }
    },
    "status_hint": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "repealed_by_later_act",
        "amended",
        null
      ],
      "description": "From the titles in named_in_titles only, not a legal opinion: repealed_by_later_act when one repeals this act, amended when one modifies or completes it, else null."
    }
  }
}