feat(F-193): completed feature

This commit is contained in:
chattie
2026-08-23 07:58:50 +02:00
parent a372e5abfb
commit 4b3a506166
18 changed files with 244 additions and 37 deletions

View File

@@ -0,0 +1,25 @@
/* eslint-disable @typescript-eslint/naming-convention */
'use strict';
/**
* F-193: Adds `weight_grams` to catalog_product_variants.
* Authoritative per-variant shipping weight in grams.
* Defaults to NULL (fallback to product-level unit_weight_kg in checkout).
* Note: expiration_date already exists on catalog_products (migration 038).
*/
exports.up = function (db) {
return db.addColumn('catalog_product_variants', 'weight_grams', {
type: 'integer',
notNull: false,
default: null,
check: 'weight_grams IS NULL OR weight_grams > 0',
}, 'ean');
};
exports.down = function (db) {
return db.removeColumn('catalog_product_variants', 'weight_grams');
};
exports._meta = {
version: 57,
};