Initialize catalog structure and product schema
This commit is contained in:
45
README.md
Normal file
45
README.md
Normal file
@@ -0,0 +1,45 @@
|
||||
# RoundCount Catalog
|
||||
|
||||
RoundCount Catalog is a machine-readable ammunition product database for the RoundCount inventory system.
|
||||
|
||||
The catalog stores reusable product information such as:
|
||||
|
||||
- UPC
|
||||
- Manufacturer SKU
|
||||
- Manufacturer
|
||||
- Brand
|
||||
- Product name
|
||||
- Caliber
|
||||
- Bullet weight and type
|
||||
- Case material
|
||||
- Package quantity
|
||||
- Ballistic information
|
||||
- Product images
|
||||
- Source and verification information
|
||||
|
||||
Personal inventory information such as quantities, purchase prices, storage locations, and lot numbers does not belong in this repository.
|
||||
|
||||
## Repository Structure
|
||||
|
||||
```text
|
||||
schema/
|
||||
JSON schemas used to validate catalog records
|
||||
|
||||
catalog/
|
||||
Individual ammunition product records
|
||||
|
||||
images/
|
||||
Product images organized by manufacturer
|
||||
|
||||
indexes/
|
||||
Generated UPC, SKU, and manufacturer indexes
|
||||
|
||||
exports/
|
||||
Generated combined catalog downloads
|
||||
|
||||
docs/
|
||||
Catalog documentation and contribution guides
|
||||
|
||||
tools/
|
||||
Validation, indexing, and export scripts
|
||||
EFO
|
||||
0
catalog/.gitkeep
Normal file
0
catalog/.gitkeep
Normal file
33
docs/field-reference.md
Normal file
33
docs/field-reference.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Catalog Field Reference
|
||||
|
||||
## Required Fields
|
||||
|
||||
### `catalog_version`
|
||||
|
||||
Catalog record format version.
|
||||
|
||||
Current value:
|
||||
|
||||
```json
|
||||
1
|
||||
|
||||
Create a `.gitignore`:
|
||||
|
||||
```bash
|
||||
cat > .gitignore <<'EOF'
|
||||
# Generated exports
|
||||
/exports/*
|
||||
!/exports/.gitkeep
|
||||
|
||||
# Generated indexes
|
||||
/indexes/*
|
||||
!/indexes/.gitkeep
|
||||
|
||||
# Local and temporary files
|
||||
*.tmp
|
||||
*.bak
|
||||
*.log
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.vscode/
|
||||
.idea/
|
||||
0
exports/.gitkeep
Normal file
0
exports/.gitkeep
Normal file
0
images/.gitkeep
Normal file
0
images/.gitkeep
Normal file
0
indexes/.gitkeep
Normal file
0
indexes/.gitkeep
Normal file
243
schema/product.schema.json
Normal file
243
schema/product.schema.json
Normal file
@@ -0,0 +1,243 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://git.ddr4.net/dragon757/RoundCount-Catalog/raw/branch/main/schema/product.schema.json",
|
||||
"title": "RoundCount Ammunition Product",
|
||||
"description": "Schema for an ammunition product in the RoundCount Catalog.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"catalog_version",
|
||||
"record_uuid",
|
||||
"manufacturer",
|
||||
"product_name",
|
||||
"caliber",
|
||||
"status",
|
||||
"last_updated"
|
||||
],
|
||||
"properties": {
|
||||
"catalog_version": {
|
||||
"type": "integer",
|
||||
"const": 1
|
||||
},
|
||||
"record_uuid": {
|
||||
"type": "string",
|
||||
"format": "uuid"
|
||||
},
|
||||
"upc": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"pattern": "^[0-9]{8,14}$"
|
||||
},
|
||||
"sku": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"maxLength": 100
|
||||
},
|
||||
"manufacturer": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 150
|
||||
},
|
||||
"brand": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"maxLength": 150
|
||||
},
|
||||
"product_name": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 200
|
||||
},
|
||||
"caliber": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 100
|
||||
},
|
||||
"bullet": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"weight_gr": {
|
||||
"type": [
|
||||
"number",
|
||||
"null"
|
||||
],
|
||||
"minimum": 0
|
||||
},
|
||||
"type": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"maxLength": 100
|
||||
},
|
||||
"material": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"maxLength": 100
|
||||
}
|
||||
}
|
||||
},
|
||||
"case": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"material": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"maxLength": 100
|
||||
},
|
||||
"reloadable": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"primer": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"type": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"maxLength": 100
|
||||
},
|
||||
"sealed": {
|
||||
"type": [
|
||||
"boolean",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"package": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"rounds_per_box": {
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
],
|
||||
"minimum": 1
|
||||
},
|
||||
"boxes_per_case": {
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
],
|
||||
"minimum": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"ballistics": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"muzzle_velocity_fps": {
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
],
|
||||
"minimum": 0
|
||||
},
|
||||
"muzzle_energy_ft_lbs": {
|
||||
"type": [
|
||||
"integer",
|
||||
"null"
|
||||
],
|
||||
"minimum": 0
|
||||
},
|
||||
"test_barrel_length_in": {
|
||||
"type": [
|
||||
"number",
|
||||
"null"
|
||||
],
|
||||
"minimum": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
"image": {
|
||||
"type": [
|
||||
"object",
|
||||
"null"
|
||||
],
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"path": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
},
|
||||
"sha256": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
],
|
||||
"pattern": "^[a-fA-F0-9]{64}$"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sources": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"url",
|
||||
"type",
|
||||
"verified_at"
|
||||
],
|
||||
"properties": {
|
||||
"url": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"manufacturer",
|
||||
"distributor",
|
||||
"retailer",
|
||||
"packaging",
|
||||
"other"
|
||||
]
|
||||
},
|
||||
"verified_at": {
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"draft",
|
||||
"unverified",
|
||||
"verified",
|
||||
"discontinued",
|
||||
"duplicate"
|
||||
]
|
||||
},
|
||||
"last_updated": {
|
||||
"type": "string",
|
||||
"format": "date"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user