Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ee01fea
intial batch identify features
acwhite211 Mar 1, 2026
6e88676
localization fixes
acwhite211 Mar 1, 2026
9ad165f
Lint code with ESLint and Prettier
acwhite211 Mar 1, 2026
54ac413
feat: update icon and form layout
grantfitzsimmons Mar 2, 2026
dadbf25
feat: increase density
grantfitzsimmons Mar 2, 2026
1bd8af8
feat: improve record set behavior & dialog sizing
grantfitzsimmons Mar 2, 2026
9245431
Lint code with ESLint and Prettier
grantfitzsimmons Mar 2, 2026
b86b02b
feat: add handling for multiple taxon trees
grantfitzsimmons Mar 2, 2026
9fca626
fix: show CO rows even without current dets
grantfitzsimmons Mar 2, 2026
8c75c26
Lint code with ESLint and Prettier
grantfitzsimmons Mar 2, 2026
867fe3e
Handle multiple trees and reset determinations
grantfitzsimmons Mar 3, 2026
2ce5c8b
Merge branch 'issue-7764' of https://github.com/specify/specify7 into…
grantfitzsimmons Mar 3, 2026
3042893
feat: use fullname instead
grantfitzsimmons Mar 3, 2026
46e8a97
fix: CO search dialog stops returning other trees
grantfitzsimmons Mar 3, 2026
0cddfd1
Lint code with ESLint and Prettier
grantfitzsimmons Mar 3, 2026
e609eef
add openapi decorators
acwhite211 Mar 3, 2026
48d4949
add filter_collection_objects_to_majority_type to prevent differing C…
acwhite211 Mar 3, 2026
26ad433
Lint code with ESLint and Prettier
acwhite211 Mar 3, 2026
857c2ae
add support for CatalogNumberAlphaNumByYear
acwhite211 Mar 3, 2026
6f8dc25
Revert "add filter_collection_objects_to_majority_type to prevent dif…
acwhite211 Mar 4, 2026
baddcb6
verify single tree record set
acwhite211 Mar 4, 2026
781e3c4
back-end code organizing
acwhite211 Mar 4, 2026
a4514be
initial unit tests
acwhite211 Mar 4, 2026
057afdb
Lint code with ESLint and Prettier
acwhite211 Mar 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
234 changes: 234 additions & 0 deletions specifyweb/backend/batch_identify/api_schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
_TAXON_TREE_GROUP_ITEM_SCHEMA = {
'type': 'object',
'properties': {
'taxonTreeDefId': {
'oneOf': [
{'type': 'integer'},
{'type': 'null'},
]
},
'taxonTreeName': {
'oneOf': [
{'type': 'string'},
{'type': 'null'},
]
},
'collectionObjectIds': {
'type': 'array',
'items': {'type': 'integer'},
},
'catalogNumbers': {
'type': 'array',
'items': {'type': 'string'},
},
'collectionObjectTypeNames': {
'type': 'array',
'items': {'type': 'string'},
},
},
'required': [
'taxonTreeDefId',
'taxonTreeName',
'collectionObjectIds',
'catalogNumbers',
'collectionObjectTypeNames',
],
'additionalProperties': False,
}

_ERROR_RESPONSE_SCHEMA = {
'description': 'Invalid request payload.',
'content': {
'application/json': {
'schema': {
'type': 'object',
'properties': {'error': {'type': 'string'}},
'required': ['error'],
'additionalProperties': False,
}
}
},
}

BATCH_IDENTIFY_VALIDATE_RECORD_SET_OPENAPI_SCHEMA = {
'post': {
'requestBody': {
'required': True,
'content': {
'application/json': {
'schema': {
'type': 'object',
'properties': {
'collectionObjectIds': {
'type': 'array',
'items': {'type': 'integer'},
}
},
'required': ['collectionObjectIds'],
'additionalProperties': False,
}
}
},
},
'responses': {
'200': {
'description': (
'Validated collection objects for Batch Identify and'
' grouped them by effective taxon tree.'
),
'content': {
'application/json': {
'schema': {
'type': 'object',
'properties': {
'collectionObjectIds': {
'type': 'array',
'items': {'type': 'integer'},
},
'hasMixedTaxonTrees': {'type': 'boolean'},
'taxonTreeGroups': {
'type': 'array',
'items': _TAXON_TREE_GROUP_ITEM_SCHEMA,
},
},
'required': [
'collectionObjectIds',
'hasMixedTaxonTrees',
'taxonTreeGroups',
],
'additionalProperties': False,
}
}
},
},
'400': _ERROR_RESPONSE_SCHEMA,
},
}
}

BATCH_IDENTIFY_RESOLVE_OPENAPI_SCHEMA = {
'post': {
'requestBody': {
'required': True,
'content': {
'application/json': {
'schema': {
'type': 'object',
'properties': {
'catalogNumbers': {
'type': 'array',
'items': {'type': 'string'},
},
'validateOnly': {'type': 'boolean'},
},
'required': ['catalogNumbers'],
'additionalProperties': False,
}
}
},
},
'responses': {
'200': {
'description': (
'Resolved collection objects and validation details for'
' catalog number input.'
),
'content': {
'application/json': {
'schema': {
'type': 'object',
'properties': {
'collectionObjectIds': {
'type': 'array',
'items': {'type': 'integer'},
},
'currentDeterminationIds': {
'type': 'array',
'items': {'type': 'integer'},
},
'unmatchedCatalogNumbers': {
'type': 'array',
'items': {'type': 'string'},
},
'hasMixedTaxonTrees': {'type': 'boolean'},
'taxonTreeGroups': {
'type': 'array',
'items': _TAXON_TREE_GROUP_ITEM_SCHEMA,
},
},
'required': [
'collectionObjectIds',
'currentDeterminationIds',
'unmatchedCatalogNumbers',
'hasMixedTaxonTrees',
'taxonTreeGroups',
],
'additionalProperties': False,
}
}
},
},
'400': _ERROR_RESPONSE_SCHEMA,
},
}
}

BATCH_IDENTIFY_OPENAPI_SCHEMA = {
'post': {
'requestBody': {
'required': True,
'content': {
'application/json': {
'schema': {
'type': 'object',
'properties': {
'collectionObjectIds': {
'type': 'array',
'items': {'type': 'integer'},
},
'determination': {
'type': 'object',
'additionalProperties': True,
},
},
'required': ['collectionObjectIds', 'determination'],
'additionalProperties': False,
}
}
},
},
'responses': {
'200': {
'description': (
'Created determination records for all selected collection'
' objects.'
),
'content': {
'application/json': {
'schema': {
'type': 'object',
'properties': {
'createdCount': {'type': 'integer'},
'collectionObjectIds': {
'type': 'array',
'items': {'type': 'integer'},
},
'determinationIds': {
'type': 'array',
'items': {'type': 'integer'},
},
},
'required': [
'createdCount',
'collectionObjectIds',
'determinationIds',
],
'additionalProperties': False,
}
}
},
},
'400': _ERROR_RESPONSE_SCHEMA,
},
}
}
Loading