@clipboard-health/ai-rules 2.14.14 → 2.14.16
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.
package/package.json
CHANGED
|
@@ -12,6 +12,7 @@ All NestJS microservices follow a three-tier layered architecture:
|
|
|
12
12
|
│ Logic (NestJS services, message publishers, background jobs) │
|
|
13
13
|
│ - ALL business logic; works with DOs only │
|
|
14
14
|
│ - Knows nothing about HTTP or database specifics │
|
|
15
|
+
│ - Can depend on other modules' logic (cross-module composition)│
|
|
15
16
|
├─────────────────────────────────────────────────────────────────┤
|
|
16
17
|
│ Data (Data repositories, gateways) │
|
|
17
18
|
│ - Database via ORM (Prisma/Mongoose), DAO ↔ DO translation │
|
|
@@ -96,7 +96,7 @@ GET /shifts?filter[verified]=true&sort=startDate,-urgency&page[cursor]=abc&page[
|
|
|
96
96
|
Use helpers from `@clipboard-health/contract-core` instead of raw Zod methods in contract packages:
|
|
97
97
|
|
|
98
98
|
- Use `dateTimeSchema()` for date fields — not `z.coerce.date()` (too permissive), `z.string().datetime()` (gives string, not Date), or `z.date()` (won't parse JSON strings)
|
|
99
|
-
- Use `requiredEnumWithFallback`/`optionalEnumWithFallback` for enums — not bare `z.enum()` (breaks old mobile clients when new values are added) or `z.enum().catch()` (doesn't compose with `.optional()`)
|
|
99
|
+
- Use `requiredEnumWithFallback`/`optionalEnumWithFallback` for enums — not bare `z.enum()` (breaks old mobile clients when new values are added) or `z.enum().catch()` (doesn't compose with `.optional()`). These helpers automatically append `ENUM_FALLBACK` (`"UNRECOGNIZED_"`) to the output type — do not pass a fallback value
|
|
100
100
|
- Do not use `.default()` in contracts — client and server can drift on defaults. Set defaults in the service layer.
|
|
101
101
|
- Name schemas with a `Schema` suffix: `ShiftAttributeSchema`, not `shiftAttribute`
|
|
102
102
|
- Export at the DTO boundary (request/response schemas), not every intermediate schema
|
package/scripts/constants.js
CHANGED
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.PROFILES = exports.CATEGORIES = exports.RULE_FILES = exports.FILES = exports.PATHS = void 0;
|
|
7
7
|
exports.toRulePath = toRulePath;
|
|
8
8
|
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
-
// Root directory of the ai-rules package
|
|
10
9
|
const PACKAGE_ROOT = node_path_1.default.join(__dirname, "..");
|
|
11
10
|
exports.PATHS = {
|
|
12
11
|
packageRoot: PACKAGE_ROOT,
|