import mongoose from 'mongoose'; const { Schema } = mongoose; export const MARKETPLACE_MAPPING_STATES = ['pending', 'syncing', 'ready', 'failed']; export function marketplaceSyncMappingSchema() { return new Schema( { marketplace: { type: Schema.Types.ObjectId, ref: 'marketplace', required: true }, externalReference: { type: String, required: false }, syncHash: { type: String, required: false }, state: { type: { type: String, enum: MARKETPLACE_MAPPING_STATES, default: 'pending', }, message: { type: String, required: false }, }, }, { _id: true } ); }