Skip to content

Commit f344238

Browse files
committed
feat(vendors): group catalog by company stage
1 parent ff5e8c7 commit f344238

17 files changed

Lines changed: 756 additions & 21 deletions

File tree

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
{
2+
"$schema": "https://json-schema.org/draft/2020-12/schema",
3+
"title": "Vendor Company Stage Configuration",
4+
"description": "Dated, sourced company-stage assignments and display order for the vendor catalog.",
5+
"type": "object",
6+
"properties": {
7+
"$schema": {
8+
"type": "string"
9+
},
10+
"asOf": {
11+
"type": "string",
12+
"format": "date"
13+
},
14+
"criteria": {
15+
"type": "object",
16+
"properties": {
17+
"publicCompanyIncludesListedParent": {
18+
"const": true
19+
},
20+
"superUnicornMinimumUsd": {
21+
"const": 10000000000
22+
},
23+
"unicornMinimumUsd": {
24+
"const": 1000000000
25+
},
26+
"startupIsDefault": {
27+
"const": true
28+
}
29+
},
30+
"required": [
31+
"publicCompanyIncludesListedParent",
32+
"superUnicornMinimumUsd",
33+
"unicornMinimumUsd",
34+
"startupIsDefault"
35+
],
36+
"additionalProperties": false
37+
},
38+
"groups": {
39+
"type": "array",
40+
"prefixItems": [
41+
{
42+
"allOf": [
43+
{ "$ref": "#/$defs/group" },
44+
{
45+
"type": "object",
46+
"properties": {
47+
"id": { "const": "public-company" },
48+
"translationKey": { "const": "publicCompany" }
49+
}
50+
}
51+
]
52+
},
53+
{
54+
"allOf": [
55+
{ "$ref": "#/$defs/group" },
56+
{
57+
"type": "object",
58+
"properties": {
59+
"id": { "const": "super-unicorn" },
60+
"translationKey": { "const": "superUnicorn" }
61+
}
62+
}
63+
]
64+
},
65+
{
66+
"allOf": [
67+
{ "$ref": "#/$defs/group" },
68+
{
69+
"type": "object",
70+
"properties": {
71+
"id": { "const": "unicorn" },
72+
"translationKey": { "const": "unicorn" }
73+
}
74+
}
75+
]
76+
},
77+
{
78+
"allOf": [
79+
{ "$ref": "#/$defs/group" },
80+
{
81+
"type": "object",
82+
"properties": {
83+
"id": { "const": "startup" },
84+
"translationKey": { "const": "startup" }
85+
}
86+
}
87+
]
88+
}
89+
],
90+
"items": false,
91+
"minItems": 4,
92+
"maxItems": 4
93+
},
94+
"assignments": {
95+
"type": "array",
96+
"items": {
97+
"$ref": "#/$defs/assignment"
98+
},
99+
"minItems": 1
100+
}
101+
},
102+
"required": ["$schema", "asOf", "criteria", "groups", "assignments"],
103+
"additionalProperties": false,
104+
"$defs": {
105+
"stage": {
106+
"type": "string",
107+
"enum": ["public-company", "super-unicorn", "unicorn", "startup"]
108+
},
109+
"group": {
110+
"type": "object",
111+
"properties": {
112+
"id": {
113+
"$ref": "#/$defs/stage"
114+
},
115+
"translationKey": {
116+
"type": "string",
117+
"enum": ["publicCompany", "superUnicorn", "unicorn", "startup"]
118+
}
119+
},
120+
"required": ["id", "translationKey"],
121+
"additionalProperties": false
122+
},
123+
"source": {
124+
"type": "object",
125+
"properties": {
126+
"url": {
127+
"type": "string",
128+
"format": "uri",
129+
"pattern": "^https://"
130+
},
131+
"title": {
132+
"type": "string",
133+
"minLength": 1
134+
}
135+
},
136+
"required": ["url", "title"],
137+
"additionalProperties": false
138+
},
139+
"assignment": {
140+
"type": "object",
141+
"properties": {
142+
"vendorId": {
143+
"type": "string",
144+
"pattern": "^[a-z0-9-]+$"
145+
},
146+
"stage": {
147+
"$ref": "#/$defs/stage"
148+
},
149+
"source": {
150+
"oneOf": [
151+
{
152+
"$ref": "#/$defs/source"
153+
},
154+
{
155+
"type": "null"
156+
}
157+
]
158+
}
159+
},
160+
"required": ["vendorId", "stage", "source"],
161+
"additionalProperties": false,
162+
"if": {
163+
"type": "object",
164+
"properties": {
165+
"stage": {
166+
"not": { "const": "startup" }
167+
}
168+
},
169+
"required": ["stage"]
170+
},
171+
"then": {
172+
"type": "object",
173+
"properties": {
174+
"source": {
175+
"$ref": "#/$defs/source"
176+
}
177+
}
178+
}
179+
}
180+
}
181+
}

0 commit comments

Comments
 (0)