Skip to content

Instantly share code, notes, and snippets.

@JulienHe
Created August 5, 2022 00:38
Show Gist options
  • Save JulienHe/8db6e18e6e8cd864cf8c22d8ee12aa2e to your computer and use it in GitHub Desktop.
Save JulienHe/8db6e18e6e8cd864cf8c22d8ee12aa2e to your computer and use it in GitHub Desktop.
Snacks schema
{
"kind": "collectionType",
"collectionName": "snacks",
"info": {
"singularName": "snack",
"pluralName": "snacks",
"displayName": "Snack",
"description": ""
},
"options": {
"draftAndPublish": true
},
"pluginOptions": {
"i18n": {
"localized": true
}
},
"attributes": {
"Name": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string",
"required": true
},
"Country": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "enumeration",
"enum": [
"JP",
"BE",
"CA",
"KR",
"US",
"AF",
"AX",
"AL",
"DZ",
"AS",
"AD",
"AO",
"AI",
"AQ",
"AG",
"AR",
"AM",
"AW",
"AU",
"AT",
"AZ",
"BS",
"BH",
"BD",
"BB",
"BY",
"BZ",
"BJ",
"BM",
"BT",
"BO",
"BQ",
"BA",
"BW",
"BV",
"BR",
"IO",
"BN",
"BG",
"BF",
"BI",
"KH",
"CM",
"CV",
"KY",
"CF",
"TD",
"CL",
"CN",
"CX",
"CC",
"CO",
"KM",
"CG",
"CD",
"CK",
"CR",
"CI",
"HR",
"CU",
"CW",
"CY",
"CZ",
"DK",
"DJ",
"DM",
"DO",
"EC",
"EG",
"SV",
"GQ",
"ER",
"EE",
"ET",
"FK",
"FO",
"FJ",
"FI",
"FR",
"GF",
"PF",
"TF",
"GA",
"GM",
"GE",
"DE",
"GH",
"GI",
"GR",
"GL",
"GD",
"GP",
"GU",
"GT",
"GG",
"GN",
"GW",
"GY",
"HT",
"HM",
"VA",
"HN",
"HK",
"HU",
"IS",
"IN",
"ID",
"IR",
"IQ",
"IE",
"IM",
"IL",
"IT",
"JM",
"JE",
"JO",
"KZ",
"KE",
"KI",
"KP",
"XK",
"KW",
"KG",
"LA",
"LV",
"LB",
"LS",
"LR",
"LY",
"LI",
"LT",
"LU",
"MO",
"MK",
"MG",
"MW",
"MY",
"MV",
"ML",
"MT",
"MH",
"MQ",
"MR",
"MU",
"YT",
"MX",
"FM",
"MD",
"MC",
"MN",
"ME",
"MA",
"MS",
"MZ",
"MM",
"NA",
"NR",
"NP",
"NL",
"AN",
"NC",
"NZ",
"NI",
"NE",
"NG",
"NU",
"NF",
"MP",
"NO",
"OM",
"PK",
"PW",
"PS",
"PA",
"PG",
"PY",
"PE",
"PH",
"PN",
"PL",
"PT",
"PR",
"QA",
"RE",
"RO",
"RU",
"RW",
"BL",
"SH",
"KN",
"LC",
"MF",
"PM",
"VC",
"WS",
"SM",
"ST",
"SA",
"SN",
"RS",
"CS",
"SC",
"SL",
"SG",
"SX",
"SK",
"SI",
"SB",
"SO",
"ZA",
"GS",
"SS",
"ES",
"LK",
"SD",
"SR",
"SJ",
"SW",
"SE",
"CH",
"SY",
"TW",
"TJ",
"TZ",
"TH",
"TL",
"TG",
"TK",
"TO",
"TT",
"TN",
"TR",
"TM",
"TC",
"TV",
"UG",
"UA",
"AE",
"GB",
"UM",
"UY",
"UZ",
"VU",
"VE",
"VN",
"VG",
"VI",
"WF",
"EH",
"YE",
"ZM",
"ZW"
]
},
"Buy_it_again": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "enumeration",
"enum": [
"Yes",
"No",
"Maybe"
],
"required": true
},
"Serving_weight": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "decimal"
},
"Calories": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "integer"
},
"Flavour": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string"
},
"Snack_of_the_week": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "boolean",
"default": false,
"required": true
},
"Review": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "richtext",
"required": true
},
"Price": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "decimal"
},
"Score": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "decimal"
},
"Where_to_buy": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string",
"regex": "^(http://www.|https://www.|http://|https://)?[a-z0-9]+([-.]{1}[a-z0-9]+)*.[a-z]{2,5}(:[0-9]{1,5})?(/.*)?$"
},
"Cover": {
"type": "media",
"multiple": false,
"required": false,
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"pluginOptions": {
"i18n": {
"localized": true
}
}
},
"Images": {
"type": "media",
"multiple": true,
"required": false,
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"pluginOptions": {
"i18n": {
"localized": true
}
}
},
"Slug": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string",
"required": true,
"unique": true
},
"snack_types": {
"type": "relation",
"relation": "oneToMany",
"target": "api::snack-type.snack-type"
},
"Serving_size": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string",
"required": false,
"default": " "
},
"Brand": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string"
},
"publish_at": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "date"
},
"instagram_post": {
"pluginOptions": {
"i18n": {
"localized": true
}
},
"type": "string"
},
"whatsapp_cover": {
"allowedTypes": [
"images",
"files",
"videos",
"audios"
],
"type": "media",
"multiple": false,
"pluginOptions": {
"i18n": {
"localized": true
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment