Add scoped private business verification evidence and expiry
This commit is contained in:
@@ -35,5 +35,17 @@ document.paths['/listings/{id}/objects'] = { post: operation('Declare a separate
|
||||
document.paths['/listings/{id}/objects'].post.responses['201'] = document.paths['/listings/{id}/objects'].post.responses['200'];
|
||||
delete document.paths['/listings/{id}/objects'].post.responses['200'];
|
||||
document.paths['/listings/{id}/objects/{object}'] = { put: operation('Update scoped object with immutable kind; amount requires currency and value kind; area requires unit', objectResponse, objectInput, [id, { ...id, name: 'object' }]) };
|
||||
const verification = { type: 'object', required: ['version_no', 'check', 'outcome', 'evidence_reference', 'note'], properties: {
|
||||
version_no: { type: 'integer', minimum: 1 }, object_id: { type: ['string', 'null'], format: 'uuid' },
|
||||
check: { enum: ['identity', 'representation', 'declared_ownership', 'documentary_ownership', 'document_received', 'document_validated', 'independent_valuation', 'land_right_documented', 'license_confirmed', 'validity', 'legal_transfer', 'prior_authorization'] },
|
||||
outcome: { enum: ['confirmed', 'rejected', 'inconclusive', 'revoked'] },
|
||||
evidence_reference: { type: 'string', minLength: 10, maxLength: 2000 }, note: { type: 'string', minLength: 10, maxLength: 2000 },
|
||||
valid_until: { type: ['string', 'null'], format: 'date', description: 'Required for confirmed findings; must be today or later.' },
|
||||
} };
|
||||
document.paths['/listings/{id}/verifications'] = { post: operation('Record independent finding while in_review; immutable encrypted evidence, optimistic version and scoped object. Does not publish or certify the business.', ref('Business'), verification, [id]) };
|
||||
document.paths['/listings/{id}'].get.responses['200'].content['application/json'].schema.properties.verifications = {
|
||||
type: 'array', items: { ...verification, properties: { ...verification.properties, effective_outcome: { enum: ['confirmed', 'rejected', 'inconclusive', 'revoked', 'stale', 'expired'] }, content_version: { type: 'integer' }, created_at: text } },
|
||||
};
|
||||
document.info.version = '1.1.0';
|
||||
fs.writeFileSync('docs/investmoz/existing-business/openapi.json', JSON.stringify(document, null, 2) + '\n');
|
||||
console.log('OpenAPI written: 8 operations, private session API.');
|
||||
console.log('OpenAPI written: 9 operations, private session API.');
|
||||
|
||||
Reference in New Issue
Block a user