json icon

Franchise Partner Updated

v1.2.0events

The roles or the primary contact flag of a franchise partner changed. Carries both before and after. Consumed by cna-nexus to invalidate the economic group statistics cache and by cna-one to update the partner's access.

1{
2  "$schema": "https://json-schema.org/draft/2020-12/schema",
3  "title": "FranchisePartnerUpdated 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 after the change (FranchisePartnerRole). Never empty."
18    },
19    "previousRoles": {
20      "type": "array",
21      "items": {
22        "type": "string",
23        "enum": ["FRANCHISEE", "OPERATING_PARTNER"]
24      },
25      "description": "Roles before the change."
26    },
27    "isPrimaryContact": {
28      "type": "boolean",
29      "description": "Whether the partner is a primary contact of this franchise for the franchisor team after the change. Belongs to the link with this franchise, not to the person."
30    },
31    "previousIsPrimaryContact": {
32      "type": "boolean",
33      "description": "Primary contact flag before the change. Differs from isPrimaryContact when the flag changed; equal when only the roles changed."
34    },
35    "person": {
36      "type": "object",
37      "additionalProperties": false,
38      "description": "Snapshot of the person (common.persons).",
39      "properties": {
40        "id": {
41          "type": "string",
42          "description": "Person id (UUID)."
43        },
44        "document": {
45          "type": "string",
46          "description": "Person document; format depends on documentType."
47        },
48        "documentType": {
49          "type": "string",
50          "enum": ["CPF", "CNPJ", "RNM"],
51          "description": "Document type (PersonsDocumentType)."
52        },
53        "name": {
54          "type": "string",
55          "description": "Person name."
56        },
57        "email": {
58          "type": ["string", "null"],
59          "description": "E-mail, or null."
60        },
61        "phone": {
62          "type": ["string", "null"],
63          "description": "Phone, or null."
64        },
65        "birthDate": {
66          "type": ["string", "null"],
67          "format": "date",
68          "description": "Birth date as a calendar day, YYYY-MM-DD, no time zone. Null when unknown."
69        },
70        "legalName": {
71          "type": ["string", "null"],
72          "description": "Legal name, for companies."
73        },
74        "isFranchisee": {
75          "type": "boolean",
76          "description": "Whether the person holds the FRANCHISEE role in at least one franchise (any unit, not only this one). Derived, not stored."
77        }
78      },
79      "required": ["id", "document", "documentType", "name", "isFranchisee"]
80    }
81  },
82  "required": [
83    "franchiseId",
84    "roles",
85    "previousRoles",
86    "isPrimaryContact",
87    "previousIsPrimaryContact",
88    "person"
89  ]
90}
91

Details

Format
JSON Schema
Resource
events
Filename
schema.json

Versions