You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/samples/playground.ts
+49-28Lines changed: 49 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -6,79 +6,100 @@ concept ServiceItem {
6
6
o Integer quantity
7
7
}
8
8
9
+
concept Compensation {
10
+
o ServiceItem[] services
11
+
o Integer paymentTerms
12
+
}
13
+
9
14
@template
10
15
concept ServiceAgreement {
11
16
o String clientName
12
17
o String clientAddress
13
18
o String providerName
14
19
o String providerAddress
15
20
o DateTime effectiveDate
16
-
o ServiceItem[] services
17
-
o Integer paymentTerms
21
+
o Compensation compensation
18
22
}`;
19
23
20
24
constTEMPLATE=`# SERVICE AGREEMENT
21
25
22
-
This Service Agreement is made and entered into as of {{effectiveDate as "D MMMM YYYY"}} by and between {{clientName}}, located at {{clientAddress}} (Client), and {{providerName}}, located at {{providerAddress}} (SProvider).
26
+
This Service Agreement is made and entered into as of
27
+
{{effectiveDate as "D MMMM YYYY"}}
28
+
by and between {{clientName}}, located at {{clientAddress}} (Client),
29
+
and {{providerName}}, located at {{providerAddress}} (Provider).
30
+
31
+
---
23
32
24
33
## 1. Services
25
34
26
-
Provider shall perform the following services for Client:
35
+
{{#clause compensation}}
36
+
### Services Provided
27
37
28
38
{{#ulist services}}
29
39
- {{description}} at {{rate as "0.00"}} per unit × {{quantity}}
30
40
{{/ulist}}
31
41
32
-
## 2. Compensation
42
+
### Payment Terms
43
+
Payment is due within {{paymentTerms}} days of invoice.
44
+
{{/clause}}
45
+
46
+
---
33
47
34
-
In consideration for the services provided, Client shall pay Provider the total amount calculated below:
48
+
## 2. Total Compensation
35
49
36
50
**Total Service Value:** {{%
37
-
return '$' + services
51
+
return '$' + compensation.services
38
52
.map(s => s.rate * s.quantity)
39
53
.reduce((sum, cur) => sum + cur, 0)
40
54
.toFixed(2);
41
55
%}}
42
56
43
-
Payment is due within {{paymentTerms}} days of invoice.
57
+
---
44
58
45
59
## 3. Execution
46
60
47
-
IN WITNESS WHEREOF, the parties hereto have executed this Agreement as of the date first written above.
61
+
IN WITNESS WHEREOF, the parties hereto have executed this Agreement.
0 commit comments