feat(MED-161): move type to types file
This commit is contained in:
@@ -12,7 +12,7 @@ import { sendOrderToMedipost } from '~/lib/services/medipost/medipostPrivateMess
|
|||||||
import { getOrderedAnalysisIds } from '~/lib/services/medusaOrder.service';
|
import { getOrderedAnalysisIds } from '~/lib/services/medusaOrder.service';
|
||||||
import { createNotificationsApi } from '@kit/notifications/api';
|
import { createNotificationsApi } from '@kit/notifications/api';
|
||||||
import { getSupabaseServerAdminClient } from '@kit/supabase/server-admin-client';
|
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';
|
import type { StoreOrder } from '@medusajs/types';
|
||||||
|
|
||||||
const ANALYSIS_PACKAGES_TYPE_HANDLE = 'analysis-packages';
|
const ANALYSIS_PACKAGES_TYPE_HANDLE = 'analysis-packages';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import Link from 'next/link';
|
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 { Database } from '@/packages/supabase/src/database.types';
|
||||||
import { BlendingModeIcon, RulerHorizontalIcon } from '@radix-ui/react-icons';
|
import { BlendingModeIcon, RulerHorizontalIcon } from '@radix-ui/react-icons';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import { listRegions } from '@lib/data/regions';
|
|||||||
import { getAnalysisElementMedusaProductIds } from '@/utils/medusa-product';
|
import { getAnalysisElementMedusaProductIds } from '@/utils/medusa-product';
|
||||||
import type { StoreProduct } from '@medusajs/types';
|
import type { StoreProduct } from '@medusajs/types';
|
||||||
import { loadCurrentUserAccount } from './load-user-account';
|
import { loadCurrentUserAccount } from './load-user-account';
|
||||||
import { AccountWithParams } from '@/packages/features/accounts/src/server/api';
|
import type { AccountWithParams } from '@kit/accounts/types/accounts';
|
||||||
import { AnalysisPackageWithVariant } from '@kit/shared/components/select-analysis-package';
|
import type { AnalysisPackageWithVariant } from '@kit/shared/components/select-analysis-package';
|
||||||
import PersonalCode from '~/lib/utils';
|
import PersonalCode from '~/lib/utils';
|
||||||
|
|
||||||
async function countryCodesLoader() {
|
async function countryCodesLoader() {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { Trans } from 'react-i18next';
|
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 { useRevalidatePersonalAccountDataQuery } from '@kit/accounts/hooks/use-personal-account-data';
|
||||||
import { Button } from '@kit/ui/button';
|
import { Button } from '@kit/ui/button';
|
||||||
import { Card, CardDescription, CardTitle } from '@kit/ui/card';
|
import { Card, CardDescription, CardTitle } from '@kit/ui/card';
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { zodResolver } from '@hookform/resolvers/zod';
|
|||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { Trans } from 'react-i18next';
|
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 { useRevalidatePersonalAccountDataQuery } from '@kit/accounts/hooks/use-personal-account-data';
|
||||||
import { Button } from '@kit/ui/button';
|
import { Button } from '@kit/ui/button';
|
||||||
import {
|
import {
|
||||||
|
|||||||
@@ -6,20 +6,7 @@ import PersonalCode from '~/lib/utils';
|
|||||||
|
|
||||||
import type { AnalysisResultDetails, AnalysisResultDetailsMapped, UserAnalysis } from '../types/analysis-results';
|
import type { AnalysisResultDetails, AnalysisResultDetailsMapped, UserAnalysis } from '../types/analysis-results';
|
||||||
import type { AnalysisOrder } from '../types/analysis-orders';
|
import type { AnalysisOrder } from '../types/analysis-orders';
|
||||||
|
import { AccountWithParams } from '../types/accounts';
|
||||||
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;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class representing an API for interacting with user accounts.
|
* Class representing an API for interacting with user accounts.
|
||||||
|
|||||||
@@ -7,3 +7,17 @@ export enum ApplicationRoleEnum {
|
|||||||
Doctor = 'doctor',
|
Doctor = 'doctor',
|
||||||
SuperAdmin = 'super_admin',
|
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;
|
||||||
|
};
|
||||||
|
|||||||
@@ -16,7 +16,8 @@
|
|||||||
"./events": "./src/events/index.tsx",
|
"./events": "./src/events/index.tsx",
|
||||||
"./components/*": "./src/components/*.tsx",
|
"./components/*": "./src/components/*.tsx",
|
||||||
"./registry": "./src/registry/index.ts",
|
"./registry": "./src/registry/index.ts",
|
||||||
"./config": "./src/config/index.ts"
|
"./config": "./src/config/index.ts",
|
||||||
|
"./types/*": "./src/types/*.ts"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@kit/eslint-config": "workspace:*",
|
"@kit/eslint-config": "workspace:*",
|
||||||
|
|||||||
Reference in New Issue
Block a user