UNPKG

pl4y-data-library

Version:

This library contains the dtos, enums, schemas, and other data objects needed in the pl4y ecosystem.

60 lines 2.67 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PricingSchema = exports.Pricing = void 0; const mongoose_1 = require("@nestjs/mongoose"); const mongoose_2 = require("mongoose"); const currency_code_enum_1 = require("../enums/currency-code.enum"); let Pricing = class Pricing { }; __decorate([ (0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, ref: "Product", required: true, unique: true, }), __metadata("design:type", mongoose_2.Types.ObjectId) ], Pricing.prototype, "productId", void 0); __decorate([ (0, mongoose_1.Prop)({ required: true }), __metadata("design:type", Number) ], Pricing.prototype, "price", void 0); __decorate([ (0, mongoose_1.Prop)({ type: String, enum: Object.values(currency_code_enum_1.CurrencyCodeEnum).filter((value) => typeof value === "string"), default: currency_code_enum_1.CurrencyCodeEnum.USD, }), __metadata("design:type", String) ], Pricing.prototype, "currencyCode", void 0); __decorate([ (0, mongoose_1.Prop)({ required: false }), __metadata("design:type", String) ], Pricing.prototype, "supplierId", void 0); __decorate([ (0, mongoose_1.Prop)({ type: Date, required: false, default: Date.now }), __metadata("design:type", Date) ], Pricing.prototype, "effectiveDate", void 0); __decorate([ (0, mongoose_1.Prop)({ type: Date, required: false, default: new Date(9999, 11, 31, 23, 59, 59) }), __metadata("design:type", Date) ], Pricing.prototype, "expiryDate", void 0); __decorate([ (0, mongoose_1.Prop)({ required: false, default: 0 }), __metadata("design:type", Number) ], Pricing.prototype, "discount", void 0); Pricing = __decorate([ (0, mongoose_1.Schema)() ], Pricing); exports.Pricing = Pricing; exports.PricingSchema = mongoose_1.SchemaFactory.createForClass(Pricing); //# sourceMappingURL=pricing.schema.js.map