UNPKG

pure-orm

Version:

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

51 lines (50 loc) 1.61 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.lineItemEntity = exports.LineItems = exports.LineItem = exports.columns = exports.tableName = void 0; const product_variant_1 = require("./product-variant"); const order_1 = require("./order"); exports.tableName = 'line_item'; exports.columns = [ 'id', { column: 'product_variant_id', references: product_variant_1.ProductVariant }, { column: 'order_id', references: order_1.Order }, 'fulfillment_status_id', 'fulfillable_quantity', 'fulfillment_service', 'grams', 'price', 'quantity', 'requires_shipping', 'taxable', 'total_discount' ]; class LineItem { constructor(props) { this.id = props.id; this.productVariantId = props.productVariantId; this.productVariant = props.productVariant; this.orderId = props.orderId; this.order = props.order; this.fulfillmentStatusId = props.fulfillmentStatusId; this.fulfillableQuantity = props.fulfillableQuanity; this.fulfillmentService = props.fulfillmentService; this.grams = props.grams; this.price = props.price; this.quantity = props.quanity; this.requiresShipping = props.requiresShipping; this.totalDiscount = props.totalDiscount; } } exports.LineItem = LineItem; class LineItems { constructor({ models }) { this.models = models; } } exports.LineItems = LineItems; exports.lineItemEntity = { tableName: exports.tableName, columns: exports.columns, Model: LineItem, Collection: LineItems };