Fix microAmount (#2654)
* Fix microAmount * Code review returns * Parse currency values as string * Jeremy's returns * fix: scalars not properly implemented * fix: filters not working on big float scalar --------- Co-authored-by: Jérémy Magrin <jeremy.magrin@gmail.com>
This commit is contained in:
@@ -24,6 +24,12 @@ import { WorkspaceSchemaStorageService } from 'src/workspace/workspace-schema-st
|
||||
type: MemoryStorageType.Local,
|
||||
options: {},
|
||||
}),
|
||||
MemoryStorageModule.forRoot({
|
||||
identifier: 'usedScalarNames',
|
||||
type: MemoryStorageType.Local,
|
||||
options: {},
|
||||
serializer: new MemoryStorageJsonSerializer<string[]>(),
|
||||
}),
|
||||
MemoryStorageModule.forRoot({
|
||||
identifier: 'cacheVersion',
|
||||
type: MemoryStorageType.Local,
|
||||
|
||||
@@ -14,6 +14,10 @@ export class WorkspaceSchemaStorageService {
|
||||
>,
|
||||
@InjectMemoryStorage('typeDefs')
|
||||
private readonly typeDefsMemoryStorageService: MemoryStorageService<string>,
|
||||
@InjectMemoryStorage('usedScalarNames')
|
||||
private readonly usedScalarNamesMemoryStorageService: MemoryStorageService<
|
||||
string[]
|
||||
>,
|
||||
@InjectMemoryStorage('cacheVersion')
|
||||
private readonly cacheVersionMemoryStorageService: MemoryStorageService<string>,
|
||||
private readonly workspaceCacheVersionService: WorkspaceCacheVersionService,
|
||||
@@ -71,8 +75,25 @@ export class WorkspaceSchemaStorageService {
|
||||
});
|
||||
}
|
||||
|
||||
setUsedScalarNames(
|
||||
workspaceId: string,
|
||||
scalarsUsed: string[],
|
||||
): Promise<void> {
|
||||
return this.usedScalarNamesMemoryStorageService.write({
|
||||
key: workspaceId,
|
||||
data: scalarsUsed,
|
||||
});
|
||||
}
|
||||
|
||||
getUsedScalarNames(workspaceId: string): Promise<string[] | null> {
|
||||
return this.usedScalarNamesMemoryStorageService.read({
|
||||
key: workspaceId,
|
||||
});
|
||||
}
|
||||
|
||||
async invalidateCache(workspaceId: string): Promise<void> {
|
||||
await this.objectMetadataMemoryStorageService.delete({ key: workspaceId });
|
||||
await this.typeDefsMemoryStorageService.delete({ key: workspaceId });
|
||||
await this.usedScalarNamesMemoryStorageService.delete({ key: workspaceId });
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user