refactor(data): replace schema classes with readonly models

This commit is contained in:
2026-07-17 13:21:40 +08:00
parent 3437312167
commit ae97366a4a
103 changed files with 1220 additions and 2117 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
import { fromPromise } from "xstate";
import type { UserView } from "@/stores/user/user-view";
import { getUserRepository } from "@/data/repositories/user_repository";
import type { UserEntitlementSnapshotData } from "@/data/schemas/user";
import { UserStorage } from "@/data/storage/user/user_storage";
import type { UserView } from "@/stores/user/user-view";
import { Result } from "@/utils/result";
import {
@@ -36,9 +36,9 @@ export const userFetchActor = fromPromise<UserFetchData>(async () => {
if (Result.isErr(userResult)) return { user: null, snapshot };
const view = applyEntitlementSnapshotToView(
toView(userResult.data.toJson()),
toView(userResult.data),
snapshot,
);
await userStorage.setUser(userResult.data.toJson());
await userStorage.setUser(userResult.data);
return { user: view, snapshot };
});