本文整理汇总了TypeScript中response/form/models/statement-of-means/expenseSource.ExpenseSource类的典型用法代码示例。如果您正苦于以下问题:TypeScript ExpenseSource类的具体用法?TypeScript ExpenseSource怎么用?TypeScript ExpenseSource使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ExpenseSource类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should return a new instance initialised with set fields from object parameter provided', () => {
expect(ExpenseSource.fromObject('name', SAMPLE_MONTHLY_EXPENSE_SOURCE_FROM_OBJECT)).to.deep.equal(
new ExpenseSource(
'name',
100,
IncomeExpenseSchedule.MONTH
)
)
})
示例2: resetExpense
resetExpense (propertyName: string, source: ExpenseSource): void {
this[`${propertyName.split('.')[0]}Declared`] = false
source.reset()
}
示例3:
.map(source => ExpenseSource.fromObject(source.name, source))
示例4: fromObject
static fromObject (value?: any): MonthlyExpenses {
if (!value) {
return value
}
return new MonthlyExpenses(
value.mortgageDeclared, ExpenseSource.fromObject(MonthlyExpenseType.MORTGAGE.displayValue, value.mortgage),
value.rentDeclared, ExpenseSource.fromObject(MonthlyExpenseType.RENT.displayValue, value.rent),
value.councilTaxDeclared, ExpenseSource.fromObject(MonthlyExpenseType.COUNCIL_TAX.displayValue, value.councilTax),
value.gasDeclared, ExpenseSource.fromObject(MonthlyExpenseType.GAS.displayValue, value.gas),
value.electricityDeclared, ExpenseSource.fromObject(MonthlyExpenseType.ELECTRICITY.displayValue, value.electricity),
value.waterDeclared, ExpenseSource.fromObject(MonthlyExpenseType.WATER.displayValue, value.water),
value.travelDeclared, ExpenseSource.fromObject(MonthlyExpenseType.TRAVEL.displayValue, value.travel),
value.schoolCostsDeclared, ExpenseSource.fromObject(MonthlyExpenseType.SCHOOL_COSTS.displayValue, value.schoolCosts),
value.foodAndHousekeepingDeclared, ExpenseSource.fromObject(MonthlyExpenseType.FOOD_HOUSEKEEPING.displayValue, value.foodAndHousekeeping),
value.tvAndBroadbandDeclared, ExpenseSource.fromObject(MonthlyExpenseType.TV_AND_BROADBAND.displayValue, value.tvAndBroadband),
value.hirePurchaseDeclared, ExpenseSource.fromObject(MonthlyExpenseType.HIRE_PURCHASES.displayValue, value.hirePurchase),
value.mobilePhoneDeclared, ExpenseSource.fromObject(MonthlyExpenseType.MOBILE_PHONE.displayValue, value.mobilePhone),
value.maintenanceDeclared, ExpenseSource.fromObject(MonthlyExpenseType.MAINTENANCE_PAYMENTS.displayValue, value.maintenance),
value.otherDeclared, value.other && value.other
.map(source => ExpenseSource.fromObject(source.name, source))
.filter(source => source !== undefined)
)
}