json icon

Franchise Partner Added

v1.2.0events

A person became a partner of a franchise unit, with their roles and whether they are a primary contact of the unit. One message per partner. Consumed by cna-nexus to invalidate the economic group statistics cache and by cna-one to give the partner access to the franchise.

1{
2  "$schema": "https://json-schema.org/draft/2020-12/schema",
3  "title": "FranchisePartnerAdded payload",
4  "type": "object",
5  "additionalProperties": false,
6  "properties": {
7    "franchiseId": {
8      "type": "string",
9      "description": "Franchise id (UUID). Kafka message key."
10    },
11    "roles": {
12      "type": "array",
13      "items": {
14        "type": "string",
15        "enum": ["FRANCHISEE", "OPERATING_PARTNER"]
16      },
17      "description": "Roles of the partner in this unit (FranchisePartnerRole). Never empty."
18    },
19    "isPrimaryContact": {
20      "type": "boolean",
21      "description": "Whether the partner is a primary contact of this franchise for the franchisor team. Belongs to the link with this franchise, not to the person. Set by hand in cna-nexus: false for a partner added by a contract or a legal info edit; a reverted removal brings back the flag the partner had."
22    },
23    "person": {
24      "type": "object",
25      "additionalProperties": false,
26      "description": "Snapshot of the person (common.persons).",
27      "properties": {
28        "id": {
29          "type": "string",
30          "description": "Person id (UUID)."
31        },
32        "document": {
33          "type": "string",
34          "description": "Person document; format depends on documentType."
35        },
36        "documentType": {
37          "type": "string",
38          "enum": ["CPF", "CNPJ", "RNM"],
39          "description": "Document type (PersonsDocumentType)."
40        },
41        "name": {
42          "type": "string",
43          "description": "Person name."
44        },
45        "email": {
46          "type": ["string", "null"],
47          "description": "E-mail, or null."
48        },
49        "phone": {
50          "type": ["string", "null"],
51          "description": "Phone, or null."
52        },
53        "birthDate": {
54          "type": ["string", "null"],
55          "format": "date",
56          "description": "Birth date as a calendar day, YYYY-MM-DD, no time zone. Null when unknown."
57        },
58        "legalName": {
59          "type": ["string", "null"],
60          "description": "Legal name, for companies."
61        },
62        "isFranchisee": {
63          "type": "boolean",
64          "description": "Whether the person holds the FRANCHISEE role in at least one franchise (any unit, not only this one). Derived, not stored."
65        }
66      },
67      "required": ["id", "document", "documentType", "name", "isFranchisee"]
68    }
69  },
70  "required": ["franchiseId", "roles", "isPrimaryContact", "person"]
71}
72

Details

Format
JSON Schema
Resource
events
Filename
schema.json

Versions