@hyperscale0/hsx 1.0.338 → 1.0.340

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 (43) hide show
  1. package/dist/src/ast.d.ts +1 -0
  2. package/dist/src/ast.d.ts.map +1 -1
  3. package/dist/src/ast.js.map +1 -1
  4. package/dist/src/attachment-economics.d.ts +19 -0
  5. package/dist/src/attachment-economics.d.ts.map +1 -1
  6. package/dist/src/attachment-economics.js +101 -3
  7. package/dist/src/attachment-economics.js.map +1 -1
  8. package/dist/src/binding-contract.d.ts.map +1 -1
  9. package/dist/src/binding-contract.js +10 -4
  10. package/dist/src/binding-contract.js.map +1 -1
  11. package/dist/src/compile.d.ts.map +1 -1
  12. package/dist/src/compile.js +36 -8
  13. package/dist/src/compile.js.map +1 -1
  14. package/dist/src/examples-bundle.js +1 -1
  15. package/dist/src/examples-bundle.js.map +1 -1
  16. package/dist/src/headers.d.ts.map +1 -1
  17. package/dist/src/headers.js +3 -1
  18. package/dist/src/headers.js.map +1 -1
  19. package/dist/src/parse.js +13 -1
  20. package/dist/src/parse.js.map +1 -1
  21. package/dist/src/std-bundle.js +6 -6
  22. package/dist/src/std-bundle.js.map +1 -1
  23. package/dist/src/template-guide.d.ts.map +1 -1
  24. package/dist/src/template-guide.js +2 -1
  25. package/dist/src/template-guide.js.map +1 -1
  26. package/docs/README.md +5 -2
  27. package/examples/camera-rental.hsx +4 -2
  28. package/package.json +4 -4
  29. package/src/ast.ts +7 -1
  30. package/src/attachment-economics.ts +127 -2
  31. package/src/binding-contract.ts +13 -6
  32. package/src/compile.ts +63 -9
  33. package/src/examples-bundle.ts +1 -1
  34. package/src/headers.ts +6 -1
  35. package/src/parse.ts +16 -1
  36. package/src/std-bundle.ts +6 -6
  37. package/src/template-guide.ts +2 -1
  38. package/std/collections.hsx +4 -4
  39. package/std/financing.hsx +461 -266
  40. package/std/insurance.hsx +21 -5
  41. package/std/lending.hsx +13 -9
  42. package/std/money.hsx +88 -32
  43. package/std/reporting.hsx +6 -6
@@ -460,7 +460,8 @@ function valueMeaning(
460
460
  : []),
461
461
  ...(set.length
462
462
  ? [
463
- `Sets ${set.map((entry) => `${entry.key}: ${fieldValue(entry, spell)}`).join(", ")}.`,
463
+ // Two branches can set one field the same way.
464
+ `Sets ${[...new Set(set.map((entry) => `${entry.key}: ${fieldValue(entry, spell)}`))].join(", ")}.`,
464
465
  ]
465
466
  : []),
466
467
  ...(uses.length ? [`Read by ${uses.slice(0, 6).join("; ")}.`] : []),
@@ -26,7 +26,7 @@ instrument case(on: ref<financing.installments>[], agency: party, capital: party
26
26
  action create {
27
27
  due: { at: self.eligibleAt }
28
28
  requires self.plan == self.slice.plan
29
- requires self.slice.principalReceivable.balance > "0"
29
+ requires self.slice.openPrincipal > "0"
30
30
  requires unique "overdue_referral" on [self.slice]
31
31
  }
32
32
  action assign { from: opened, to: assigned, actor: { party: capital } }
@@ -74,17 +74,17 @@ instrument reminder(on: ref<financing.installments>[], operator: party = program
74
74
  action before_due {
75
75
  from: ready, to: ready, actor: clock
76
76
  due: { at: self.slice.dueAt, localDay: { days: before_days, direction: "before", hour: send_from, timezone: timezone } }
77
- invoke: [{ selection: { instrument: current(), reference: "slice", anchor: self.slice, states: [ready], limit: 1, where: { slice.plan.status: { literal: "active" } } }, action: send, guard: { kind: compare, left: { field: self.slice.principalReceivable.balance }, operator: ">", right: { literal: "0" } }, input: {} }]
77
+ invoke: [{ selection: { instrument: current(), reference: "slice", anchor: self.slice, states: [ready], limit: 1, where: { slice.plan.status: { literal: "active" } } }, action: send, guard: { kind: compare, left: { field: self.slice.openPrincipal }, operator: ">", right: { literal: "0" } }, input: {} }]
78
78
  }
79
79
  action overdue {
80
80
  from: ready, to: ready, actor: clock
81
81
  due: { at: self.slice.dueAt, localDay: { days: overdue_days, direction: "after", hour: send_from, timezone: timezone } }
82
- invoke: [{ selection: { instrument: current(), reference: "slice", anchor: self.slice, states: [ready], limit: 1, where: { slice.plan.status: { literal: "active" } } }, action: send, guard: { kind: compare, left: { field: self.slice.principalReceivable.balance }, operator: ">", right: { literal: "0" } }, input: {} }]
82
+ invoke: [{ selection: { instrument: current(), reference: "slice", anchor: self.slice, states: [ready], limit: 1, where: { slice.plan.status: { literal: "active" } } }, action: send, guard: { kind: compare, left: { field: self.slice.openPrincipal }, operator: ">", right: { literal: "0" } }, input: {} }]
83
83
  }
84
84
  action send {
85
85
  from: ready, to: ready, actor: { parent: current() }
86
86
  requires self.slice.plan in [active]
87
- requires self.slice.principalReceivable.balance > "0"
87
+ requires self.slice.openPrincipal > "0"
88
88
  reminder: { installment: self.slice, recipient: self.slice.plan.borrower, dueAt: self.slice.dueAt, channel: "email", template: "payment_reminder", beforeDays: before_days, overdueDays: overdue_days, maxPerDay: max_per_day, startHour: send_from, endHour: send_until, timezone: timezone }
89
89
  }
90
90
  }