Loading packages/common/package.json +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ "name": "@ever-platform/common", "description": "Ever Platform Shared Core", "license": "AGPL-3.0", "version": "0.3.10", "version": "0.3.11", "homepage": "https://ever.co", "repository": { "type": "git", Loading packages/common/src/entities/Promotion.ts 0 → 100644 +87 −0 Original line number Diff line number Diff line import { DBObject, ModelName, Types, Schema } from '@pyro/db'; import { Entity, Column } from 'typeorm'; import Product from './Product'; import { IPromotion, IPromotionCreateObject, IPromotionTitle, IPromotionDescription, } from '../interfaces/IPromotion'; /** * * @class Promotion * @extends {DBObject<IPromotion, IPromotionCreateObject>} * @implements {IPromotion} */ @ModelName('Promotion') @Entity({ name: 'promotions' }) class Promotion extends DBObject<IPromotion, IPromotionCreateObject> implements IPromotion { /** * @type {IPromotionTitle[]} * @memberof Promotion */ @Schema({ type: Array, required: false }) title: IPromotionTitle[]; /** * @type {IPromotionDescription[]} * @memberof Promotion */ @Schema({ type: Array, required: false }) description: IPromotionDescription[]; /** * @type {boolean} * @memberof Promotion */ @Types.Boolean(true) @Column() active: boolean; /** * @type {Date} * @memberof Promotion */ @Schema({ type: Date, required: false }) @Column() activeFrom: Date; /** * @type {Date} * @memberof Promotion */ @Schema({ type: Date, required: false }) @Column() activeTo: Date; /** * @type {string} * @memberof Promotion */ @Schema({ type: String, required: false }) @Column() image: string; /** * @type {Product} * @memberof Promotion */ @Types.Ref(Product) product: Product; /** * @type {number} * @memberof Promotion */ @Types.Number() @Column() purchasesCount: number; @Types.Boolean(false) @Column() isDeleted: boolean; } export default Promotion; packages/common/src/entities/index.ts +1 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,4 @@ export * from './User'; export * from './UserOrder'; export * from './Warehouse'; export * from './WarehouseProduct'; export * from './Promotion'; packages/common/src/interfaces/IPromotion.ts 0 → 100644 +67 −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'; export interface IPromotionCreateObject extends DBCreateObject { /** * Promotion title locale * * @type {IPromotionTitle[]} * @memberof IPromotionCreateObject */ title: IPromotionTitle[]; /** * Promotion description locale * * @type {IPromotionDescription[]} * @memberof IPromotionCreateObject */ description: IPromotionDescription[]; /** * * @type {boolean} * @memberof IPromotionCreateObject */ active: boolean; /** * @type {Date} * @memberof IPromotionCreateObject */ activeFrom: Date; /** * @type {Date} * @memberof IPromotionCreateObject */ activeTo: Date; /** * Url to Promotion picture/photo * * @type {string} * @memberof IPromotionCreateObject */ image: string; /** * @type {Product} * @memberof IPromotionCreateObject */ product: Product; /** * @type {number} * @memberof IPromotionCreateObject */ purchasesCount: number; } export interface IPromotion extends IPromotionCreateObject, DBRawObject { _id: PyroObjectId; } export interface IPromotionDescription extends ILocaleMember {} export interface IPromotionTitle extends ILocaleMember {} packages/core/package.json +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ "name": "@ever-platform/core", "description": "Ever Platform Headless Framework", "license": "AGPL-3.0", "version": "0.3.8", "version": "0.3.9", "homepage": "https://ever.co", "repository": { "type": "git", Loading Loading
packages/common/package.json +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ "name": "@ever-platform/common", "description": "Ever Platform Shared Core", "license": "AGPL-3.0", "version": "0.3.10", "version": "0.3.11", "homepage": "https://ever.co", "repository": { "type": "git", Loading
packages/common/src/entities/Promotion.ts 0 → 100644 +87 −0 Original line number Diff line number Diff line import { DBObject, ModelName, Types, Schema } from '@pyro/db'; import { Entity, Column } from 'typeorm'; import Product from './Product'; import { IPromotion, IPromotionCreateObject, IPromotionTitle, IPromotionDescription, } from '../interfaces/IPromotion'; /** * * @class Promotion * @extends {DBObject<IPromotion, IPromotionCreateObject>} * @implements {IPromotion} */ @ModelName('Promotion') @Entity({ name: 'promotions' }) class Promotion extends DBObject<IPromotion, IPromotionCreateObject> implements IPromotion { /** * @type {IPromotionTitle[]} * @memberof Promotion */ @Schema({ type: Array, required: false }) title: IPromotionTitle[]; /** * @type {IPromotionDescription[]} * @memberof Promotion */ @Schema({ type: Array, required: false }) description: IPromotionDescription[]; /** * @type {boolean} * @memberof Promotion */ @Types.Boolean(true) @Column() active: boolean; /** * @type {Date} * @memberof Promotion */ @Schema({ type: Date, required: false }) @Column() activeFrom: Date; /** * @type {Date} * @memberof Promotion */ @Schema({ type: Date, required: false }) @Column() activeTo: Date; /** * @type {string} * @memberof Promotion */ @Schema({ type: String, required: false }) @Column() image: string; /** * @type {Product} * @memberof Promotion */ @Types.Ref(Product) product: Product; /** * @type {number} * @memberof Promotion */ @Types.Number() @Column() purchasesCount: number; @Types.Boolean(false) @Column() isDeleted: boolean; } export default Promotion;
packages/common/src/entities/index.ts +1 −0 Original line number Diff line number Diff line Loading @@ -13,3 +13,4 @@ export * from './User'; export * from './UserOrder'; export * from './Warehouse'; export * from './WarehouseProduct'; export * from './Promotion';
packages/common/src/interfaces/IPromotion.ts 0 → 100644 +67 −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'; export interface IPromotionCreateObject extends DBCreateObject { /** * Promotion title locale * * @type {IPromotionTitle[]} * @memberof IPromotionCreateObject */ title: IPromotionTitle[]; /** * Promotion description locale * * @type {IPromotionDescription[]} * @memberof IPromotionCreateObject */ description: IPromotionDescription[]; /** * * @type {boolean} * @memberof IPromotionCreateObject */ active: boolean; /** * @type {Date} * @memberof IPromotionCreateObject */ activeFrom: Date; /** * @type {Date} * @memberof IPromotionCreateObject */ activeTo: Date; /** * Url to Promotion picture/photo * * @type {string} * @memberof IPromotionCreateObject */ image: string; /** * @type {Product} * @memberof IPromotionCreateObject */ product: Product; /** * @type {number} * @memberof IPromotionCreateObject */ purchasesCount: number; } export interface IPromotion extends IPromotionCreateObject, DBRawObject { _id: PyroObjectId; } export interface IPromotionDescription extends ILocaleMember {} export interface IPromotionTitle extends ILocaleMember {}
packages/core/package.json +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ "name": "@ever-platform/core", "description": "Ever Platform Headless Framework", "license": "AGPL-3.0", "version": "0.3.8", "version": "0.3.9", "homepage": "https://ever.co", "repository": { "type": "git", Loading