FIX: Ref Catalogo new functions models

This commit is contained in:
Victor Radael
2022-10-17 14:38:31 -03:00
parent e9fdd0285b
commit 81921a7eb2
3 changed files with 99 additions and 5 deletions
+9 -4
View File
@@ -21,7 +21,12 @@ import { CatalogService } from './catalog.service';
import { DadosferaLogger } from '@dadosfera/dadosfera-logs';
import { PackTheMetadata } from 'src/utils/ PackTheMetadata';
import { RequestUser, User } from 'src/authentication/user.decorator';
import { ICatalogAllResponse } from './dtos';
import {
ICatalogAllResponse,
IColumnsMetadataResponse,
IDocsResponse,
IPreviewResponse,
} from './dtos';
@ApiTags('Catalog')
@Controller('catalog')
@@ -170,7 +175,7 @@ export class CatalogController {
@User() user: RequestUser,
@Headers('Dadosfera-Lang') language,
@Param('id') id,
) {
): Promise<IColumnsMetadataResponse> {
const { customer_name, customer_id, user_id, username } = user;
const data_asset_type = id.split('-')[0];
@@ -206,7 +211,7 @@ export class CatalogController {
@User() user: RequestUser,
@Headers('Dadosfera-lang') language,
@Param('id') id,
) {
): Promise<IPreviewResponse> {
const { customer_name, customer_id, user_id, username } = user;
const data_asset_type = id.split('-')[0];
@@ -241,7 +246,7 @@ export class CatalogController {
@User() user: RequestUser,
@Headers('Dadosfera-Lang') language,
@Param('id') id,
) {
): Promise<IDocsResponse> {
const { customer_name, customer_id, user_id, username } = user;
const data_asset_type = id.split('-')[0];
+89
View File
@@ -76,3 +76,92 @@ export class ICatalogAllResponse {
@ApiProperty()
data_assets: IDataAsset[];
}
export class IData {
@ApiProperty()
var: number;
@ApiProperty()
date: string;
@ApiProperty()
last: number;
@ApiProperty()
maximum: number;
@ApiProperty()
minimum: number;
@ApiProperty()
day_opening: number;
}
export class IPreview {
@ApiProperty()
id: string;
@ApiProperty()
database_name: string;
@ApiProperty()
table_name: string;
@ApiProperty()
data: IData[];
}
export class IDocs {
@ApiProperty()
id: string;
@ApiProperty()
docs: string;
@ApiProperty()
updated_at: string;
@ApiProperty()
table_id: string;
}
export class IColumnMetadata {
@ApiProperty()
id: string;
@ApiProperty()
table_name: string;
@ApiProperty()
column_name: string;
@ApiProperty()
data_type: string;
@ApiProperty()
missing_count: string;
@ApiProperty()
min: string;
@ApiProperty()
max: string;
@ApiProperty()
count: string;
@ApiProperty()
histogram: string;
@ApiProperty()
mean: string;
@ApiProperty()
median: string;
@ApiProperty()
missing_rate: string;
@ApiProperty()
stddev: string;
@ApiProperty()
unique_count: string;
@ApiProperty()
unique_rate: string;
@ApiProperty()
analyzer_rules: string[];
@ApiProperty()
version: string;
}
export class IPreviewResponse {
@ApiProperty()
preview: IPreview;
}
export class IDocsResponse {
@ApiProperty()
docs: IDocs;
}
export class IColumnsMetadataResponse {
@ApiProperty()
columns_metadata: IColumnMetadata[];
}
+1 -1
View File
File diff suppressed because one or more lines are too long