UNPKG

pure-orm

Version:

A SQL Toolkit based on pure business objects passed to and from stateful data access objects

52 lines (51 loc) 1.57 kB
"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"); exports.tableName = 'product_variant'; exports.columns = [ 'id', { column: 'product_id', references: product_1.Product }, 'actual_product_variant_id', 'color_id', 'gender_id', 'size_id', '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.colorId = props.colorId; this.genderId = props.genderId; this.sizeId = props.sizeId; this.barcode = props.barcode; this.price = props.price; this.compareAtPrice = props.compareAtPrice; this.createdDate = props.createdDate; this.updatedDate = props.updatedDate; 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 };