Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Affichage Identifiant Unité Enquêtée sur toutes les pages #81

Open
AnneHuSKa opened this issue Jun 13, 2024 · 1 comment
Open

Affichage Identifiant Unité Enquêtée sur toutes les pages #81

AnneHuSKa opened this issue Jun 13, 2024 · 1 comment

Comments

@AnneHuSKa
Copy link
Contributor

Affichage de l'identifiant, du type, voire de la raison sociale de l'unité enquêtée
Exemple : entreprise, groupe, établissement // 123456789 // Sanzo
image

A coordonner avec format échantillon.

Stand-by

@ddecrulle
Copy link
Contributor

ddecrulle commented Jul 9, 2024

Cette issue dépend d'un sujet plus profond, les métadonnées reçues par stromae.

Ce sujet doit être porté par les métiers Concevoir x Collecter.

Une modélisation intéressante pour stromae serait que l'endpoint api/survey-unit/{id}/metadata de l'API Queen Back Office renvoie un objet au format suivant :

type Content = {
  type: 'paragraph' | 'list'
  textItems: string[]
}
type Metadata = {
  context: 'household' | 'business' //ok
  label: string // ok
  logos?: {
    main: {
      label: string
      url: string
    }
    secondaries?: {
      label: string
      url: string
    }[]
  } //ok
  objectives: string //ok
  campaignInfo: { title?: string; contentBlocks: Content[] }[] //Not implemented yet and not planed
  surveyUnitInfo: { title?: string; contentBlocks: Content[] }[] //Not implemented yet and not planed
  surveyUnitIdentifier: string //Not implemented yet and not planed
}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "Content": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": ["paragraph", "list"]
        },
        "textItems": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": ["type", "textItems"]
    },
    "Logos": {
      "type": "object",
      "properties": {
        "main": {
          "type": "object",
          "properties": {
            "label": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            }
          },
          "required": ["label", "url"]
        },
        "secondaries": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            },
            "required": ["label", "url"]
          }
        }
      },
      "required": ["main"]
    }
  },
  "type": "object",
  "properties": {
    "context": {
      "type": "string",
      "enum": ["household", "business"]
    },
    "label": {
      "type": "string"
    },
    "logos": {
      "$ref": "#/definitions/Logos"
    },
    "objectives": {
      "type": "string"
    },
    "campaignInfo": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "contentBlocks": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/Content"
            }
          }
        },
        "required": ["contentBlocks"]
      }
    },
    "surveyUnitInfo": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "contentBlocks": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/Content"
            }
          }
        },
        "required": ["contentBlocks"]
      }
    },
    "surveyUnitIdentifier": {
      "type": "string"
    }
  },
  "required": ["context", "label", "objectives"]
}

Ce schéma décrit la structure des métadonnées que l’API devrait renvoyer et permet de valider les données pour s’assurer qu’elles respectent ce format.

@AnneHuSKa AnneHuSKa added the mvp label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants