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.6", "version": "0.3.11", "homepage": "https://ever.co", "repository": { "type": "git", Loading packages/common/src/entities/Promotion.ts +18 −18 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 } from '../interfaces/IPromotion'; import { IPromotion, IPromotionCreateObject, IPromotionTitle, IPromotionDescription, } from '../interfaces/IPromotion'; /** * Loading @@ -13,23 +18,19 @@ import { IPromotion, IPromotionCreateObject } from '../interfaces/IPromotion'; @Entity({ name: 'promotions' }) class Promotion extends DBObject<IPromotion, IPromotionCreateObject> implements IPromotion { //tstodo /** * @type {string} * @type {IPromotionTitle[]} * @memberof Promotion */ @Schema({ type: String, required: false }) @Column() title: string; @Schema({ type: Array, required: false }) title: IPromotionTitle[]; /** * @type {string} * @type {IPromotionDescription[]} * @memberof Promotion */ @Schema({ type: String, required: false }) @Column() description: string; @Schema({ type: Array, required: false }) description: IPromotionDescription[]; /** * @type {boolean} Loading Loading @@ -63,13 +64,12 @@ class Promotion extends DBObject<IPromotion, IPromotionCreateObject> @Column() image: string; //tstodo // /** // * @type {Product} // * @memberof Promotion // */ // @Types.Ref(Product) // product: Product; /** * @type {Product} * @memberof Promotion */ @Types.Ref(Product) product: Product; /** * @type {number} Loading packages/common/src/interfaces/IPromotion.ts +9 −11 Original line number Diff line number Diff line Loading @@ -6,18 +6,18 @@ export interface IPromotionCreateObject extends DBCreateObject { /** * Promotion title locale * * @type {string} * @type {IPromotionTitle[]} * @memberof IPromotionCreateObject */ title: string; title: IPromotionTitle[]; /** * Promotion description locale * * @type {string} * @type {IPromotionDescription[]} * @memberof IPromotionCreateObject */ description: string; description: IPromotionDescription[]; /** * Loading Loading @@ -46,12 +46,11 @@ export interface IPromotionCreateObject extends DBCreateObject { */ image: string; //tstodo // /** // * @type {Product} // * @memberof IPromotionCreateObject // */ // product: Product; /** * @type {Product} * @memberof IPromotionCreateObject */ product: Product; /** * @type {number} Loading @@ -64,6 +63,5 @@ export interface IPromotion extends IPromotionCreateObject, DBRawObject { _id: PyroObjectId; } //tstodo ^^ 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.5", "version": "0.3.9", "homepage": "https://ever.co", "repository": { "type": "git", Loading packages/core/src/graphql/products/promotions/promotion.types.graphql +20 −7 Original line number Diff line number Diff line type Promotion { _id: String title: String description: String title: [TranslateType] description: [TranslateType] active: Boolean activeFrom: Date activeTo: Date image: String # product: Product product: Product purchasesCount: Int } type TranslateType { locale: String! value: String! } type Product { _id: String! } input PromotionCreateInput { title: String! description: String title: [TranslateInput] description: [TranslateInput] active: Boolean activeFrom: Date activeTo: Date image: String # tstodo # product: String product: String purchasesCount: Int } input TranslateInput { locale: String! value: String! } type Query { promotions: [Promotion] } 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.6", "version": "0.3.11", "homepage": "https://ever.co", "repository": { "type": "git", Loading
packages/common/src/entities/Promotion.ts +18 −18 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 } from '../interfaces/IPromotion'; import { IPromotion, IPromotionCreateObject, IPromotionTitle, IPromotionDescription, } from '../interfaces/IPromotion'; /** * Loading @@ -13,23 +18,19 @@ import { IPromotion, IPromotionCreateObject } from '../interfaces/IPromotion'; @Entity({ name: 'promotions' }) class Promotion extends DBObject<IPromotion, IPromotionCreateObject> implements IPromotion { //tstodo /** * @type {string} * @type {IPromotionTitle[]} * @memberof Promotion */ @Schema({ type: String, required: false }) @Column() title: string; @Schema({ type: Array, required: false }) title: IPromotionTitle[]; /** * @type {string} * @type {IPromotionDescription[]} * @memberof Promotion */ @Schema({ type: String, required: false }) @Column() description: string; @Schema({ type: Array, required: false }) description: IPromotionDescription[]; /** * @type {boolean} Loading Loading @@ -63,13 +64,12 @@ class Promotion extends DBObject<IPromotion, IPromotionCreateObject> @Column() image: string; //tstodo // /** // * @type {Product} // * @memberof Promotion // */ // @Types.Ref(Product) // product: Product; /** * @type {Product} * @memberof Promotion */ @Types.Ref(Product) product: Product; /** * @type {number} Loading
packages/common/src/interfaces/IPromotion.ts +9 −11 Original line number Diff line number Diff line Loading @@ -6,18 +6,18 @@ export interface IPromotionCreateObject extends DBCreateObject { /** * Promotion title locale * * @type {string} * @type {IPromotionTitle[]} * @memberof IPromotionCreateObject */ title: string; title: IPromotionTitle[]; /** * Promotion description locale * * @type {string} * @type {IPromotionDescription[]} * @memberof IPromotionCreateObject */ description: string; description: IPromotionDescription[]; /** * Loading Loading @@ -46,12 +46,11 @@ export interface IPromotionCreateObject extends DBCreateObject { */ image: string; //tstodo // /** // * @type {Product} // * @memberof IPromotionCreateObject // */ // product: Product; /** * @type {Product} * @memberof IPromotionCreateObject */ product: Product; /** * @type {number} Loading @@ -64,6 +63,5 @@ export interface IPromotion extends IPromotionCreateObject, DBRawObject { _id: PyroObjectId; } //tstodo ^^ 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.5", "version": "0.3.9", "homepage": "https://ever.co", "repository": { "type": "git", Loading
packages/core/src/graphql/products/promotions/promotion.types.graphql +20 −7 Original line number Diff line number Diff line type Promotion { _id: String title: String description: String title: [TranslateType] description: [TranslateType] active: Boolean activeFrom: Date activeTo: Date image: String # product: Product product: Product purchasesCount: Int } type TranslateType { locale: String! value: String! } type Product { _id: String! } input PromotionCreateInput { title: String! description: String title: [TranslateInput] description: [TranslateInput] active: Boolean activeFrom: Date activeTo: Date image: String # tstodo # product: String product: String purchasesCount: Int } input TranslateInput { locale: String! value: String! } type Query { promotions: [Promotion] } Loading