Skip to content

Commit

Permalink
Merge pull request #8 from Duna-System/feat/photogrammetry-type
Browse files Browse the repository at this point in the history
Feat/photogrammetry type
  • Loading branch information
Marcus-D-Forte authored Jan 15, 2024
2 parents ad7dd20 + e72b479 commit 9d6e632
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 32 deletions.
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
43 changes: 27 additions & 16 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 All @@ -45,80 +46,90 @@ function createProjectCollectionWithValidation(uri, databaseName, collection_pro
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)',
description: 'List of associated pointcloud entities (string array)',
},
images: {
bsonType: 'array',
items: { bsonType: 'string' },
description: 'Lista de imagens associadas (array de strings)',
description: 'List of associated image entities (string array)',
},
bim: {
bsonType: 'array',
items: { bsonType: 'string' },
description: 'Lista de modelos BIM associados (array de strings)',
description: 'List of associated BIM entities (string array)',
},
phtogrammetry: {
bsonType: 'array',
items: { bsonType: 'string' },
description: 'Photogrammetry entity [unique] (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)',
description: '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 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
48 changes: 32 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,99 @@ 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 [unique] (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
Loading

0 comments on commit 9d6e632

Please sign in to comment.