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

Adding new entity type #11

Merged
merged 4 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions build/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export interface IProjectDb {
clouds: Array<string>;
images: Array<string>;
bim: Array<string>;
cad: Array<string>;
photogrammetry: Array<string>;
projectQuota: ProjectQuota;
createdAt: number;
Expand Down Expand Up @@ -115,5 +116,6 @@ export declare enum EntityType {
Image = "images",
BIM = "bim",
Photogrammetry = "photogrammerty",
CAD = "cad",
Unknown = "unknown"
}
1 change: 1 addition & 0 deletions build/interfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ var EntityType;
EntityType["Image"] = "images";
EntityType["BIM"] = "bim";
EntityType["Photogrammetry"] = "photogrammerty";
EntityType["CAD"] = "cad";
EntityType["Unknown"] = "unknown";
})(EntityType || (exports.EntityType = EntityType = {}));
2 changes: 2 additions & 0 deletions build/projects/services/ProjectService.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ProjectService {
.findOne({ _id: project_id, user_id: user_id })
.populate('clouds')
.populate('bim')
.populate('cad')
.populate('images')
.populate('photogrammetry')
.lean()
Expand Down Expand Up @@ -139,6 +140,7 @@ class ProjectService {
.find({ user_id: user_id })
.populate('clouds')
.populate('bim')
.populate('cad')
.populate('images')
.populate('photogrammetry')
.lean()
Expand Down
6 changes: 6 additions & 0 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',
"cad",
'photogrammetry',
'projectQuota',
'createdAt',
Expand Down Expand Up @@ -83,6 +84,11 @@ function createProjectCollectionWithValidation(uri, databaseName, collection_pro
items: { bsonType: 'string' },
description: 'List of associated BIM entities (string array)',
},
cad: {
bsonType: 'array',
items: { bsonType: 'string' },
description: 'List of associated CAD entities (string array)',
},
photogrammetry: {
bsonType: 'array',
items: { bsonType: 'string' },
Expand Down
1 change: 1 addition & 0 deletions build/projects/validationProjectsModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const projectSchema = new mongoose_1.Schema({
clouds: { type: [String], default: [], ref: 'entity' },
images: { type: [String], default: [], ref: 'entity' },
bim: { type: [String], default: [], ref: 'entity' },
cad: { type: [String], default: [], ref: 'entity' },
photogrammetry: { type: [String], default: [], ref: 'entity' },
projectQuota: {
pointCloudUsedMB: { type: Number, required: true },
Expand Down
24 changes: 24 additions & 0 deletions build/users/validationUserModel.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/// <reference types="mongoose/types/aggregate" />
/// <reference types="mongoose/types/callback" />
/// <reference types="mongoose/types/collection" />
/// <reference types="mongoose/types/connection" />
/// <reference types="mongoose/types/cursor" />
/// <reference types="mongoose/types/document" />
/// <reference types="mongoose/types/error" />
/// <reference types="mongoose/types/expressions" />
/// <reference types="mongoose/types/helpers" />
/// <reference types="mongoose/types/middlewares" />
/// <reference types="mongoose/types/indexes" />
/// <reference types="mongoose/types/models" />
/// <reference types="mongoose/types/mongooseoptions" />
/// <reference types="mongoose/types/pipelinestage" />
/// <reference types="mongoose/types/populate" />
/// <reference types="mongoose/types/query" />
/// <reference types="mongoose/types/schemaoptions" />
/// <reference types="mongoose/types/schematypes" />
/// <reference types="mongoose/types/session" />
/// <reference types="mongoose/types/types" />
/// <reference types="mongoose/types/utility" />
/// <reference types="mongoose/types/validation" />
/// <reference types="mongoose/types/virtuals" />
/// <reference types="mongoose/types/inferschematype" />
import { Model } from 'mongoose';
import { IUsers } from '../interfaces';
declare const UserModel: Model<IUsers>;
Expand Down
2 changes: 2 additions & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface IProjectDb {
clouds: Array<string>
images: Array<string>
bim: Array<string>
cad: Array<string>
photogrammetry: Array<string>
projectQuota: ProjectQuota
createdAt: number
Expand Down Expand Up @@ -122,5 +123,6 @@ export enum EntityType {
Image = 'images',
BIM = 'bim',
Photogrammetry = 'photogrammerty',
CAD = 'cad',
Unknown = 'unknown',
}
2 changes: 2 additions & 0 deletions src/projects/services/ProjectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export class ProjectService {
.findOne({ _id: project_id, user_id: user_id })
.populate('clouds')
.populate('bim')
.populate('cad')
.populate('images')
.populate('photogrammetry')
.lean()
Expand Down Expand Up @@ -149,6 +150,7 @@ export class ProjectService {
.find({ user_id: user_id })
.populate('clouds')
.populate('bim')
.populate('cad')
.populate('images')
.populate('photogrammetry')
.lean()
Expand Down
7 changes: 7 additions & 0 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',
'cad',
'photogrammetry',
'projectQuota',
'createdAt',
Expand Down Expand Up @@ -78,6 +79,12 @@ export async function createProjectCollectionWithValidation(
description:
'List of associated BIM entities (string array)',
},
cad: {
bsonType: 'array',
items: { bsonType: 'string' },
description:
'List of associated CAD entities (string array)',
},
photogrammetry: {
bsonType: 'array',
items: { bsonType: 'string' },
Expand Down
1 change: 1 addition & 0 deletions src/projects/validationProjectsModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const projectSchema = new Schema<IProjectDb>({
clouds: { type: [String], default: [], ref: 'entity' },
images: { type: [String], default: [], ref: 'entity' },
bim: { type: [String], default: [], ref: 'entity' },
cad: { type: [String], default: [], ref: 'entity' },
photogrammetry: { type: [String], default: [], ref: 'entity' },
projectQuota: {
pointCloudUsedMB: { type: Number, required: true },
Expand Down
Loading