Some checks failed
Main Confidence / confidence (push) Failing after 45s
## Summary - introduce surface-aware compressed governance outcomes and reuse the shared truth/explanation seams for operator-first summaries - apply the compressed outcome hierarchy across baseline, evidence, review, review-pack, canonical review/evidence, and artifact-oriented operation-run surfaces - expand spec 214 fixtures and Pest coverage, and fix tenant-panel route assertions by generating explicit tenant-panel URLs in the affected Filament tests ## Validation - `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent` - focused governance compression suite from `specs/214-governance-outcome-compression/quickstart.md` passed (`68` tests, `445` assertions) - `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/Filament/InventoryItemResourceTest.php tests/Feature/Filament/BackupSetUiEnforcementTest.php tests/Feature/Filament/RestoreRunUiEnforcementTest.php` passed (`18` tests, `81` assertions) Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #253
86 lines
2.2 KiB
Plaintext
86 lines
2.2 KiB
Plaintext
import { entityKind } from "../../entity.js";
|
|
import { getColumnNameAndConfig } from "../../utils.js";
|
|
import { SQLiteColumn, SQLiteColumnBuilder } from "./common.js";
|
|
class SQLiteNumericBuilder extends SQLiteColumnBuilder {
|
|
static [entityKind] = "SQLiteNumericBuilder";
|
|
constructor(name) {
|
|
super(name, "string", "SQLiteNumeric");
|
|
}
|
|
/** @internal */
|
|
build(table) {
|
|
return new SQLiteNumeric(
|
|
table,
|
|
this.config
|
|
);
|
|
}
|
|
}
|
|
class SQLiteNumeric extends SQLiteColumn {
|
|
static [entityKind] = "SQLiteNumeric";
|
|
mapFromDriverValue(value) {
|
|
if (typeof value === "string") return value;
|
|
return String(value);
|
|
}
|
|
getSQLType() {
|
|
return "numeric";
|
|
}
|
|
}
|
|
class SQLiteNumericNumberBuilder extends SQLiteColumnBuilder {
|
|
static [entityKind] = "SQLiteNumericNumberBuilder";
|
|
constructor(name) {
|
|
super(name, "number", "SQLiteNumericNumber");
|
|
}
|
|
/** @internal */
|
|
build(table) {
|
|
return new SQLiteNumericNumber(
|
|
table,
|
|
this.config
|
|
);
|
|
}
|
|
}
|
|
class SQLiteNumericNumber extends SQLiteColumn {
|
|
static [entityKind] = "SQLiteNumericNumber";
|
|
mapFromDriverValue(value) {
|
|
if (typeof value === "number") return value;
|
|
return Number(value);
|
|
}
|
|
mapToDriverValue = String;
|
|
getSQLType() {
|
|
return "numeric";
|
|
}
|
|
}
|
|
class SQLiteNumericBigIntBuilder extends SQLiteColumnBuilder {
|
|
static [entityKind] = "SQLiteNumericBigIntBuilder";
|
|
constructor(name) {
|
|
super(name, "bigint", "SQLiteNumericBigInt");
|
|
}
|
|
/** @internal */
|
|
build(table) {
|
|
return new SQLiteNumericBigInt(
|
|
table,
|
|
this.config
|
|
);
|
|
}
|
|
}
|
|
class SQLiteNumericBigInt extends SQLiteColumn {
|
|
static [entityKind] = "SQLiteNumericBigInt";
|
|
mapFromDriverValue = BigInt;
|
|
mapToDriverValue = String;
|
|
getSQLType() {
|
|
return "numeric";
|
|
}
|
|
}
|
|
function numeric(a, b) {
|
|
const { name, config } = getColumnNameAndConfig(a, b);
|
|
const mode = config?.mode;
|
|
return mode === "number" ? new SQLiteNumericNumberBuilder(name) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name) : new SQLiteNumericBuilder(name);
|
|
}
|
|
export {
|
|
SQLiteNumeric,
|
|
SQLiteNumericBigInt,
|
|
SQLiteNumericBigIntBuilder,
|
|
SQLiteNumericBuilder,
|
|
SQLiteNumericNumber,
|
|
SQLiteNumericNumberBuilder,
|
|
numeric
|
|
};
|
|
//# sourceMappingURL=numeric.js.map |