pure-orm
Version:
A SQL Toolkit based on pure business objects passed to and from stateful data access objects
64 lines (63 loc) • 2.22 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.productVariantEntity = exports.ProductVariants = exports.ProductVariant = exports.columns = exports.tableName = void 0;
const product_1 = require("./product");
const actual_product_variant_1 = require("./actual-product-variant");
const color_1 = require("./color");
const gender_1 = require("./gender");
const size_1 = require("./size");
exports.tableName = 'product_variant';
exports.columns = [
'id',
{ column: 'product_id', references: product_1.Product },
{ column: 'actual_product_variant_id', references: actual_product_variant_1.ActualProductVariant },
{ column: 'color_id', references: color_1.Color },
{ column: 'gender_id', references: gender_1.Gender },
{ column: 'size_id', references: size_1.Size },
'shopify_id',
'image_url',
'barcode',
'price',
'compare_at_price',
'created_date',
'updated_date',
'grams',
'requires_shipping'
];
class ProductVariant {
constructor(props) {
this.id = props.id;
this.productId = props.productId;
this.product = props.product;
this.actualProductVariantId = props.actualProductVariantId;
this.actualProductVariant = props.actualProductVariant;
this.colorId = props.colorId;
this.color = props.color;
this.genderId = props.genderId;
this.gender = props.gender;
this.sizeId = props.sizeId;
this.size = props.size;
this.shopifyId = props.shopifyId;
this.imageUrl = props.imageUrl;
this.barcode = props.barcode;
this.price = props.price;
this.compareAtPrice = props.compareAtPrice;
this.createdDate = props.createDate;
this.updatedDate = props.updateDate;
this.grams = props.grams;
this.requiresShipping = props.requiresShipping;
}
}
exports.ProductVariant = ProductVariant;
class ProductVariants {
constructor({ models }) {
this.models = models;
}
}
exports.ProductVariants = ProductVariants;
exports.productVariantEntity = {
tableName: exports.tableName,
columns: exports.columns,
Model: ProductVariant,
Collection: ProductVariants
};