feat(MED-161): move type to types file

This commit is contained in:
2025-09-17 11:16:50 +03:00
parent afac628bcf
commit e7650e3c32
8 changed files with 23 additions and 21 deletions

View File

@@ -12,7 +12,7 @@ import { sendOrderToMedipost } from '~/lib/services/medipost/medipostPrivateMess
import { getOrderedAnalysisIds } from '~/lib/services/medusaOrder.service';
import { createNotificationsApi } from '@kit/notifications/api';
import { getSupabaseServerAdminClient } from '@kit/supabase/server-admin-client';
import type { AccountWithParams } from '@kit/accounts/api';
import type { AccountWithParams } from '@kit/accounts/types/accounts';
import type { StoreOrder } from '@medusajs/types';
const ANALYSIS_PACKAGES_TYPE_HANDLE = 'analysis-packages';

View File

@@ -2,7 +2,7 @@
import Link from 'next/link';
import type { AccountWithParams } from '@/packages/features/accounts/src/server/api';
import type { AccountWithParams } from '@kit/accounts/types/accounts';
import { Database } from '@/packages/supabase/src/database.types';
import { BlendingModeIcon, RulerHorizontalIcon } from '@radix-ui/react-icons';
import {

View File

@@ -5,8 +5,8 @@ import { listRegions } from '@lib/data/regions';
import { getAnalysisElementMedusaProductIds } from '@/utils/medusa-product';
import type { StoreProduct } from '@medusajs/types';
import { loadCurrentUserAccount } from './load-user-account';
import { AccountWithParams } from '@/packages/features/accounts/src/server/api';
import { AnalysisPackageWithVariant } from '@kit/shared/components/select-analysis-package';
import type { AccountWithParams } from '@kit/accounts/types/accounts';
import type { AnalysisPackageWithVariant } from '@kit/shared/components/select-analysis-package';
import PersonalCode from '~/lib/utils';
async function countryCodesLoader() {

View File

@@ -4,7 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { Trans } from 'react-i18next';
import { AccountWithParams } from '@kit/accounts/api';
import type { AccountWithParams } from '@kit/accounts/types/accounts';
import { useRevalidatePersonalAccountDataQuery } from '@kit/accounts/hooks/use-personal-account-data';
import { Button } from '@kit/ui/button';
import { Card, CardDescription, CardTitle } from '@kit/ui/card';

View File

@@ -4,7 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { useForm } from 'react-hook-form';
import { Trans } from 'react-i18next';
import { AccountWithParams } from '@kit/accounts/api';
import type { AccountWithParams } from '@kit/accounts/types/accounts';
import { useRevalidatePersonalAccountDataQuery } from '@kit/accounts/hooks/use-personal-account-data';
import { Button } from '@kit/ui/button';
import {

View File

@@ -6,20 +6,7 @@ import PersonalCode from '~/lib/utils';
import type { AnalysisResultDetails, AnalysisResultDetailsMapped, UserAnalysis } from '../types/analysis-results';
import type { AnalysisOrder } from '../types/analysis-orders';
export type AccountWithParams =
Database['medreport']['Tables']['accounts']['Row'] & {
accountParams:
| (Pick<
Database['medreport']['Tables']['account_params']['Row'],
'weight' | 'height'
> & {
isSmoker:
| Database['medreport']['Tables']['account_params']['Row']['is_smoker']
| null;
})
| null;
};
import { AccountWithParams } from '../types/accounts';
/**
* Class representing an API for interacting with user accounts.

View File

@@ -7,3 +7,17 @@ export enum ApplicationRoleEnum {
Doctor = 'doctor',
SuperAdmin = 'super_admin',
}
export type AccountWithParams =
Database['medreport']['Tables']['accounts']['Row'] & {
accountParams:
| (Pick<
Database['medreport']['Tables']['account_params']['Row'],
'weight' | 'height'
> & {
isSmoker:
| Database['medreport']['Tables']['account_params']['Row']['is_smoker']
| null;
})
| null;
};

View File

@@ -16,7 +16,8 @@
"./events": "./src/events/index.tsx",
"./components/*": "./src/components/*.tsx",
"./registry": "./src/registry/index.ts",
"./config": "./src/config/index.ts"
"./config": "./src/config/index.ts",
"./types/*": "./src/types/*.ts"
},
"devDependencies": {
"@kit/eslint-config": "workspace:*",