Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/photogrammetry type #8

Merged
merged 9 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export interface ProjectQuota {
pointCloudUsedMB: number;
imageUsedMB: number;
BIMUsedMB: number;
photogrammetryUsedMB: number;
}
/**
* User level quota. Contains quota and used space from all projects.
Expand All @@ -42,9 +43,11 @@ export interface UserQuota {
pointCloudQuotaMB: number;
imageSizeQuotaMB: number;
BIMSizeQuotaMB: number;
photogrammetryQuotaMB: number;
pointCloudUsedMB: number;
imageUsedMB: number;
BIMUsedMB: number;
photogrammetryUsedMB: number;
}
export interface IProjectDb {
_id: string;
Expand All @@ -57,6 +60,7 @@ export interface IProjectDb {
clouds: Array<string>;
images: Array<string>;
bim: Array<string>;
photogrammetry: Array<string>;
projectQuota: ProjectQuota;
createdAt: number;
modifiedAt: number;
Expand Down Expand Up @@ -104,5 +108,6 @@ export declare enum EntityType {
PointCloud = "clouds",
Image = "images",
BIM = "bim",
Photogrammetry = "photogrammerty",
Unknown = "unknown"
}
1 change: 1 addition & 0 deletions build/interfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@ var EntityType;
EntityType["PointCloud"] = "clouds";
EntityType["Image"] = "images";
EntityType["BIM"] = "bim";
EntityType["Photogrammetry"] = "photogrammerty";
EntityType["Unknown"] = "unknown";
})(EntityType || (exports.EntityType = EntityType = {}));
1 change: 1 addition & 0 deletions build/projects/services/ProjectService.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class ProjectService {
.populate('clouds')
.populate('bim')
.populate('images')
.populate('photogrammetry')
.lean()
.exec();
if (!project_record) {
Expand Down
17 changes: 14 additions & 3 deletions build/projects/validationProjectsDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function createProjectCollectionWithValidation(uri, databaseName, collection_pro
'clouds',
'images',
'bim',
'photogrammetry',
'projectQuota',
'createdAt',
'modifiedAt',
Expand Down Expand Up @@ -82,25 +83,35 @@ function createProjectCollectionWithValidation(uri, databaseName, collection_pro
items: { bsonType: 'string' },
description: 'Lista de modelos BIM associados (array de strings)',
},
phtogrammetry: {
bsonType: 'array',
items: { bsonType: 'string' },
description: 'Entidade de fogotrametria [unica] (array de strings)',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Faltou mudar aqui pra inglês também

},
projectQuota: {
bsonType: 'object',
required: [
'pointCloudUsedMB',
'imageUsedMB',
'BIMUsedMB',
'photogrammetryUsedMB',
],
properties: {
pointCloudUsedMB: {
bsonType: 'number',
description: 'Uso de nuvem de pontos (number)',
description: 'Sized used by pointcloud entities (number)',
},
imageUsedMB: {
bsonType: 'number',
description: 'Uso de tamanho da imagem (number)',
description: 'Sized used by image entities (number)',
},
BIMUsedMB: {
bsonType: 'number',
description: 'Uso de tamanho do BIM (number)',
description: 'Sized used by BIM entities (number)',
},
photogrammetryUsedMB: {
bsonType: 'number',
description: 'Sized used by photogrammetry entities (number)',
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions build/projects/validationProjectsModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ const projectSchema = new mongoose_1.Schema({
clouds: { type: [String], default: [], ref: 'entity' },
images: { type: [String], default: [], ref: 'entity' },
bim: { type: [String], default: [], ref: 'entity' },
photogrammetry: { type: [String], default: [], ref: 'entity' },
projectQuota: {
pointCloudUsedMB: { type: Number, required: true },
imageUsedMB: { type: Number, required: true },
BIMUsedMB: { type: Number, required: true },
photogrammetryUsedMB: { type: Number, required: true },
},
createdAt: { type: Number, required: true },
modifiedAt: { type: Number, required: true },
Expand Down
2 changes: 2 additions & 0 deletions build/users/services/createUserService.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ function createUserService(user) {
BIMSizeQuotaMB: 5000,
pointCloudQuotaMB: 5000,
imageSizeQuotaMB: 5000,
photogrammetryQuotaMB: 5000,
BIMUsedMB: 0,
imageUsedMB: 0,
pointCloudUsedMB: 0,
photogrammetryUsedMB: 0,
},
});
const savedUser = yield newUser.save();
Expand Down
2 changes: 2 additions & 0 deletions build/users/validationUserModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ const UserSchema = new mongoose_1.default.Schema({
pointCloudQuotaMB: { type: Number, required: true },
imageSizeQuotaMB: { type: Number, required: true },
BIMSizeQuotaMB: { type: Number, required: true },
photogrammetryQuotaMB: { type: Number, required: true },
pointCloudUsedMB: { type: Number, required: true },
imageUsedMB: { type: Number, required: true },
BIMUsedMB: { type: Number, required: true },
photogrammetryUsedMB: { type: Number, required: true },
},
validatedMail: { type: Boolean, required: true, default: false },
});
Expand Down
5 changes: 5 additions & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface ProjectQuota {
pointCloudUsedMB: number
imageUsedMB: number
BIMUsedMB: number
photogrammetryUsedMB: number
}

/**
Expand All @@ -45,9 +46,11 @@ export interface UserQuota {
pointCloudQuotaMB: number
imageSizeQuotaMB: number
BIMSizeQuotaMB: number
photogrammetryQuotaMB: number
pointCloudUsedMB: number
imageUsedMB: number
BIMUsedMB: number
photogrammetryUsedMB: number
}

export interface IProjectDb {
Expand All @@ -61,6 +64,7 @@ export interface IProjectDb {
clouds: Array<string>
images: Array<string>
bim: Array<string>
photogrammetry: Array<string>
projectQuota: ProjectQuota
createdAt: number
modifiedAt: number
Expand Down Expand Up @@ -111,5 +115,6 @@ export enum EntityType {
PointCloud = 'clouds',
Image = 'images',
BIM = 'bim',
Photogrammetry = 'photogrammerty',
Unknown = 'unknown',
}
1 change: 1 addition & 0 deletions src/projects/services/ProjectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class ProjectService {
.populate('clouds')
.populate('bim')
.populate('images')
.populate('photogrammetry')
.lean()
.exec()

Expand Down
47 changes: 31 additions & 16 deletions src/projects/validationProjectsDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export async function createProjectCollectionWithValidation(
'clouds',
'images',
'bim',
'photogrammetry',
'projectQuota',
'createdAt',
'modifiedAt',
Expand All @@ -37,84 +38,98 @@ export async function createProjectCollectionWithValidation(
properties: {
_id: {
bsonType: 'string',
description: 'ID do projeto (string)',
description: 'project ID (string)',
},
user_id: {
bsonType: 'string',
description: 'ID do usuário (string)',
description: 'user ID (string)',
},
name: {
bsonType: 'string',
description: 'Nome do projeto (string)',
description: 'Project name (string)',
},
clientName: {
bsonType: 'string',
description: 'Nome do cliente (string)',
description: 'Client name (string)',
},
type: {
bsonType: 'string',
description: 'Tipo do projeto (string)',
description: 'Project type (string)',
},
favorite: {
bsonType: 'bool',
description: 'Indicador de favorito (boolean)',
description: 'Favorite indicator (boolean)',
},
clouds: {
bsonType: 'array',
items: { bsonType: 'string' },
description:
'Lista de nuvens associadas (array de strings)',
'List of associated pointcloud entities (string array)',
},
images: {
bsonType: 'array',
items: { bsonType: 'string' },
description:
'Lista de imagens associadas (array de strings)',
'List of associated image entities (string array)',
},
bim: {
bsonType: 'array',
items: { bsonType: 'string' },
description:
'Lista de modelos BIM associados (array de strings)',
'List of associated BIM entities (string array)',
},
phtogrammetry: {
bsonType: 'array',
items: { bsonType: 'string' },
description:
'Photogrammetry entity [unica] (string array)',
},
projectQuota: {
bsonType: 'object',
required: [
'pointCloudUsedMB',
'imageUsedMB',
'BIMUsedMB',
'photogrammetryUsedMB',
],
properties: {
pointCloudUsedMB: {
bsonType: 'number',
description: 'Uso de nuvem de pontos (number)',
description:
'Size in MB used by pointcloud entities (number)',
},
imageUsedMB: {
bsonType: 'number',
description:
'Uso de tamanho da imagem (number)',
'Size in MB used by image entities (number)',
},
BIMUsedMB: {
bsonType: 'number',
description: 'Uso de tamanho do BIM (number)',
description:
'Size in MB used by BIM entities (number)',
},
photogrammetryUsedMB: {
bsonType: 'number',
description:
'Size in MB used by photogrammetry entities (number)',
},
},
},
createdAt: {
bsonType: 'number',
description: 'Timestamp de criação (number)',
description: 'project creation timestamp (number)',
},
modifiedAt: {
bsonType: 'number',
description: 'Timestamp de modificação (number)',
description: 'project modification timestamp (number)',
},
publicAccessToken: {
bsonType: 'string',
description: 'Token de acesso público (string)',
description: 'Public access token (for shared projects) (string)',
},
status: {
bsonType: 'string',
description: 'Status do projeto (string)',
description: 'Project status (string)',
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions src/projects/validationProjectsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ const projectSchema = new Schema<IProjectDb>({
clouds: { type: [String], default: [], ref: 'entity' },
images: { type: [String], default: [], ref: 'entity' },
bim: { type: [String], default: [], ref: 'entity' },
photogrammetry: { type: [String], default: [], ref: 'entity' },
projectQuota: {
pointCloudUsedMB: { type: Number, required: true },
imageUsedMB: { type: Number, required: true },
BIMUsedMB: { type: Number, required: true },
photogrammetryUsedMB: { type: Number, required: true },
},
createdAt: { type: Number, required: true },
modifiedAt: { type: Number, required: true },
Expand Down
2 changes: 2 additions & 0 deletions src/users/services/createUserService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ export async function createUserService(user: IUsers): Promise<IUsers> {
BIMSizeQuotaMB: 5000,
pointCloudQuotaMB: 5000,
imageSizeQuotaMB: 5000,
photogrammetryQuotaMB: 5000,
BIMUsedMB: 0,
imageUsedMB: 0,
pointCloudUsedMB: 0,
photogrammetryUsedMB: 0,
},
})

Expand Down
2 changes: 2 additions & 0 deletions src/users/validationUserModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ const UserSchema = new mongoose.Schema<IUsers>({
pointCloudQuotaMB: { type: Number, required: true },
imageSizeQuotaMB: { type: Number, required: true },
BIMSizeQuotaMB: { type: Number, required: true },
photogrammetryQuotaMB: { type: Number, required: true },
pointCloudUsedMB: { type: Number, required: true },
imageUsedMB: { type: Number, required: true },
BIMUsedMB: { type: Number, required: true },
photogrammetryUsedMB: { type: Number, required: true },
},
validatedMail: { type: Boolean, required: true, default: false },
})
Expand Down
Loading