@jjlmoya/utils-finance 1.46.0 → 1.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/src/category/index.ts +2 -1
  3. package/src/entries.ts +4 -1
  4. package/src/tests/locale_completeness.test.ts +2 -2
  5. package/src/tests/tool_validation.test.ts +2 -2
  6. package/src/tool/loanAprScenarioCalculator/bibliography.astro +11 -0
  7. package/src/tool/loanAprScenarioCalculator/bibliography.ts +29 -0
  8. package/src/tool/loanAprScenarioCalculator/component.astro +62 -0
  9. package/src/tool/loanAprScenarioCalculator/controller.ts +205 -0
  10. package/src/tool/loanAprScenarioCalculator/currency-dom.ts +107 -0
  11. package/src/tool/loanAprScenarioCalculator/currency.test.ts +57 -0
  12. package/src/tool/loanAprScenarioCalculator/currency.ts +105 -0
  13. package/src/tool/loanAprScenarioCalculator/dom-views.ts +190 -0
  14. package/src/tool/loanAprScenarioCalculator/entry.ts +28 -0
  15. package/src/tool/loanAprScenarioCalculator/evaluator.ts +21 -0
  16. package/src/tool/loanAprScenarioCalculator/i18n/de.ts +194 -0
  17. package/src/tool/loanAprScenarioCalculator/i18n/en.ts +194 -0
  18. package/src/tool/loanAprScenarioCalculator/i18n/es.ts +195 -0
  19. package/src/tool/loanAprScenarioCalculator/i18n/fr.ts +195 -0
  20. package/src/tool/loanAprScenarioCalculator/i18n/id.ts +193 -0
  21. package/src/tool/loanAprScenarioCalculator/i18n/it.ts +193 -0
  22. package/src/tool/loanAprScenarioCalculator/i18n/ja.ts +186 -0
  23. package/src/tool/loanAprScenarioCalculator/i18n/ko.ts +186 -0
  24. package/src/tool/loanAprScenarioCalculator/i18n/nl.ts +194 -0
  25. package/src/tool/loanAprScenarioCalculator/i18n/pl.ts +194 -0
  26. package/src/tool/loanAprScenarioCalculator/i18n/pt.ts +194 -0
  27. package/src/tool/loanAprScenarioCalculator/i18n/ru.ts +193 -0
  28. package/src/tool/loanAprScenarioCalculator/i18n/sv.ts +189 -0
  29. package/src/tool/loanAprScenarioCalculator/i18n/tr.ts +193 -0
  30. package/src/tool/loanAprScenarioCalculator/i18n/zh.ts +181 -0
  31. package/src/tool/loanAprScenarioCalculator/index.ts +11 -0
  32. package/src/tool/loanAprScenarioCalculator/loan-apr-scenario-calculator.css +699 -0
  33. package/src/tool/loanAprScenarioCalculator/logic.test.ts +65 -0
  34. package/src/tool/loanAprScenarioCalculator/logic.ts +259 -0
  35. package/src/tool/loanAprScenarioCalculator/presets.ts +51 -0
  36. package/src/tool/loanAprScenarioCalculator/scenario-dom.ts +101 -0
  37. package/src/tool/loanAprScenarioCalculator/seo.astro +11 -0
  38. package/src/tool/loanAprScenarioCalculator/storage.ts +60 -0
  39. package/src/tool/loanAprScenarioCalculator/ui.ts +55 -0
  40. package/src/tool/loanAprScenarioCalculator/validation.ts +24 -0
  41. package/src/tools.ts +2 -1
@@ -0,0 +1,181 @@
1
+ import type { ToolLocaleContent } from "../../../types";
2
+ import { bibliography } from "../bibliography";
3
+ import type { LoanAprScenarioCalculatorUI } from "../ui";
4
+
5
+ const ui: LoanAprScenarioCalculatorUI = {
6
+ labelScenarioA: "方案 A",
7
+ labelScenarioB: "方案 B",
8
+ labelScenarioName: "方案名称",
9
+ labelCurrency: "货币",
10
+ labelApproximateRates: "用于规划的近似换算系数,不是实时汇率。",
11
+ labelPrincipal: "借款金额",
12
+ labelTerm: "还款期限",
13
+ labelMonths: "个月",
14
+ labelInputBasis: "你知道哪些数据?",
15
+ labelAnnualRate: "名义年利率",
16
+ labelMonthlyPayment: "已知月供",
17
+ labelUpfrontFees: "前期费用",
18
+ labelMonthlyFees: "月度费用",
19
+ labelFinalFees: "最后费用",
20
+ labelOfferNameA: "方案 A",
21
+ labelOfferNameB: "方案 B",
22
+ labelRateMode: "我知道利率",
23
+ labelPaymentMode: "我知道月供",
24
+ labelPreset: "开始比较",
25
+ labelPresetBalanced: "均衡方案",
26
+ labelPresetLowFee: "低利率加费用",
27
+ labelPresetLongTerm: "更长期限",
28
+ labelReset: "重置数值",
29
+ labelCopy: "复制比较结果",
30
+ labelCopied: "已复制比较结果",
31
+ labelEffectiveApr: "有效年度成本",
32
+ labelNominalRate: "名义利率",
33
+ labelMonthlyPaymentResult: "月供",
34
+ labelTotalPaid: "总支付",
35
+ labelTotalFees: "场景费用",
36
+ labelFinanceCost: "超过本金的成本",
37
+ labelNetCashReceived: "扣除前期费用后的到账金额",
38
+ labelWinner: "哪个方案成本更低?",
39
+ labelLowerCost: "有效成本更低",
40
+ labelHigherCost: "有效成本更高",
41
+ labelTie: "几乎相同",
42
+ labelNeedValidInputs: "需要有效数据",
43
+ labelInvalidPrincipal: "借款金额必须大于零,并且高于前期费用。",
44
+ labelInvalidTerm: "请输入1到600个月之间的整数期限。",
45
+ labelInvalidFees: "费用不能为负数。",
46
+ labelInvalidPayment: "请输入能够偿还到账净额的正数月供。",
47
+ labelInvalidRate: "请输入0%到100%之间的名义年利率。",
48
+ labelNoComparison: "请填写两个方案后再比较。",
49
+ labelTimeline: "付款时间线",
50
+ labelStart: "开始",
51
+ labelMonthly: "每月",
52
+ labelEnd: "最后一个月",
53
+ labelFormula: "比较方式",
54
+ labelFormulaText:
55
+ "有效年度成本是将月利率年化后的结果,它使到账金额等于折现后的付款和费用。",
56
+ labelApproximation:
57
+ "估算假设月供相同、没有宽限期,并且只包含你输入的费用。它不能替代贷款机构提供的正式 APR。",
58
+ labelScenarioSummary: "场景摘要",
59
+ currencyCode: "CNY",
60
+ currencyLocale: "zh-CN",
61
+ };
62
+
63
+ const faq = [
64
+ {
65
+ question: "利率和有效年度成本有什么区别?",
66
+ answer:
67
+ "名义利率描述余额产生的利息。有效年度成本还会反映你输入的前期、月度和最后费用的金额与发生时间。",
68
+ },
69
+ {
70
+ question: "可以输入月供而不是利率吗?",
71
+ answer:
72
+ "可以。请为该方案选择已知月供,计算器会根据到账金额、付款流和费用推算相应的月利率。",
73
+ },
74
+ {
75
+ question: "哪个方案更便宜?",
76
+ answer:
77
+ "先比较有效年度成本,再查看总支付和到账金额。如果期限或金额不同,百分比较低的方案仍可能有更高的总成本。",
78
+ },
79
+ {
80
+ question: "这是贷款机构的正式 APR 吗?",
81
+ answer:
82
+ "不是。这是根据输入数据得出的透明场景估算。不同贷款机构和地区可能以不同方式计算税费、保险、付款日期和其他成本。",
83
+ },
84
+ ];
85
+
86
+ const howTo = [
87
+ {
88
+ name: "输入金额和期限",
89
+ text: "为每个方案输入预计到账金额和月度还款次数。",
90
+ },
91
+ { name: "选择已知数据", text: "根据方案资料输入名义年利率或月供。" },
92
+ {
93
+ name: "加入所有费用",
94
+ text: "输入开始时、每月和最后产生的费用,以反映完整现金流。",
95
+ },
96
+ {
97
+ name: "阅读比较结果",
98
+ text: "使用有效年度成本比较,并在决定前查看总支付和到账金额。",
99
+ },
100
+ ];
101
+
102
+ const schemas = [
103
+ {
104
+ "@context": "https://schema.org",
105
+ "@type": "SoftwareApplication",
106
+ name: "贷款 APR 场景计算器",
107
+ description: "比较包含利率、月供和费用的两个贷款场景。",
108
+ applicationCategory: "FinanceApplication",
109
+ operatingSystem: "All",
110
+ offers: { "@type": "Offer", price: "0", priceCurrency: "CNY" },
111
+ },
112
+ {
113
+ "@context": "https://schema.org",
114
+ "@type": "FAQPage",
115
+ mainEntity: faq.map((item) => ({
116
+ "@type": "Question",
117
+ name: item.question,
118
+ acceptedAnswer: { "@type": "Answer", text: item.answer },
119
+ })),
120
+ },
121
+ {
122
+ "@context": "https://schema.org",
123
+ "@type": "HowTo",
124
+ name: "比较两个贷款方案",
125
+ description: "建立两个贷款的现金流并比较有效年度成本。",
126
+ step: howTo.map((step, index) => ({
127
+ "@type": "HowToStep",
128
+ position: index + 1,
129
+ name: step.name,
130
+ text: step.text,
131
+ })),
132
+ },
133
+ ];
134
+
135
+ export const content: ToolLocaleContent<LoanAprScenarioCalculatorUI> = {
136
+ slug: "loan-apr-scenario-calculator",
137
+ title: "贷款 APR 场景计算器",
138
+ description:
139
+ "比较两个贷款方案的利率、还款安排和费用,在决定前估算有效年度成本。",
140
+ ui,
141
+ faq,
142
+ bibliography,
143
+ howTo,
144
+ schemas,
145
+ seo: [
146
+ { type: "title", text: "按有效年度成本比较贷款", level: 2 },
147
+ {
148
+ type: "paragraph",
149
+ html: "<p>较低的广告利率可能隐藏手续费、月度服务费或最后费用。这个计算器会把两个方案的细节转换为可比较的现金流,让你看到实际到账资金的成本。</p>",
150
+ },
151
+ { type: "title", text: "估算包含哪些内容", level: 3 },
152
+ {
153
+ type: "paragraph",
154
+ html: "<p>为每个方案输入借款金额、期限、名义年利率或已知月供,以及不同时间产生的费用。计算器会找到使到账净额与折现后的付款和费用相平衡的月利率,然后将其年化。</p>",
155
+ },
156
+ {
157
+ type: "paragraph",
158
+ html: "<p>这样比较的不只是利率本身。正式 APR 可能遵循地区规则并包含你没有输入的假设,因此这里的结果明确属于估算。</p>",
159
+ },
160
+ { type: "title", text: "如何阅读结果", level: 3 },
161
+ {
162
+ type: "list",
163
+ items: [
164
+ "当金额和期限接近时,比较有效年度成本。",
165
+ "查看总支付,了解实际现金影响。",
166
+ "查看扣除前期费用后的到账金额。",
167
+ "使用付款时间线了解每项费用何时发生。",
168
+ ],
169
+ },
170
+ {
171
+ type: "tip",
172
+ title: "最终请以贷款文件为准",
173
+ html: "<p>比较真实合同时,请用相同假设核对贷款机构的 APR。确认保险、税费、浮动利率、提前还款费用以及未输入的收费。</p>",
174
+ },
175
+ { type: "title", text: "场景估算的限制", level: 3 },
176
+ {
177
+ type: "paragraph",
178
+ html: "<p>工具假设月供相同、没有宽限期,并只处理开始时、期限中或最后一个月的费用。它不能证明负担能力、审批结果、合法性或产品的正式 APR。</p>",
179
+ },
180
+ ],
181
+ };
@@ -0,0 +1,11 @@
1
+ import type { ToolDefinition } from "../../types";
2
+ import { loanAprScenarioCalculator } from "./entry";
3
+
4
+ export * from "./entry";
5
+
6
+ export const LOAN_APR_SCENARIO_CALCULATOR_TOOL: ToolDefinition = {
7
+ entry: loanAprScenarioCalculator,
8
+ Component: () => import("./component.astro"),
9
+ SEOComponent: () => import("./seo.astro"),
10
+ BibliographyComponent: () => import("./bibliography.astro"),
11
+ };