UNPKG

@tomei/live-price

Version:

Tomei live-price Package

66 lines (65 loc) 2.76 kB
import { ObjectBase } from '@tomei/general'; import { ITomeiPriceHistoryFindAllAttr, ITomeiPriceHistoryAttr } from '../../interfaces/price-tomei-price-history-attr.interface'; import { LoginUser } from '@tomei/sso'; import { IFeedHistoryAttr } from '../../interfaces'; import { NonSourceFeedName } from '../../enum/feed.enum'; export declare class TomeiPriceHistory extends ObjectBase implements ITomeiPriceHistoryAttr { ObjectId: string; ObjectName: string; ObjectType: string; TableName: string; FeedHistoryId: string; FeedName: NonSourceFeedName; DateTime: Date; AdjustBuyPercentage: number; AdjustSellPercentage: number; TomeiBuyPrice: number; TomeiSellPrice: number; AdjustedById: string; Currency: string; AdjustedDateTime: Date; IsManualPriceActivatedYN: string; BuyLabourCharges: number; SellLabourCharges: number; CompanyCode: string; private static logger; get TomeiPriceHistoryId(): string; set TomeiPriceHistoryId(value: string); private static _Repo; private static _LatestRepo; private constructor(); static init(dbTransaction?: any, tomeiPriceHistoryId?: string): Promise<TomeiPriceHistory>; saveTomeiPrice(feedName: NonSourceFeedName, feedHistory: IFeedHistoryAttr, loginUser?: LoginUser, adjustmentPercentage?: { adjustBuyPercentage: number; adjustSellPercentage: number; buyLabourCharges: number; sellLabourCharges: number; }, manualPrice?: { buyPrice: number; sellPrice: number; }, companyCode?: string, dbTransaction?: any): Promise<TomeiPriceHistory>; private static upsertTomeiPriceLatest; private calculateTomeiPrices; private applyManualPrice; private getFeedManualPrice; private applyFeedManualPrice; private calculatePriceFromFeed; private applyPricingLogic; static getLatestPrice(feedName: NonSourceFeedName, currency: string, companyCode?: string, timestamp?: Date, dbTransaction?: any): Promise<ITomeiPriceHistoryAttr | null>; static getLatestPriceRequired(feedName: NonSourceFeedName, currency: string, companyCode?: string, timestamp?: Date, dbTransaction?: any): Promise<ITomeiPriceHistoryAttr>; private static getClosestHistoricalPrice; private static getFromLatestTable; private static getMostRecentHistoricalPrice; static findAll(page: number, row: number, feedName: NonSourceFeedName, search?: { DateTime: { startDate: Date; endDate: Date; withManualHistory?: boolean; withCutOffHistory?: boolean; }; CompanyCode?: string; }, dbTransaction?: any): Promise<{ rows: ITomeiPriceHistoryFindAllAttr[]; count: number; }>; }