huridocs/uwazi

View on GitHub
app/shared/types/IXModelSchema.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { objectIdSchema } from 'shared/types/commonSchemas';

export const emitSchemaTypes = true;

export enum ModelStatus {
  processing = 'processing',
  failed = 'failed',
  ready = 'ready',
}

export const IXModelSchema = {
  type: 'object',
  additionalProperties: false,
  title: 'IXModelType',
  definitions: { objectIdSchema },
  required: ['extractorId', 'creationDate'],
  properties: {
    _id: objectIdSchema,
    extractorId: objectIdSchema,
    creationDate: { type: 'number' },
    status: { type: 'string', enum: Object.values(ModelStatus), default: ModelStatus.processing },
    findingSuggestions: { type: 'boolean', default: true },
  },
};