Last active
March 1, 2024 05:59
-
-
Save Alazoral/6eb9ba4573bc3e82ffc8850bafd8f205 to your computer and use it in GitHub Desktop.
Proposed Croperation Gin Run API Schema
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$ref": "#/definitions/GinningRun", | |
"definitions": { | |
"GinningRun": { | |
"type": "object", | |
"properties": { | |
"run_id": { | |
"type": "string", | |
"description": "The external unique identifier for the ginning run" | |
}, | |
"gin_id": { | |
"type": "string", | |
"description": "The external unique identifier for the gin" | |
}, | |
"grower_id": { | |
"type": "string", | |
"description": "The external ID provided for the Ginning Services growing record for the primary grower, which GFS contract records are applied to" | |
}, | |
"grower_ngr": { | |
"type": "string", | |
"description": "The National Grower Registry ID number for the primary grower" | |
}, | |
"grower_trading_name": { | |
"type": "string", | |
"description": "The trading name of the primary grower, to be used on the gin file" | |
}, | |
"grower_parties": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"grower_id": { | |
"type": "string", | |
"description": "The external ID provided for the Ginning Services growing record" | |
}, | |
"grower_ngr": { | |
"type": "string", | |
"description": "The National Grower Registry ID number for the grower" | |
}, | |
"grower_trading_name": { | |
"type": "string", | |
"description": "The trading name of the grower" | |
}, | |
"percentage": { | |
"type": "number", | |
"exclusiveMinimum": 0, | |
"description": "The percentage of the ginning run that the grower is responsible for" | |
}, | |
"levies": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"external_id": { | |
"type": "string", | |
"description": "An identifier to be used by the accounting system" | |
}, | |
"label": { | |
"type": "string", | |
"description": "The label to be used on the invoice" | |
}, | |
"fee_per_bale": { | |
"type": "object", | |
"properties": { | |
"cents": { | |
"type": "number", | |
"description": "The price in AUD cents (aka, 100 = $1.00)" | |
} | |
}, | |
"required": [ | |
"cents" | |
], | |
"additionalProperties": false, | |
"description": "The fee per bale" | |
}, | |
"fee_per_mt": { | |
"$ref": "#/definitions/GinningRun/properties/grower_parties/items/properties/levies/items/properties/fee_per_bale", | |
"description": "The fee per metric tonne" | |
}, | |
"type": { | |
"type": "string", | |
"enum": [ | |
"COTTON_SEED", | |
"COTTON_LINT" | |
], | |
"description": "The type of product that the levy applies to" | |
} | |
}, | |
"required": [ | |
"external_id", | |
"label", | |
"type" | |
], | |
"additionalProperties": false | |
}, | |
"description": "The list of levies that the grower is responsible for paying" | |
} | |
}, | |
"required": [ | |
"grower_id", | |
"grower_ngr", | |
"grower_trading_name", | |
"percentage", | |
"levies" | |
], | |
"additionalProperties": false | |
}, | |
"description": "The list of grower parties and their respective levies" | |
}, | |
"merchant_id": { | |
"type": "string", | |
"description": "The external ID provided for the Ginning Services merchant record" | |
}, | |
"merchant_trading_name": { | |
"type": "string", | |
"description": "The trading name of the merchant" | |
}, | |
"gin_date": { | |
"type": "string", | |
"format": "date-time", | |
"description": "The date the gin was performed" | |
}, | |
"removal_date": { | |
"type": "string", | |
"format": "date-time", | |
"description": "The date the bales were removed from the gin" | |
}, | |
"bales": { | |
"type": "array", | |
"items": { | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "string", | |
"description": "The bale ID" | |
}, | |
"weight_kg": { | |
"type": "number", | |
"description": "The weight of the bale in kilograms" | |
}, | |
"module_id": { | |
"type": "number", | |
"description": "The module ID" | |
}, | |
"module_weight_kg": { | |
"type": "number", | |
"description": "The weight of the module in kilograms" | |
}, | |
"variety": { | |
"type": "string", | |
"description": "The variety of the cotton" | |
}, | |
"pick": { | |
"type": "string", | |
"description": "The pick specifier" | |
}, | |
"field": { | |
"type": "string", | |
"description": "The field specifier" | |
}, | |
"property": { | |
"type": "string", | |
"description": "The property name" | |
}, | |
"water": { | |
"type": "string", | |
"description": "The water type" | |
}, | |
"pick_method": { | |
"type": "string", | |
"description": "The pick method" | |
} | |
}, | |
"required": [ | |
"id", | |
"weight_kg", | |
"module_id", | |
"module_weight_kg", | |
"variety", | |
"pick", | |
"field", | |
"property", | |
"water", | |
"pick_method" | |
], | |
"additionalProperties": false | |
}, | |
"description": "The list of bales that were ginned" | |
}, | |
"ginning_fee_per_bale": { | |
"type": "object", | |
"properties": { | |
"cents": { | |
"$ref": "#/definitions/GinningRun/properties/grower_parties/items/properties/levies/items/properties/fee_per_bale/properties/cents" | |
} | |
}, | |
"required": [ | |
"cents" | |
], | |
"additionalProperties": false, | |
"description": "The ginning fee per bale" | |
}, | |
"invoiced_party": { | |
"type": "string", | |
"enum": [ | |
"GROWER", | |
"MERCHANT" | |
], | |
"description": "The party to be invoiced for the ginning run" | |
} | |
}, | |
"required": [ | |
"run_id", | |
"gin_id", | |
"grower_id", | |
"grower_trading_name", | |
"grower_parties", | |
"merchant_id", | |
"merchant_trading_name", | |
"gin_date", | |
"removal_date", | |
"bales", | |
"ginning_fee_per_bale", | |
"invoiced_party" | |
], | |
"additionalProperties": false | |
} | |
}, | |
"$schema": "http://json-schema.org/draft-07/schema#" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment