Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-09-21 18:57:22 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-09-21 18:57:22 -0400
commitd9bef9d0289c0702e1665fc3f3fc5b94ee8d2138 (patch)
tree129cd95cd31ead0679cfdf86ce8462a43a51fbfe
parent7831751d5e114c767ed502327f20b81b96b4998a (diff)
downloadtame-d9bef9d0289c0702e1665fc3f3fc5b94ee8d2138.tar.gz
tame-d9bef9d0289c0702e1665fc3f3fc5b94ee8d2138.tar.bz2
tame-d9bef9d0289c0702e1665fc3f3fc5b94ee8d2138.zip
insurance (_premium_): Add @yields@
* core/insurance.xml (_premium_)[@yields@]: New param with validations. Will enforce naming conventions. Update TODOs.
-rw-r--r--core/insurance.xml27
1 files changed, 22 insertions, 5 deletions
diff --git a/core/insurance.xml b/core/insurance.xml
index de12f6d..c77e959 100644
--- a/core/insurance.xml
+++ b/core/insurance.xml
@@ -37,12 +37,10 @@
Some notable TODOs:
\begin{enumerate}
- \item Enforce naming convention;
\item Support scalar results;
\item Fail on zero premium unless explicitly stated;
- \item Fail on negative premium (use a credit template);
- \item Rounding direction (currently only nearest); and
- \item Credit and surcharge.
+ \item Fail on negative premium (use a credit template); and
+ \item Rounding direction (currently only nearest).
\end{enumerate}
\todo{Template to abstract these {\tt rate-each} generation
@@ -67,6 +65,25 @@
<text></text>
</param>
+ <param name="@yields@" desc="Yield (optional)">
+ <text></text>
+ </param>
+
+ <!-- at least one of generates or yields is required -->
+ <if name="@yields@" eq="">
+ <if name="@generates@" eq="">
+ <error>must provide at least one of @generates or @yields</error>
+ </if>
+ </if>
+
+ <unless name="@generates@" eq="">
+ <t:naming-convention name="@generates@" prefix="prem" />
+ </unless>
+
+ <unless name="@yields@" eq="">
+ <t:naming-convention name="@yields@" prefix="prem" />
+ </unless>
+
<!-- required since various companies have various bizzare
rounding rules that tend to be a source of bugs; make the
developer think about it -->
@@ -77,7 +94,7 @@
<param name="@desc@" desc="Premium description" />
- <rate-each class="@class@" no="@no@"
+ <rate-each class="@class@" no="@no@" yields="@yields@"
generates="@generates@" index="@index@"
sym="@sym@" gensym="@gensym@">
<!-- TODO: we now have reason for a more concise conditional