Hide email controls when no email on file; show SMS hint for quote/job events

- Quotes Create/Edit: hide 'Send via email' checkbox when customer has no
  email; show badge 'send via SMS from details' or 'SMS consent required'
  when customer has a mobile number. JS responds to customer dropdown change.
- Quotes Details: hide 'Send Quote via Email' button and approval email
  checkbox; hide SMS button when no mobile; show consent-required note.
- Jobs Details (Mark Complete modal): hide email checkbox; show
  'SMS notification will be sent' badge or consent-required note.
- Jobs Index (status modal): hide email row when customer has no email.
- Jobs Edit: hide 'Notify customer if status changes' when no email.
- Invoices Details: hide Send/Re-send buttons when no email (vs. disabled).

DTOs: added CustomerEmail + CustomerNotifyByEmail to JobDto/JobListDto;
added CustomerNotifyByEmail/CustomerMobilePhone/CustomerNotifyBySms to
QuoteDto. Mapped in JobProfile and QuotesController customer blocks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 17:32:08 -04:00
parent d3863c713b
commit acbd9f60be
1190 changed files with 338016 additions and 88 deletions
+108
View File
@@ -0,0 +1,108 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var testTools_exports = {};
__export(testTools_exports, {
debugTest: () => debugTest,
listTests: () => listTests,
runTests: () => runTests
});
module.exports = __toCommonJS(testTools_exports);
var import_zodBundle = require("playwright-core/lib/zodBundle");
var import_listModeReporter = __toESM(require("../../reporters/listModeReporter"));
var import_testTool = require("./testTool");
const listTests = (0, import_testTool.defineTestTool)({
schema: {
name: "test_list",
title: "List tests",
description: "List tests",
inputSchema: import_zodBundle.z.object({}),
type: "readOnly"
},
handle: async (context) => {
const { testRunner, screen, output } = await context.createTestRunner();
const reporter = new import_listModeReporter.default({ screen, includeTestId: true });
await testRunner.listTests(reporter, {});
return { content: output.map((text) => ({ type: "text", text })) };
}
});
const runTests = (0, import_testTool.defineTestTool)({
schema: {
name: "test_run",
title: "Run tests",
description: "Run tests",
inputSchema: import_zodBundle.z.object({
locations: import_zodBundle.z.array(import_zodBundle.z.string()).optional().describe('Folder, file or location to run: "test/e2e" or "test/e2e/file.spec.ts" or "test/e2e/file.spec.ts:20"'),
projects: import_zodBundle.z.array(import_zodBundle.z.string()).optional().describe('Projects to run, projects from playwright.config.ts, by default runs all projects. Running with "chromium" is a good start')
}),
type: "readOnly"
},
handle: async (context, params) => {
const { output } = await context.runTestsWithGlobalSetupAndPossiblePause({
locations: params.locations ?? [],
projects: params.projects,
disableConfigReporters: true
});
return { content: [{ type: "text", text: output }] };
}
});
const debugTest = (0, import_testTool.defineTestTool)({
schema: {
name: "test_debug",
title: "Debug single test",
description: "Debug single test",
inputSchema: import_zodBundle.z.object({
test: import_zodBundle.z.object({
id: import_zodBundle.z.string().describe("Test ID to debug."),
title: import_zodBundle.z.string().describe("Human readable test title for granting permission to debug the test.")
})
}),
type: "readOnly"
},
handle: async (context, params) => {
const { output, status } = await context.runTestsWithGlobalSetupAndPossiblePause({
headed: context.computedHeaded,
locations: [],
// we can make this faster by passing the test's location, so we don't need to scan all tests to find the ID
testIds: [params.test.id],
// For automatic recovery
timeout: 0,
workers: 1,
pauseOnError: true,
disableConfigReporters: true,
actionTimeout: 5e3
});
return { content: [{ type: "text", text: output }], isError: status !== "paused" && status !== "passed" };
}
});
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
debugTest,
listTests,
runTests
});