Commit b527be88 authored by Tsvetelina Yordanova's avatar Tsvetelina Yordanova
Browse files

feat: #80 start update promotion

parent 50355045
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
	"name": "ever-platform",
	"description": "Ever Platform",
	"license": "AGPL-3.0",
	"version": "0.3.0",
	"version": "0.3.1",
	"homepage": "https://ever.co",
	"repository": {
		"type": "git",
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
	"name": "@ever-platform/common",
	"description": "Ever Platform Shared Core",
	"license": "AGPL-3.0",
	"version": "0.3.11",
	"version": "0.3.14",
	"homepage": "https://ever.co",
	"repository": {
		"type": "git",
+20 −1
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ import {
	IPromotionTitle,
	IPromotionDescription,
} from '../interfaces/IPromotion';
import Warehouse from './Warehouse';
import IWarehouse from '../interfaces/IWarehouse';

/**
 *
@@ -22,7 +24,7 @@ class Promotion extends DBObject<IPromotion, IPromotionCreateObject>
	 * @type {IPromotionTitle[]}
	 * @memberof Promotion
	 */
	@Schema({ type: Array, required: false })
	@Schema({ type: Array, required: true })
	title: IPromotionTitle[];

	/**
@@ -40,6 +42,23 @@ class Promotion extends DBObject<IPromotion, IPromotionCreateObject>
	@Column()
	active: boolean;

	/**
	 * @type {number}
	 * @memberof Promotion
	 */
	@Types.Number()
	@Column()
	promoPrice: number;

	/**
	 * Warehouse promotion is associated with
	 *
	 * @type {IWarehouse}
	 * @memberof Promotion
	 */
	@Types.Ref(Warehouse)
	warehouse: Warehouse;

	/**
	 * @type {Date}
	 * @memberof Promotion
+17 −0
Original line number Diff line number Diff line
import { ILocaleMember } from './ILocale';
import Product from '../entities/Product';
import { DBRawObject, PyroObjectId, DBCreateObject } from '@pyro/db';
import IWarehouse from './IWarehouse';

export interface IPromotionCreateObject extends DBCreateObject {
	/**
@@ -57,6 +58,22 @@ export interface IPromotionCreateObject extends DBCreateObject {
	 * @memberof IPromotionCreateObject
	 */
	purchasesCount: number;

	/**
	 *
	 * @type {number}
	 * @memberof IPromotionCreateObject
	 */
	promoPrice: number;

	/**
	 *
	 * Id of warehouse this Promotion is associated with
	 *
	 * @type {IWarehouse}
	 * @memberof IPromotionCreateObject
	 */
	warehouse: IWarehouse;
}

export interface IPromotion extends IPromotionCreateObject, DBRawObject {
+1 −1
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
	"name": "@ever-platform/core",
	"description": "Ever Platform Headless Framework",
	"license": "AGPL-3.0",
	"version": "0.3.9",
	"version": "0.3.12",
	"homepage": "https://ever.co",
	"repository": {
		"type": "git",
Loading