{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/brm-chronographes-com/json-schema/brm-chronographes-com-nouveau-code-schema.json",
  "title": "NouveauCode",
  "description": "Un code de réduction tel que la direction le décide. Rien n'a de défaut\nfinancier : un code vaut ce que l'administrateur y met, et pas un centime de\nplus. Aucun code n'existe au départ — c'est voulu.",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/brm-chronographes-com-openapi.json#/components/schemas/NouveauCode",
  "properties": {
    "code": {
      "type": "string",
      "title": "Code"
    },
    "libelle": {
      "type": "string",
      "title": "Libelle",
      "default": ""
    },
    "type": {
      "type": "string",
      "title": "Type",
      "default": "montant"
    },
    "valeur": {
      "type": "number",
      "title": "Valeur"
    },
    "devise": {
      "type": "string",
      "title": "Devise",
      "default": "EUR"
    },
    "plafond": {
      "anyOf": [
        {
          "type": "number"
        },
        {
          "type": "null"
        }
      ],
      "title": "Plafond"
    },
    "minimum": {
      "type": "number",
      "title": "Minimum",
      "default": 0
    },
    "debut": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Debut"
    },
    "fin": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Fin"
    },
    "usages_max": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Usages Max"
    },
    "usages_par_client": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Usages Par Client"
    },
    "unique_par_client": {
      "type": "boolean",
      "title": "Unique Par Client",
      "default": true
    },
    "cumulable": {
      "type": "boolean",
      "title": "Cumulable",
      "default": false
    },
    "client_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Client Id"
    },
    "email_cible": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Email Cible"
    },
    "ps_ids": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Ps Ids"
    },
    "categories": {
      "anyOf": [
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Categories"
    },
    "actif": {
      "type": "boolean",
      "title": "Actif",
      "default": true
    },
    "port_offert": {
      "type": "boolean",
      "title": "Port Offert",
      "default": false
    },
    "cadeau_ps_id": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cadeau Ps Id"
    },
    "cadeau_qte": {
      "type": "integer",
      "title": "Cadeau Qte",
      "default": 1
    },
    "cadeau_libelle": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cadeau Libelle"
    },
    "cadeau_declinaison": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cadeau Declinaison"
    },
    "cadeau_variante": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cadeau Variante"
    },
    "pays": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pays"
    },
    "visiteur_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Visiteur Id"
    }
  },
  "type": "object",
  "required": [
    "code",
    "valeur"
  ]
}