Skip to content

Commit

Permalink
Merge pull request #2465 from ideafast/feat/trpc-data
Browse files Browse the repository at this point in the history
Feat/trpc data
  • Loading branch information
wsy19961129 authored Jul 12, 2024
2 parents 1e5e0c7 + 9c547d8 commit 1c1e4ca
Show file tree
Hide file tree
Showing 26 changed files with 6,163 additions and 497 deletions.
4 changes: 3 additions & 1 deletion packages/itmat-cores/config/config.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"files_collection": "FILES_COLLECTION",
"sessions_collection": "SESSIONS_COLLECTION",
"pubkeys_collection": "PUBKEY_COLLECTION",
"standardizations_collection": "STANDARDIZATION_COLLECTION"
"standardizations_collection": "STANDARDIZATION_COLLECTION",
"colddata_collection": "COLDDATA_COLLECTION",
"cache_collection": "CACHE_COLLECTION"
}
},
"server": {
Expand Down
2 changes: 1 addition & 1 deletion packages/itmat-cores/src/GraphQLCore/studyCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@ export class StudyCore {
error = `Field ${dataClip.fieldId}: Cannot parse as decimal.`;
break;
}
if (!/^\d+(.\d+)?$/.test(dataClip.value)) {
if (!/^-?\d+(\.\d+)?$/.test(dataClip.value)) {
error = `Field ${dataClip.fieldId}: Cannot parse as decimal.`;
break;
}
Expand Down
10 changes: 7 additions & 3 deletions packages/itmat-cores/src/database/database.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { IField, IFile, IJobEntry, ILogEntry, IOrganisation, IProject, IPubkey, IQueryEntry, IRole, IStudy, IUser, IStandardization, IConfig, IData, IDrive } from '@itmat-broker/itmat-types';
import type { IField, IFile, IJobEntry, ILogEntry, IOrganisation, IProject, IPubkey, IQueryEntry, IRole, IStudy, IUser, IStandardization, IConfig, IData, IDrive, ICache } from '@itmat-broker/itmat-types';
import { Database as DatabaseBase, IDatabaseBaseConfig } from '@itmat-broker/itmat-commons';
import type { Collection } from 'mongodb';

Expand All @@ -18,7 +18,9 @@ export interface IDatabaseConfig extends IDatabaseBaseConfig {
data_collection: string,
standardizations_collection: string,
configs_collection: string,
drives_collection: string
drives_collection: string,
colddata_collection: string,
cache_collection: string
};
}

Expand All @@ -37,6 +39,8 @@ export interface IDatabaseCollectionConfig {
data_collection: Collection<IData>,
standardizations_collection: Collection<IStandardization>,
configs_collection: Collection<IConfig>,
drives_collection: Collection<IDrive>
drives_collection: Collection<IDrive>,
colddata_collection: Collection<IData>,
cache_collection: Collection<ICache>
}
export type DBType = DatabaseBase<IDatabaseBaseConfig, IDatabaseCollectionConfig>;
2 changes: 2 additions & 0 deletions packages/itmat-cores/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ export * from './trpcCore/driveCore';
export * from './trpcCore/fileCore';
export * from './trpcCore/studyCore';
export * from './trpcCore/userCore';
export * from './trpcCore/dataCore';
export * from './trpcCore/transformationCore';
export * from './trpcCore/permissionCore';
export * from './rest/fileDownload';
export * from './authentication/pubkeyAuthentication';
Expand Down
Loading

0 comments on commit 1c1e4ca

Please sign in to comment.