Skip to content

Commit

Permalink
add ddiscount essage
Browse files Browse the repository at this point in the history
  • Loading branch information
Xziy committed Aug 9, 2023
1 parent 9abdfef commit 131ebf0
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion adapters/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,5 +246,5 @@ class Adapter {
}
}
}
exports.Adapter = Adapter;
Adapter.WEBRESTO_MODULES_PATH = process.env.WEBRESTO_MODULES_PATH === undefined ? "@webresto" : process.env.WEBRESTO_MODULES_PATH;
exports.Adapter = Adapter;
2 changes: 1 addition & 1 deletion adapters/promotion/default/promotionAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,5 +186,5 @@ class PromotionAdapter extends AbstractPromotionAdapter_1.default {
return PromotionAdapter.prototype;
}
}
exports.PromotionAdapter = PromotionAdapter;
PromotionAdapter.promotions = {};
exports.PromotionAdapter = PromotionAdapter;
2 changes: 1 addition & 1 deletion libs/enums/PaymentDocumentStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ var PaymentDocumentStatus;
PaymentDocumentStatus["CANCEL"] = "CANCEL";
PaymentDocumentStatus["REFUND"] = "REFUND";
PaymentDocumentStatus["DECLINE"] = "DECLINE";
})(PaymentDocumentStatus || (exports.PaymentDocumentStatus = PaymentDocumentStatus = {}));
})(PaymentDocumentStatus = exports.PaymentDocumentStatus || (exports.PaymentDocumentStatus = {}));
2 changes: 1 addition & 1 deletion models/Dish.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ declare let attributes: {
/** Balance for sale, if -1, then as much as you like */
balance: number;
/**List of images of the dish*/
images: MediaFile[] | string[];
images: string[] | MediaFile[];
/** Слаг */
slug: string;
/** The concept to which the dish belongs */
Expand Down
2 changes: 1 addition & 1 deletion models/Group.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ declare let attributes: {
allowNull: boolean;
};
/** Images */
images: MediaFile[] | string[];
images: string[] | MediaFile[];
/** PlaySholder for group dishes */
dishesPlaceholder: MediaFile[];
/** The person readable isii*/
Expand Down
2 changes: 1 addition & 1 deletion models/Order.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default Order;
declare let Model: {
beforeCreate(orderInit: any, cb: (err?: string) => void): void;
/** Add dish into order */
addDish(criteria: CriteriaQuery<Order>, dish: Dish | string, amount: number, modifiers: OrderModifier[], comment: string, addedBy: string, replace?: boolean, orderDishId?: number): Promise<void>;
addDish(criteria: CriteriaQuery<Order>, dish: string | Dish, amount: number, modifiers: OrderModifier[], comment: string, addedBy: string, replace?: boolean, orderDishId?: number): Promise<void>;
removeDish(criteria: CriteriaQuery<Order>, dish: OrderDish, amount: number, stack?: boolean): Promise<void>;
setCount(criteria: CriteriaQuery<Order>, dish: OrderDish, amount: number): Promise<void>;
setComment(criteria: CriteriaQuery<Order>, dish: OrderDish, comment: string): Promise<void>;
Expand Down
2 changes: 2 additions & 0 deletions models/OrderDish.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ declare let attributes: {
discountType: string;
/** Сумма скидки */
discountAmount: string;
/** Сообщение скидки */
discountMessage: string;
/** Comment to dish in order */
comment: string;
/** Метка кто добавил */
Expand Down
2 changes: 2 additions & 0 deletions models/OrderDish.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ let attributes = {
discountType: 'string',
/** Сумма скидки */
discountAmount: "number",
/** Сообщение скидки */
discountMessage: "string",
/** Comment to dish in order */
comment: "string",
/** Метка кто добавил */
Expand Down
17 changes: 10 additions & 7 deletions models/OrderDish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,31 @@ let attributes = {
model: "Order",
} as unknown as Order | any,

/** Количество уникальных блюд в корзине */
/** The number of unique dishes in the basket */
uniqueItems: "number" as unknown as number,

/** цена позиции */
/** Position price*/
itemTotal: "number" as unknown as number,

/** цена позиции до применения скидок */
/** Position price before the use of discounts */
itemTotalBeforeDiscount: "number",

/**Общая сумма скидки */
/**The total amount of the discount */
discountTotal: "number" as unknown as number,

/** Тип скидки */
/** Type discount */
discountType: 'string',

/** Сумма скидки */
/** Discount amount */
discountAmount: "number",

/** postDiscounts */
discountMessage: "string",

/** Comment to dish in order */
comment: "string",

/** Метка кто добавил */
/** The label who added */
addedBy: {
type: "string",
defaultsTo: "user",
Expand Down
2 changes: 1 addition & 1 deletion models/User.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ declare let Model: {
* @param {WaterlineCriteria} criteria
* @returns String
*/
getPhoneString(phone: Phone, target?: "login" | "print" | "string"): Promise<string>;
getPhoneString(phone: Phone, target?: "string" | "login" | "print"): Promise<string>;
/**
* Update user password
*
Expand Down
12 changes: 6 additions & 6 deletions models/UserBonusProgram.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ interface UserBonusProgram extends attributes, ORM {
export default UserBonusProgram;
declare let Model: {
beforeCreate(init: UserBonusProgram, cb: (err?: string) => void): void;
registration(user: User | string, adapterOrId: string): Promise<UserBonusProgram>;
delete(user: User | string, adapterOrId: string): Promise<void>;
syncAll(user: User | string): Promise<void>;
registration(user: string | User, adapterOrId: string): Promise<UserBonusProgram>;
delete(user: string | User, adapterOrId: string): Promise<void>;
syncAll(user: string | User): Promise<void>;
/** Full sync all transaction with external system */
sync(user: User | string, bonusProgram: BonusProgram | string, force?: boolean): Promise<void>;
checkEnoughToSpend(user: User | string, bonusProgram: BonusProgram | string, amount: number): Promise<boolean>;
sumCurrentBalance(user: User | string, bonusProgram: BonusProgram | string): Promise<number>;
sync(user: string | User, bonusProgram: string | BonusProgram, force?: boolean): Promise<void>;
checkEnoughToSpend(user: string | User, bonusProgram: string | BonusProgram, amount: number): Promise<boolean>;
sumCurrentBalance(user: string | User, bonusProgram: string | BonusProgram): Promise<number>;
};
declare global {
const UserBonusProgram: typeof Model & ORMModel<UserBonusProgram, "user" | "bonusProgram">;
Expand Down

0 comments on commit 131ebf0

Please sign in to comment.