@lukiteam/luki-be-general 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +9 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/models/enum/index.d.ts +221 -0
- package/dist/models/enum/index.js +289 -0
- package/dist/models/enum/index.js.map +1 -0
- package/dist/mongo/index.d.ts +90 -0
- package/dist/mongo/index.js +101 -0
- package/dist/mongo/index.js.map +1 -0
- package/dist/mongo/interfaces/repository.interface.d.ts +11 -0
- package/dist/mongo/interfaces/repository.interface.js +3 -0
- package/dist/mongo/interfaces/repository.interface.js.map +1 -0
- package/dist/mongo/repositories/base.repository.d.ts +50 -0
- package/dist/mongo/repositories/base.repository.js +161 -0
- package/dist/mongo/repositories/base.repository.js.map +1 -0
- package/dist/mongo/repositories/repository.factory.d.ts +5 -0
- package/dist/mongo/repositories/repository.factory.js +25 -0
- package/dist/mongo/repositories/repository.factory.js.map +1 -0
- package/dist/mongo/schema/agency-publishers.entity.d.ts +38 -0
- package/dist/mongo/schema/agency-publishers.entity.js +58 -0
- package/dist/mongo/schema/agency-publishers.entity.js.map +1 -0
- package/dist/mongo/schema/agency.entity.d.ts +34 -0
- package/dist/mongo/schema/agency.entity.js +41 -0
- package/dist/mongo/schema/agency.entity.js.map +1 -0
- package/dist/mongo/schema/contents.entity.d.ts +32 -0
- package/dist/mongo/schema/contents.entity.js +36 -0
- package/dist/mongo/schema/contents.entity.js.map +1 -0
- package/dist/mongo/schema/defined-texts.entity.d.ts +33 -0
- package/dist/mongo/schema/defined-texts.entity.js +37 -0
- package/dist/mongo/schema/defined-texts.entity.js.map +1 -0
- package/dist/mongo/schema/filter.dto.d.ts +6 -0
- package/dist/mongo/schema/filter.dto.js +7 -0
- package/dist/mongo/schema/filter.dto.js.map +1 -0
- package/dist/mongo/schema/highlights.entity.d.ts +35 -0
- package/dist/mongo/schema/highlights.entity.js +48 -0
- package/dist/mongo/schema/highlights.entity.js.map +1 -0
- package/dist/mongo/schema/language.entity.d.ts +31 -0
- package/dist/mongo/schema/language.entity.js +32 -0
- package/dist/mongo/schema/language.entity.js.map +1 -0
- package/dist/mongo/schema/member-config.entity.d.ts +42 -0
- package/dist/mongo/schema/member-config.entity.js +77 -0
- package/dist/mongo/schema/member-config.entity.js.map +1 -0
- package/dist/mongo/schema/member-roles.entity.d.ts +33 -0
- package/dist/mongo/schema/member-roles.entity.js +38 -0
- package/dist/mongo/schema/member-roles.entity.js.map +1 -0
- package/dist/mongo/schema/member.entity.d.ts +64 -0
- package/dist/mongo/schema/member.entity.js +163 -0
- package/dist/mongo/schema/member.entity.js.map +1 -0
- package/dist/mongo/schema/notification.entity.d.ts +44 -0
- package/dist/mongo/schema/notification.entity.js +73 -0
- package/dist/mongo/schema/notification.entity.js.map +1 -0
- package/dist/mongo/schema/post-comments.entity.d.ts +34 -0
- package/dist/mongo/schema/post-comments.entity.js +43 -0
- package/dist/mongo/schema/post-comments.entity.js.map +1 -0
- package/dist/mongo/schema/post-likes.entity.d.ts +32 -0
- package/dist/mongo/schema/post-likes.entity.js +35 -0
- package/dist/mongo/schema/post-likes.entity.js.map +1 -0
- package/dist/mongo/schema/posts.entity.d.ts +39 -0
- package/dist/mongo/schema/posts.entity.js +65 -0
- package/dist/mongo/schema/posts.entity.js.map +1 -0
- package/dist/mongo/schema/rights.entity.d.ts +33 -0
- package/dist/mongo/schema/rights.entity.js +37 -0
- package/dist/mongo/schema/rights.entity.js.map +1 -0
- package/dist/mongo/schema/roles-rights.entity.d.ts +33 -0
- package/dist/mongo/schema/roles-rights.entity.js +38 -0
- package/dist/mongo/schema/roles-rights.entity.js.map +1 -0
- package/dist/mongo/schema/roles.entity.d.ts +32 -0
- package/dist/mongo/schema/roles.entity.js +33 -0
- package/dist/mongo/schema/roles.entity.js.map +1 -0
- package/dist/mongo/schema/spend-log.entity.d.ts +35 -0
- package/dist/mongo/schema/spend-log.entity.js +45 -0
- package/dist/mongo/schema/spend-log.entity.js.map +1 -0
- package/dist/mongo/schema/story-priority-log.entity.d.ts +32 -0
- package/dist/mongo/schema/story-priority-log.entity.js +33 -0
- package/dist/mongo/schema/story-priority-log.entity.js.map +1 -0
- package/dist/mongo/schema/story-seen-by.entity.d.ts +32 -0
- package/dist/mongo/schema/story-seen-by.entity.js +36 -0
- package/dist/mongo/schema/story-seen-by.entity.js.map +1 -0
- package/dist/mongo/schema/story.entity.d.ts +41 -0
- package/dist/mongo/schema/story.entity.js +54 -0
- package/dist/mongo/schema/story.entity.js.map +1 -0
- package/dist/mongo/schema/system-log.entity.d.ts +37 -0
- package/dist/mongo/schema/system-log.entity.js +53 -0
- package/dist/mongo/schema/system-log.entity.js.map +1 -0
- package/dist/mongo/schema/system-logs.entity.d.ts +36 -0
- package/dist/mongo/schema/system-logs.entity.js +46 -0
- package/dist/mongo/schema/system-logs.entity.js.map +1 -0
- package/dist/mongo/unit-of-work/unit-of-work.interface.d.ts +7 -0
- package/dist/mongo/unit-of-work/unit-of-work.interface.js +3 -0
- package/dist/mongo/unit-of-work/unit-of-work.interface.js.map +1 -0
- package/dist/mongo/unit-of-work/unit-of-work.module.d.ts +2 -0
- package/dist/mongo/unit-of-work/unit-of-work.module.js +29 -0
- package/dist/mongo/unit-of-work/unit-of-work.module.js.map +1 -0
- package/dist/mongo/unit-of-work/unit-of-work.service.d.ts +19 -0
- package/dist/mongo/unit-of-work/unit-of-work.service.js +104 -0
- package/dist/mongo/unit-of-work/unit-of-work.service.js.map +1 -0
- package/dist/postgresql/entity/banners.entity.d.ts +18 -0
- package/dist/postgresql/entity/banners.entity.js +86 -0
- package/dist/postgresql/entity/banners.entity.js.map +1 -0
- package/dist/postgresql/entity/blocked-phone.entity.d.ts +9 -0
- package/dist/postgresql/entity/blocked-phone.entity.js +44 -0
- package/dist/postgresql/entity/blocked-phone.entity.js.map +1 -0
- package/dist/postgresql/entity/call-history-detail.entity.d.ts +9 -0
- package/dist/postgresql/entity/call-history-detail.entity.js +44 -0
- package/dist/postgresql/entity/call-history-detail.entity.js.map +1 -0
- package/dist/postgresql/entity/call-history.entity.d.ts +19 -0
- package/dist/postgresql/entity/call-history.entity.js +88 -0
- package/dist/postgresql/entity/call-history.entity.js.map +1 -0
- package/dist/postgresql/entity/coins-definition.entity.d.ts +14 -0
- package/dist/postgresql/entity/coins-definition.entity.js +60 -0
- package/dist/postgresql/entity/coins-definition.entity.js.map +1 -0
- package/dist/postgresql/entity/feedback-and-complaint.entity.d.ts +14 -0
- package/dist/postgresql/entity/feedback-and-complaint.entity.js +64 -0
- package/dist/postgresql/entity/feedback-and-complaint.entity.js.map +1 -0
- package/dist/postgresql/entity/member-bank-account.entity.d.ts +8 -0
- package/dist/postgresql/entity/member-bank-account.entity.js +43 -0
- package/dist/postgresql/entity/member-bank-account.entity.js.map +1 -0
- package/dist/postgresql/entity/member-blocked.entity.d.ts +11 -0
- package/dist/postgresql/entity/member-blocked.entity.js +58 -0
- package/dist/postgresql/entity/member-blocked.entity.js.map +1 -0
- package/dist/postgresql/entity/member-config.entity.d.ts +22 -0
- package/dist/postgresql/entity/member-config.entity.js +119 -0
- package/dist/postgresql/entity/member-config.entity.js.map +1 -0
- package/dist/postgresql/entity/member-connections.entity.d.ts +7 -0
- package/dist/postgresql/entity/member-connections.entity.js +39 -0
- package/dist/postgresql/entity/member-connections.entity.js.map +1 -0
- package/dist/postgresql/entity/member-friends.entity.d.ts +11 -0
- package/dist/postgresql/entity/member-friends.entity.js +58 -0
- package/dist/postgresql/entity/member-friends.entity.js.map +1 -0
- package/dist/postgresql/entity/member-liked.entity.d.ts +9 -0
- package/dist/postgresql/entity/member-liked.entity.js +50 -0
- package/dist/postgresql/entity/member-liked.entity.js.map +1 -0
- package/dist/postgresql/entity/member-mission.entity.d.ts +9 -0
- package/dist/postgresql/entity/member-mission.entity.js +48 -0
- package/dist/postgresql/entity/member-mission.entity.js.map +1 -0
- package/dist/postgresql/entity/member-reminder.entity.d.ts +11 -0
- package/dist/postgresql/entity/member-reminder.entity.js +65 -0
- package/dist/postgresql/entity/member-reminder.entity.js.map +1 -0
- package/dist/postgresql/entity/member-verification.entity.d.ts +8 -0
- package/dist/postgresql/entity/member-verification.entity.js +42 -0
- package/dist/postgresql/entity/member-verification.entity.js.map +1 -0
- package/dist/postgresql/entity/member.entity.d.ts +44 -0
- package/dist/postgresql/entity/member.entity.js +195 -0
- package/dist/postgresql/entity/member.entity.js.map +1 -0
- package/dist/postgresql/entity/message.entity.d.ts +13 -0
- package/dist/postgresql/entity/message.entity.js +73 -0
- package/dist/postgresql/entity/message.entity.js.map +1 -0
- package/dist/postgresql/entity/mission.entity.d.ts +12 -0
- package/dist/postgresql/entity/mission.entity.js +60 -0
- package/dist/postgresql/entity/mission.entity.js.map +1 -0
- package/dist/postgresql/entity/notification.entity.d.ts +8 -0
- package/dist/postgresql/entity/notification.entity.js +42 -0
- package/dist/postgresql/entity/notification.entity.js.map +1 -0
- package/dist/postgresql/entity/payment.entity.d.ts +14 -0
- package/dist/postgresql/entity/payment.entity.js +96 -0
- package/dist/postgresql/entity/payment.entity.js.map +1 -0
- package/dist/postgresql/entity/product-purchase.entity.d.ts +12 -0
- package/dist/postgresql/entity/product-purchase.entity.js +54 -0
- package/dist/postgresql/entity/product-purchase.entity.js.map +1 -0
- package/dist/postgresql/entity/purchase.entity.d.ts +15 -0
- package/dist/postgresql/entity/purchase.entity.js +73 -0
- package/dist/postgresql/entity/purchase.entity.js.map +1 -0
- package/dist/postgresql/entity/swipe-countries.entity.d.ts +8 -0
- package/dist/postgresql/entity/swipe-countries.entity.js +36 -0
- package/dist/postgresql/entity/swipe-countries.entity.js.map +1 -0
- package/dist/postgresql/entity/system-logs.entity.d.ts +12 -0
- package/dist/postgresql/entity/system-logs.entity.js +74 -0
- package/dist/postgresql/entity/system-logs.entity.js.map +1 -0
- package/dist/postgresql/entity/system-settings.entity.d.ts +8 -0
- package/dist/postgresql/entity/system-settings.entity.js +38 -0
- package/dist/postgresql/entity/system-settings.entity.js.map +1 -0
- package/dist/postgresql/entity/wallet-detail.entity.d.ts +10 -0
- package/dist/postgresql/entity/wallet-detail.entity.js +50 -0
- package/dist/postgresql/entity/wallet-detail.entity.js.map +1 -0
- package/dist/postgresql/entity/wallet.entity.d.ts +10 -0
- package/dist/postgresql/entity/wallet.entity.js +52 -0
- package/dist/postgresql/entity/wallet.entity.js.map +1 -0
- package/dist/postgresql/index.d.ts +28 -0
- package/dist/postgresql/index.js +63 -0
- package/dist/postgresql/index.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +27 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MONGO_SCHEMAS = void 0;
|
|
4
|
+
const agency_publishers_entity_1 = require("./schema/agency-publishers.entity");
|
|
5
|
+
const agency_entity_1 = require("./schema/agency.entity");
|
|
6
|
+
const contents_entity_1 = require("./schema/contents.entity");
|
|
7
|
+
const defined_texts_entity_1 = require("./schema/defined-texts.entity");
|
|
8
|
+
const highlights_entity_1 = require("./schema/highlights.entity");
|
|
9
|
+
const language_entity_1 = require("./schema/language.entity");
|
|
10
|
+
const member_config_entity_1 = require("./schema/member-config.entity");
|
|
11
|
+
const member_roles_entity_1 = require("./schema/member-roles.entity");
|
|
12
|
+
const notification_entity_1 = require("./schema/notification.entity");
|
|
13
|
+
const post_comments_entity_1 = require("./schema/post-comments.entity");
|
|
14
|
+
const post_likes_entity_1 = require("./schema/post-likes.entity");
|
|
15
|
+
const posts_entity_1 = require("./schema/posts.entity");
|
|
16
|
+
const rights_entity_1 = require("./schema/rights.entity");
|
|
17
|
+
const roles_rights_entity_1 = require("./schema/roles-rights.entity");
|
|
18
|
+
const roles_entity_1 = require("./schema/roles.entity");
|
|
19
|
+
const spend_log_entity_1 = require("./schema/spend-log.entity");
|
|
20
|
+
const story_priority_log_entity_1 = require("./schema/story-priority-log.entity");
|
|
21
|
+
const story_seen_by_entity_1 = require("./schema/story-seen-by.entity");
|
|
22
|
+
const system_log_entity_1 = require("./schema/system-log.entity");
|
|
23
|
+
exports.MONGO_SCHEMAS = [
|
|
24
|
+
{
|
|
25
|
+
name: spend_log_entity_1.SpendLog.name,
|
|
26
|
+
schema: spend_log_entity_1.SpendLogSchema,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: system_log_entity_1.SystemLog.name,
|
|
30
|
+
schema: system_log_entity_1.SystemLogSchema,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: agency_publishers_entity_1.AgencyPublishers.name,
|
|
34
|
+
schema: agency_publishers_entity_1.AgencyPublishersSchema,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: agency_entity_1.Agency.name,
|
|
38
|
+
schema: agency_entity_1.AgencySchema,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: member_config_entity_1.MemberConfig.name,
|
|
42
|
+
schema: member_config_entity_1.MemberConfigSchema,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: member_roles_entity_1.MemberRoles.name,
|
|
46
|
+
schema: member_roles_entity_1.MemberRolesSchema,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: rights_entity_1.Rights.name,
|
|
50
|
+
schema: rights_entity_1.RightsSchema,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: roles_rights_entity_1.RolesRights.name,
|
|
54
|
+
schema: roles_rights_entity_1.RolesRightsSchema,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: roles_entity_1.Roles.name,
|
|
58
|
+
schema: roles_entity_1.RolesSchema,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: story_priority_log_entity_1.StoryPriorityLog.name,
|
|
62
|
+
schema: story_priority_log_entity_1.StoryPriorityLogSchema,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: highlights_entity_1.Highlights.name,
|
|
66
|
+
schema: highlights_entity_1.HighlightsSchema,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: post_comments_entity_1.PostComments.name,
|
|
70
|
+
schema: post_comments_entity_1.PostCommentSchema,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: post_likes_entity_1.PostLikes.name,
|
|
74
|
+
schema: post_likes_entity_1.PostLikeSchema,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: posts_entity_1.Posts.name,
|
|
78
|
+
schema: posts_entity_1.PostsSchema,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: story_seen_by_entity_1.StorySeenBy.name,
|
|
82
|
+
schema: story_seen_by_entity_1.StorySeenBySchema,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: contents_entity_1.Contents.name,
|
|
86
|
+
schema: contents_entity_1.ContentsSchema,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
name: defined_texts_entity_1.DefinedTexts.name,
|
|
90
|
+
schema: defined_texts_entity_1.DefinedTextsSchema,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: language_entity_1.Language.name,
|
|
94
|
+
schema: language_entity_1.LanguageSchema,
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
name: notification_entity_1.Notification.name,
|
|
98
|
+
schema: notification_entity_1.NotificationSchema,
|
|
99
|
+
}
|
|
100
|
+
];
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/mongo/index.ts"],"names":[],"mappings":";;;AAAA,gFAA6F;AAC7F,0DAA8D;AAC9D,8DAAoE;AACpE,wEAAiF;AACjF,kEAA0E;AAC1E,8DAAoE;AACpE,wEAAiF;AACjF,sEAA8E;AAC9E,sEAAgF;AAChF,wEAAgF;AAChF,kEAAuE;AACvE,wDAA2D;AAC3D,0DAA8D;AAC9D,sEAA8E;AAC9E,wDAA2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C,IAAI;QACnB,MAAM,EAAE,gCAAc;KACvB;IACD;QACE,IAAI,EAAE,mCAAY,CAAC,IAAI;QACvB,MAAM,EAAE,yCAAkB;KAC3B;IACD;QACE,IAAI,EAAE,0BAAQ,CAAC,IAAI;QACnB,MAAM,EAAE,gCAAc;KACvB;IACD;QACE,IAAI,EAAE,kCAAY,CAAC,IAAI;QACvB,MAAM,EAAE,wCAAkB;KAC3B;CACF,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Document } from 'mongoose';
|
|
2
|
+
export interface IRepository<T extends Document> {
|
|
3
|
+
create(entity: any): Promise<T>;
|
|
4
|
+
findById(id: string): Promise<T | null>;
|
|
5
|
+
findOne(filter: any): Promise<T | null>;
|
|
6
|
+
findMany(filter: any): Promise<T[]>;
|
|
7
|
+
update(id: string, updateData: any): Promise<T | null>;
|
|
8
|
+
delete(id: string): Promise<boolean>;
|
|
9
|
+
countDocuments(filter: any): Promise<number>;
|
|
10
|
+
aggregate(pipeline: any[]): Promise<any[]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.interface.js","sourceRoot":"","sources":["../../../src/mongo/interfaces/repository.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Document, Model } from 'mongoose';
|
|
26
|
+
import { IRepository } from '../interfaces/repository.interface';
|
|
27
|
+
import { Logger } from '@nestjs/common';
|
|
28
|
+
export declare abstract class BaseRepository<T extends Document> implements IRepository<T> {
|
|
29
|
+
protected readonly model: Model<T>;
|
|
30
|
+
protected readonly logger: Logger;
|
|
31
|
+
constructor(model: Model<T>);
|
|
32
|
+
create(entity: any): Promise<T>;
|
|
33
|
+
findById(id: string): Promise<T | null>;
|
|
34
|
+
findOne(filter: any): Promise<T | null>;
|
|
35
|
+
findMany(filter: any): Promise<T[]>;
|
|
36
|
+
findManyQuery(whereClause: any): import("mongoose").Query<import("mongoose").HydratedDocument<T, {}, {}>[], import("mongoose").HydratedDocument<T, {}, {}>, {}, T>;
|
|
37
|
+
update(id: string, updateData: any): Promise<T | null>;
|
|
38
|
+
delete(id: string): Promise<boolean>;
|
|
39
|
+
countDocuments(filter: any): Promise<number>;
|
|
40
|
+
aggregate(pipeline: any[]): Promise<any[]>;
|
|
41
|
+
findWithPopulate(filter: any, populateFields: string[]): Promise<T[]>;
|
|
42
|
+
updateMany(filter: any, updateData: any): Promise<any>;
|
|
43
|
+
updateOne(filter: any, updateData: any): Promise<any>;
|
|
44
|
+
getModel(): Model<T>;
|
|
45
|
+
getCollection(): import("mongoose").Collection<import("bson").Document>;
|
|
46
|
+
findAndCountAll(options?: any): Promise<{
|
|
47
|
+
count: number;
|
|
48
|
+
rows: import("mongoose").HydratedDocument<T, {}, {}>[];
|
|
49
|
+
}>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseRepository = void 0;
|
|
4
|
+
const common_1 = require("@nestjs/common");
|
|
5
|
+
class BaseRepository {
|
|
6
|
+
constructor(model) {
|
|
7
|
+
this.model = model;
|
|
8
|
+
this.logger = new common_1.Logger(this.constructor.name);
|
|
9
|
+
}
|
|
10
|
+
async create(entity) {
|
|
11
|
+
var _a;
|
|
12
|
+
try {
|
|
13
|
+
const created = new this.model(entity);
|
|
14
|
+
return await created.save();
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
this.logger.log(`Create error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
async findById(id) {
|
|
22
|
+
var _a;
|
|
23
|
+
try {
|
|
24
|
+
return await this.model.findById(id, null).exec();
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
this.logger.log(`FindById error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
28
|
+
throw error;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async findOne(filter) {
|
|
32
|
+
var _a;
|
|
33
|
+
try {
|
|
34
|
+
return await this.model.findOne(filter, null).exec();
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
this.logger.log(`FindOne error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async findMany(filter) {
|
|
42
|
+
var _a;
|
|
43
|
+
try {
|
|
44
|
+
return await this.model.find(filter, null).exec();
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
this.logger.log(`FindMany error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
48
|
+
throw error;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
findManyQuery(whereClause) {
|
|
52
|
+
return this.model.find(whereClause);
|
|
53
|
+
}
|
|
54
|
+
async update(id, updateData) {
|
|
55
|
+
var _a;
|
|
56
|
+
try {
|
|
57
|
+
return await this.model.findByIdAndUpdate(id, updateData).exec();
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
this.logger.log(`Update error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
61
|
+
throw error;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
async delete(id) {
|
|
65
|
+
var _a;
|
|
66
|
+
try {
|
|
67
|
+
const result = await this.model.findByIdAndDelete(id).exec();
|
|
68
|
+
return !!result;
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
this.logger.log(`Delete error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async countDocuments(filter) {
|
|
76
|
+
var _a;
|
|
77
|
+
try {
|
|
78
|
+
return await this.model.countDocuments(filter).exec();
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
this.logger.log(`CountDocuments error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
82
|
+
throw error;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async aggregate(pipeline) {
|
|
86
|
+
var _a;
|
|
87
|
+
try {
|
|
88
|
+
return await this.model.aggregate(pipeline).exec();
|
|
89
|
+
}
|
|
90
|
+
catch (error) {
|
|
91
|
+
this.logger.log(`Aggregate error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
92
|
+
throw error;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async findWithPopulate(filter, populateFields) {
|
|
96
|
+
var _a;
|
|
97
|
+
try {
|
|
98
|
+
return await this.model.find(filter, null).populate(populateFields).exec();
|
|
99
|
+
}
|
|
100
|
+
catch (error) {
|
|
101
|
+
this.logger.log(`FindWithPopulate error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
async updateMany(filter, updateData) {
|
|
106
|
+
var _a;
|
|
107
|
+
try {
|
|
108
|
+
return await this.model.updateMany(filter, { $set: updateData }).exec();
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
this.logger.log(`UpdateMany error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
112
|
+
throw error;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
async updateOne(filter, updateData) {
|
|
116
|
+
var _a;
|
|
117
|
+
try {
|
|
118
|
+
return await this.model.updateOne(filter, updateData).exec();
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
this.logger.log(`UpdateOne error: ${(_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : error}`);
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
getModel() {
|
|
126
|
+
return this.model;
|
|
127
|
+
}
|
|
128
|
+
getCollection() {
|
|
129
|
+
return this.model.collection;
|
|
130
|
+
}
|
|
131
|
+
async findAndCountAll(options = {}) {
|
|
132
|
+
var _a, _b, _c;
|
|
133
|
+
try {
|
|
134
|
+
const filter = (_a = options.filter) !== null && _a !== void 0 ? _a : {};
|
|
135
|
+
const limit = options.limit;
|
|
136
|
+
const skip = options.skip;
|
|
137
|
+
const sort = options.sort;
|
|
138
|
+
const query = this.model.find(filter);
|
|
139
|
+
if (limit !== undefined)
|
|
140
|
+
query.limit(limit);
|
|
141
|
+
if (skip !== undefined)
|
|
142
|
+
query.skip(skip);
|
|
143
|
+
if (sort !== undefined)
|
|
144
|
+
query.sort(sort);
|
|
145
|
+
const [count, rows] = await Promise.all([
|
|
146
|
+
this.model.countDocuments(filter).exec(),
|
|
147
|
+
query.exec()
|
|
148
|
+
]);
|
|
149
|
+
return {
|
|
150
|
+
count,
|
|
151
|
+
rows
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
this.logger.log(`FindAndCountAll failed: ${(_b = error === null || error === void 0 ? void 0 : error.message) !== null && _b !== void 0 ? _b : error}`);
|
|
156
|
+
throw new Error(`FindAndCountAll failed: ${(_c = error === null || error === void 0 ? void 0 : error.message) !== null && _c !== void 0 ? _c : error}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.BaseRepository = BaseRepository;
|
|
161
|
+
//# sourceMappingURL=base.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.repository.js","sourceRoot":"","sources":["../../../src/mongo/repositories/base.repository.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AAExC,MAAsB,cAAc;IAGlC,YAA+B,KAAe;QAAf,UAAK,GAAL,KAAK,CAAU;QAF3B,WAAM,GAAG,IAAI,eAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAEZ,CAAC;IAEnD,KAAK,CAAC,MAAM,CAAC,MAAW;;QACtB,IAAI;YACF,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACvC,OAAO,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;SAC7B;QACD,OAAO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,CAAC,MAAM,CAAC,GAAG,CAAC,2BAA2B,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,KAAK,EAAE,CAAC,CAAA;YACrE,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,mCAAI,KAAK,EAAE,CAAC,CAAC;SACvE;IACH,CAAC;CACF;AA5JD,wCA4JC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.RepositoryFactory = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const base_repository_1 = require("./base.repository");
|
|
12
|
+
let RepositoryFactory = class RepositoryFactory {
|
|
13
|
+
createRepository(model) {
|
|
14
|
+
return new (class extends base_repository_1.BaseRepository {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(model);
|
|
17
|
+
}
|
|
18
|
+
})();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
RepositoryFactory = __decorate([
|
|
22
|
+
(0, common_1.Injectable)()
|
|
23
|
+
], RepositoryFactory);
|
|
24
|
+
exports.RepositoryFactory = RepositoryFactory;
|
|
25
|
+
//# sourceMappingURL=repository.factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.factory.js","sourceRoot":"","sources":["../../../src/mongo/repositories/repository.factory.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAE5C,uDAAmD;AAG5C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,gBAAgB,CAAqB,KAAe;QAClD,OAAO,IAAI,CAAC,KAAM,SAAQ,gCAAiB;YACzC;gBACE,KAAK,CAAC,KAAK,CAAC,CAAC;YACf,CAAC;SACF,CAAC,EAAE,CAAC;IACP,CAAC;CACF,CAAA;AARY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAQ7B;AARY,8CAAiB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Document, Types } from 'mongoose';
|
|
26
|
+
import { EnumPublisherStatus } from '../../models/enum/index';
|
|
27
|
+
export type AgencyPublishersDocument = AgencyPublishers & Document;
|
|
28
|
+
export declare class AgencyPublishers {
|
|
29
|
+
status: EnumPublisherStatus;
|
|
30
|
+
agent_id: Types.ObjectId;
|
|
31
|
+
member_id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
sur_name: string;
|
|
34
|
+
gsm: string;
|
|
35
|
+
media: string;
|
|
36
|
+
nickname: string;
|
|
37
|
+
}
|
|
38
|
+
export declare const AgencyPublishersSchema: import("mongoose").Schema<AgencyPublishers, import("mongoose").Model<AgencyPublishers, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, AgencyPublishers>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgencyPublishersSchema = exports.AgencyPublishers = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const mongoose_2 = require("mongoose");
|
|
15
|
+
const index_1 = require("../../models/enum/index");
|
|
16
|
+
let AgencyPublishers = class AgencyPublishers {
|
|
17
|
+
};
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, mongoose_1.Prop)({ default: index_1.EnumPublisherStatus.P }),
|
|
20
|
+
__metadata("design:type", String)
|
|
21
|
+
], AgencyPublishers.prototype, "status", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, mongoose_1.Prop)({ type: mongoose_2.Types.ObjectId, required: true, ref: 'Agency' }),
|
|
24
|
+
__metadata("design:type", mongoose_2.Types.ObjectId)
|
|
25
|
+
], AgencyPublishers.prototype, "agent_id", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], AgencyPublishers.prototype, "member_id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, mongoose_1.Prop)(),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], AgencyPublishers.prototype, "name", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, mongoose_1.Prop)(),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], AgencyPublishers.prototype, "sur_name", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, mongoose_1.Prop)(),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], AgencyPublishers.prototype, "gsm", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, mongoose_1.Prop)(),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], AgencyPublishers.prototype, "media", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, mongoose_1.Prop)(),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], AgencyPublishers.prototype, "nickname", void 0);
|
|
50
|
+
AgencyPublishers = __decorate([
|
|
51
|
+
(0, mongoose_1.Schema)({
|
|
52
|
+
timestamps: true,
|
|
53
|
+
collection: 'AgencyPublishers'
|
|
54
|
+
})
|
|
55
|
+
], AgencyPublishers);
|
|
56
|
+
exports.AgencyPublishers = AgencyPublishers;
|
|
57
|
+
exports.AgencyPublishersSchema = mongoose_1.SchemaFactory.createForClass(AgencyPublishers);
|
|
58
|
+
//# sourceMappingURL=agency-publishers.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agency-publishers.entity.js","sourceRoot":"","sources":["../../../src/mongo/schema/agency-publishers.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAC/D,uCAA2C;AAC3C,mDAA8D;AAQvD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAkB5B,CAAA;AAhBC;IAAC,IAAA,eAAI,EAAC,EAAE,OAAO,EAAE,2BAAmB,CAAC,CAAC,EAAE,CAAC;;gDACb;AAC5B;IAAC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,gBAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC;8BACpD,gBAAK,CAAC,QAAQ;kDAAC;AACzB;IAAC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;mDACP;AAClB;IAAC,IAAA,eAAI,GAAE;;8CACM;AACb;IAAC,IAAA,eAAI,GAAE;;kDACU;AACjB;IAAC,IAAA,eAAI,GAAE;;6CACK;AACZ;IAAC,IAAA,eAAI,GAAE;;+CACO;AACd;IAAC,IAAA,eAAI,GAAE;;kDACU;AAjBN,gBAAgB;IAJ5B,IAAA,iBAAM,EAAC;QACN,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,kBAAkB;KAC/B,CAAC;GACW,gBAAgB,CAkB5B;AAlBY,4CAAgB;AAoBhB,QAAA,sBAAsB,GAAG,wBAAa,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Document } from 'mongoose';
|
|
26
|
+
import { EnumStatus } from '../../models/enum/index';
|
|
27
|
+
export type AgencyDocument = Agency & Document;
|
|
28
|
+
export declare class Agency {
|
|
29
|
+
status: EnumStatus;
|
|
30
|
+
name: string;
|
|
31
|
+
agent_name: string;
|
|
32
|
+
agent_gsm: string;
|
|
33
|
+
}
|
|
34
|
+
export declare const AgencySchema: import("mongoose").Schema<Agency, import("mongoose").Model<Agency, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Agency>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AgencySchema = exports.Agency = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
const index_1 = require("../../models/enum/index");
|
|
15
|
+
let Agency = class Agency {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, mongoose_1.Prop)({ default: index_1.EnumStatus.A }),
|
|
19
|
+
__metadata("design:type", String)
|
|
20
|
+
], Agency.prototype, "status", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], Agency.prototype, "name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], Agency.prototype, "agent_name", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], Agency.prototype, "agent_gsm", void 0);
|
|
33
|
+
Agency = __decorate([
|
|
34
|
+
(0, mongoose_1.Schema)({
|
|
35
|
+
timestamps: true,
|
|
36
|
+
collection: 'Agency'
|
|
37
|
+
})
|
|
38
|
+
], Agency);
|
|
39
|
+
exports.Agency = Agency;
|
|
40
|
+
exports.AgencySchema = mongoose_1.SchemaFactory.createForClass(Agency);
|
|
41
|
+
//# sourceMappingURL=agency.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agency.entity.js","sourceRoot":"","sources":["../../../src/mongo/schema/agency.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAE/D,mDAAqD;AAQ9C,IAAM,MAAM,GAAZ,MAAM,MAAM;CAUlB,CAAA;AARG;IAAC,IAAA,eAAI,EAAC,EAAE,OAAO,EAAE,kBAAU,CAAC,CAAC,EAAE,CAAC;;sCACb;AACnB;IAAC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;oCACZ;AACb;IAAC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACN;AACnB;IAAC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACP;AATT,MAAM;IAJlB,IAAA,iBAAM,EAAC;QACJ,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,QAAQ;KACvB,CAAC;GACW,MAAM,CAUlB;AAVY,wBAAM;AAYN,QAAA,YAAY,GAAG,wBAAa,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Document } from 'mongoose';
|
|
26
|
+
export type ContentsDocument = Contents & Document;
|
|
27
|
+
export declare class Contents {
|
|
28
|
+
code: string;
|
|
29
|
+
title: string;
|
|
30
|
+
desc: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const ContentsSchema: import("mongoose").Schema<Contents, import("mongoose").Model<Contents, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Contents>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContentsSchema = exports.Contents = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
let Contents = class Contents {
|
|
15
|
+
};
|
|
16
|
+
__decorate([
|
|
17
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
18
|
+
__metadata("design:type", String)
|
|
19
|
+
], Contents.prototype, "code", void 0);
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
22
|
+
__metadata("design:type", String)
|
|
23
|
+
], Contents.prototype, "title", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, mongoose_1.Prop)({ required: true }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], Contents.prototype, "desc", void 0);
|
|
28
|
+
Contents = __decorate([
|
|
29
|
+
(0, mongoose_1.Schema)({
|
|
30
|
+
timestamps: true,
|
|
31
|
+
collection: 'Contents'
|
|
32
|
+
})
|
|
33
|
+
], Contents);
|
|
34
|
+
exports.Contents = Contents;
|
|
35
|
+
exports.ContentsSchema = mongoose_1.SchemaFactory.createForClass(Contents);
|
|
36
|
+
//# sourceMappingURL=contents.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contents.entity.js","sourceRoot":"","sources":["../../../src/mongo/schema/contents.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA+D;AAQxD,IAAM,QAAQ,GAAd,MAAM,QAAQ;CASpB,CAAA;AARG;IAAC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACZ;AAEb;IAAC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;uCACX;AAEd;IAAC,IAAA,eAAI,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;sCACZ;AARJ,QAAQ;IAJpB,IAAA,iBAAM,EAAC;QACJ,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,UAAU;KACzB,CAAC;GACW,QAAQ,CASpB;AATY,4BAAQ;AAUR,QAAA,cAAc,GAAG,wBAAa,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC"}
|