json icon

Franchise Address Updated

v1.0.0events

The address of a franchise unit changed in CNA Nexus. The address block of the franchise snapshot plus the franchise id. Published by cna-nexus, consumed by cna-one to mirror the change.

1{
2  "$schema": "https://json-schema.org/draft/2020-12/schema",
3  "title": "FranchiseAddressUpdated payload",
4  "type": "object",
5  "additionalProperties": false,
6  "properties": {
7    "franchiseId": {
8      "type": "string",
9      "description": "Franchise id (UUID). Kafka message key; cna-one upserts the address of the unit it mirrors under this id and, when the unit is not mirrored yet (no CNPJ), logs a warning and drops the message."
10    },
11    "street": {
12      "type": ["string", "null"],
13      "description": "Street. cna-one requires it (streetAddress)."
14    },
15    "number": {
16      "type": ["string", "null"],
17      "description": "Number. cna-one requires it."
18    },
19    "complement": {
20      "type": ["string", "null"],
21      "description": "Complement. Mirrored by cna-one as additionalAddress."
22    },
23    "neighborhood": {
24      "type": ["string", "null"],
25      "description": "Neighborhood. cna-one requires it (district)."
26    },
27    "postalCode": {
28      "type": ["string", "null"],
29      "description": "Postal code as stored; cna-one requires it and strips it to 8 digits."
30    },
31    "cityId": {
32      "type": ["integer", "null"],
33      "description": "IBGE city code (common.cities.id). cna-one requires it and the city must exist there. Null for an address outside Brazil."
34    },
35    "cityName": {
36      "type": ["string", "null"],
37      "description": "City name. Null for an address outside Brazil. Ignored by cna-one."
38    },
39    "state": {
40      "type": ["string", "null"],
41      "description": "State code (UF). Null for an address outside Brazil. Ignored by cna-one."
42    },
43    "countryId": {
44      "type": "string",
45      "description": "Country as an ISO 3166-1 alpha-2 code (BR for Brazil). Always present. Ignored by cna-one."
46    },
47    "foreignCity": {
48      "type": ["string", "null"],
49      "description": "Free-text city name for an address outside Brazil; null for a Brazilian address. Ignored by cna-one."
50    },
51    "foreignState": {
52      "type": ["string", "null"],
53      "description": "Free-text state or province name for an address outside Brazil; null for a Brazilian address. Ignored by cna-one."
54    },
55    "latitude": {
56      "type": ["string", "null"],
57      "description": "Latitude in WGS84 as decimal text (ST_Y over the location point), or null when the address has no coordinates. cna-one stores latitude and longitude as one PostGIS point; a pair with one side missing, unreadable or off the globe is logged and the address is stored without a point."
58    },
59    "longitude": {
60      "type": ["string", "null"],
61      "description": "Longitude in WGS84 as decimal text (ST_X over the location point), or null when the address has no coordinates. cna-one stores latitude and longitude as one PostGIS point; a pair with one side missing, unreadable or off the globe is logged and the address is stored without a point."
62    }
63  },
64  "required": ["franchiseId", "countryId"]
65}
66

Details

Format
JSON Schema
Resource
events
Filename
schema.json

Versions