Enhance sales schemas with synchronization fields
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good

- Added `syncHash`, `syncImageHash`, and `marketplaceImageUrls` fields to the `listing`, `listingVariant`, and `marketplaceMapping` schemas to support improved synchronization and image management across marketplaces.
This commit is contained in:
Tom Butcher 2026-08-29 23:13:46 +01:00
parent cdc7b860ac
commit ae2cefb183
3 changed files with 7 additions and 0 deletions

View File

@ -42,6 +42,9 @@ const listingSchema = new Schema(
price: { type: Number, required: false },
currency: { type: String, required: false },
lastSyncedAt: { type: Date, required: false },
syncHash: { type: String, required: false },
syncImageHash: { type: String, required: false },
marketplaceImageUrls: [{ type: String, required: false }],
stockQuantity: { type: Number, required: false, default: 0 },
condition: {
type: String,

View File

@ -47,6 +47,9 @@ const listingVarientSchema = new Schema(
priceTaxRate: { type: Schema.Types.ObjectId, ref: 'taxRate', required: false },
priceWithTax: { type: Number, required: false },
lastSyncedAt: { type: Date, required: false },
syncHash: { type: String, required: false },
syncImageHash: { type: String, required: false },
marketplaceImageUrls: [{ type: String, required: false }],
listingImages: [{ type: Schema.Types.ObjectId, ref: 'file', required: false }],
stockQuantity: { type: Number, required: false, default: 0 },
},

View File

@ -9,6 +9,7 @@ export function marketplaceSyncMappingSchema() {
{
marketplace: { type: Schema.Types.ObjectId, ref: 'marketplace', required: true },
externalReference: { type: String, required: false },
syncHash: { type: String, required: false },
state: {
type: {
type: String,