Fas 2 steg 1: Inventory Trust Engine - trust states pa inventory_items
This commit is contained in:
@@ -46,6 +46,7 @@ import {
|
||||
UNITS,
|
||||
USER_ROLES,
|
||||
VERIFICATION_STATUSES,
|
||||
TRUST_STATES,
|
||||
tuple,
|
||||
} from "@app/shared-types";
|
||||
|
||||
@@ -112,3 +113,4 @@ export const creatorLevelEnum = pgEnum("creator_level", tuple(CREATOR_LEVELS));
|
||||
export const profileVisibilityEnum = pgEnum("profile_visibility", tuple(PROFILE_VISIBILITIES));
|
||||
export const notificationTypeEnum = pgEnum("notification_type", tuple(NOTIFICATION_TYPES));
|
||||
export const verificationStatusEnum = pgEnum("verification_status", tuple(VERIFICATION_STATUSES));
|
||||
export const trustStateEnum = pgEnum("trust_state", tuple(TRUST_STATES));
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
expiryStatusEnum,
|
||||
inventorySourceEnum,
|
||||
inventoryTransactionTypeEnum,
|
||||
trustStateEnum,
|
||||
unitEnum,
|
||||
updatedAt,
|
||||
} from "./_shared.js";
|
||||
@@ -62,6 +63,8 @@ export const inventoryItems = pgTable(
|
||||
verifiedByUser: boolean("verified_by_user").notNull().default(false),
|
||||
lastVerifiedAt: timestamp("last_verified_at", { withTimezone: true }),
|
||||
expiryStatus: expiryStatusEnum("expiry_status").notNull().default("unknown"),
|
||||
/** Inventory Trust Engine state (Fas 2): computed from confidence, decay and verification. */
|
||||
trustState: trustStateEnum("trust_state").notNull().default("unverified"),
|
||||
/** Sätts när saldot nått 0 och posten arkiverats. */
|
||||
depletedAt: timestamp("depleted_at", { withTimezone: true }),
|
||||
modelVersion: text("model_version"),
|
||||
|
||||
Reference in New Issue
Block a user