Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/services/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export const NOTIFICATION_KINDS = {
}),
work_order_renewed: (p) => ({
title: `Work Order ${p.code} is renewed as ${p.nextCode}`,
body: `Work Order ${p.code} on ${p.projectTitle} continues as ${p.nextCode} for ${p.period}, with the same terms.`,
body: `Work Order ${p.code} on ${p.projectTitle} continues as ${p.nextCode} for ${p.period}, with the same terms, once it's signed.`,
}),
work_order_renewal_needs_approval: (p) => ({
title: `Renewal of ${p.code} needs your decision`,
Expand Down
2 changes: 1 addition & 1 deletion api/src/services/work-orders/documents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function documentFields(input: {
repos: input.repos.join(", "),
auto_renew: box(input.autoRenew),
auto_renew_text: input.autoRenew
? "This work order renews monthly, with the same terms, while the base metrics are met; otherwise the representative decides whether it renews."
? "When the base metrics are met, a work order for the next month with the same terms is sent for signature; otherwise the representative decides whether to send one. Each renewal starts only once both parties sign it."
: "",
contractor_email: input.contractorEmail ?? "",
representative_email: input.representativeEmail ?? "",
Expand Down
13 changes: 9 additions & 4 deletions api/src/services/work-orders/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ export function createWorkOrdersService(deps: WorkOrderDeps) {
["Work period", `${longDate(row.periodStart)} to ${longDate(row.periodEnd)}`],
[
"Budget cap",
`${display(row.budgetAmount, row.tokenId)}${row.tokenId === USD ? ", paid in NEAR at the price when each payment is made" : ""}`,
`${display(row.budgetAmount, row.tokenId)}${row.tokenId === USD ? ", paid in NEAR at the price when each payment is started" : ""}`,
],
["Payout account (NEAR)", row.builderNearAccount],
["GitHub account", row.githubLogin ?? ""],
Expand All @@ -911,13 +911,17 @@ export function createWorkOrdersService(deps: WorkOrderDeps) {
[
"Monthly renewal",
row.autoRenew
? "Renews monthly, with the same terms, while the base metrics are met; otherwise the representative decides."
? "A work order for the next month with the same terms is sent for signature when the base metrics are met; otherwise the representative decides."
: "No",
],
[
"How work counts",
"Work counts once the repository owner approves or merges it on GitHub. The budget is a maximum, not a guarantee; each payment follows an approved compensation request.",
],
[
"Governing agreement",
"This work order is governed by and incorporated into the services agreement between the builder and the Agency, which controls in a conflict.",
],
];
}

Expand All @@ -943,8 +947,9 @@ export function createWorkOrdersService(deps: WorkOrderDeps) {
pdf = await termsPdf({
title: `Work Order ${row.code}`,
rows: await termsRows(row),
footer:
"Signed electronically in MultiAgency: each party reviews this document and signs it with their typed name; the builder signs in with the NEAR account above.",
footer: deps.esign
? "Signed electronically through Documenso: the Agency representative signs first, then the builder, each from their own signing link."
: "Signed electronically in MultiAgency: each party reviews this document and signs it with their typed name; the builder signs in with the NEAR account above.",
});
}
const sha256 = sha256Bytes(pdf);
Expand Down
5 changes: 5 additions & 0 deletions api/tests/integration/work-orders.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,8 @@ describe("work orders", () => {
"carol-gh",
REPO,
"Rita Rep",
"Governing agreement",
"typed name",
]) {
expect(text).toContain(part);
}
Expand Down Expand Up @@ -1419,6 +1421,9 @@ describe("work orders", () => {
const pages = (await PDFDocument.load(doc.pdf)).getPageCount();
expect(doc.signers[0]?.signature.page).toBe(pages);
expect(doc.signers[1]?.signature.y).toBeGreaterThan(doc.signers[0]?.signature.y ?? 100);
const text = await pdfText(doc.pdf.slice());
expect(text).toContain("through Documenso");
expect(text).not.toContain("typed name");
const offeredDoc = await service.document(await studio(), { id: created.id });
expect(offeredDoc.sha256).toBe(createHash("sha256").update(doc.pdf).digest("hex"));
expect(events.map((e) => e.type)).not.toContain("work_order.offered");
Expand Down
8 changes: 4 additions & 4 deletions ui/src/components/work-orders/renewal-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ export function RenewalPanel({
<h2>Monthly renewal</h2>
</CardTitle>
<CardDescription>
Checked after {workOrder.periodEnd} + {workOrder.graceDays} grace days. Renews by itself
if every base metric is met; otherwise you decide.
Checked after {workOrder.periodEnd} + {workOrder.graceDays} grace days. If every base
metric is met, next month's work order is sent for signature; otherwise you decide.
</CardDescription>
</CardHeader>
</Card>
Expand Down Expand Up @@ -152,8 +152,8 @@ function DecideRenewal({ workOrder }: { workOrder: WorkOrder }) {
<AlertTitle>Renewal needs your decision</AlertTitle>
<AlertDescription className="flex flex-col gap-3">
<span>
Renew with the same terms, or let {workOrder.code} end here. The builder is told either
way.
Renew to send next month's work order for signature, or let {workOrder.code} end here. The
builder is told either way.
</span>
<Input
aria-label="Note (optional)"
Expand Down
5 changes: 3 additions & 2 deletions ui/src/components/work-orders/work-order-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,9 @@ function WorkOrderFields({
<FieldLabel htmlFor="wo-renew" className="flex flex-col items-start">
<span>Renew monthly when the base metrics are met</span>
<span className="text-xs font-normal text-muted-foreground">
Each period is measured at its end. All met: next month's work order starts by
itself. Any missed: you decide. Part of the accepted terms.
Each period is measured at its end. All met: next month's work order is sent for
signature. Any missed: you decide. It starts once the representative and the
builder sign it.
</span>
</FieldLabel>
</ShadcnField>
Expand Down
Loading