@brimble/models 1.4.87 → 1.4.88
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/.turbo/turbo-build.log +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/subscription.d.ts +4 -0
- package/dist/subscription.js +41 -0
- package/dist/team.js +1 -1
- package/dist/tenancy.js +0 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/server.d.ts +1 -0
- package/dist/types/subscription.d.ts +16 -0
- package/dist/types/subscription.js +2 -0
- package/dist/types/team.d.ts +2 -2
- package/index.ts +2 -2
- package/package.json +2 -2
- package/{subscription_plan.ts → subscription.ts} +4 -3
- package/team.ts +1 -1
- package/tenancy.ts +0 -4
- package/types/index.ts +1 -1
- package/types/server.ts +2 -0
- package/types/{subscription_plan.ts → subscription.ts} +3 -1
- package/types/team.ts +2 -2
package/.turbo/turbo-build.log
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -8,11 +8,11 @@ export { default as Token } from "./token";
|
|
|
8
8
|
export { default as Team } from "./team";
|
|
9
9
|
export { default as Member } from "./member";
|
|
10
10
|
export { default as Log } from "./logs";
|
|
11
|
-
export { default as SubscriptionPlan } from "./
|
|
11
|
+
export { default as SubscriptionPlan } from "./subscription";
|
|
12
12
|
export { default as Card } from "./card";
|
|
13
13
|
export { default as Server } from "./server";
|
|
14
14
|
export { default as Tenancy } from "./tenancy";
|
|
15
|
-
export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IServer, ITenancy, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog,
|
|
15
|
+
export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IServer, ITenancy, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard } from "./types";
|
|
16
16
|
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, PROJECT_STATUS, SUBSCRIPTION_STATUS, CARD_TYPES } from "./enum";
|
|
17
17
|
import mongoose from "mongoose";
|
|
18
18
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -33,8 +33,8 @@ var member_1 = require("./member");
|
|
|
33
33
|
Object.defineProperty(exports, "Member", { enumerable: true, get: function () { return __importDefault(member_1).default; } });
|
|
34
34
|
var logs_1 = require("./logs");
|
|
35
35
|
Object.defineProperty(exports, "Log", { enumerable: true, get: function () { return __importDefault(logs_1).default; } });
|
|
36
|
-
var
|
|
37
|
-
Object.defineProperty(exports, "SubscriptionPlan", { enumerable: true, get: function () { return __importDefault(
|
|
36
|
+
var subscription_1 = require("./subscription");
|
|
37
|
+
Object.defineProperty(exports, "SubscriptionPlan", { enumerable: true, get: function () { return __importDefault(subscription_1).default; } });
|
|
38
38
|
var card_1 = require("./card");
|
|
39
39
|
Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return __importDefault(card_1).default; } });
|
|
40
40
|
var server_1 = require("./server");
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const subscriptionPlanSchema = new mongoose_1.Schema({
|
|
6
|
+
team_id: {
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
required: true,
|
|
9
|
+
ref: "Team",
|
|
10
|
+
},
|
|
11
|
+
admin_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
required: true,
|
|
14
|
+
ref: "User",
|
|
15
|
+
},
|
|
16
|
+
plan_code: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
|
+
unique: true,
|
|
20
|
+
},
|
|
21
|
+
status: {
|
|
22
|
+
type: String,
|
|
23
|
+
enum: Object.values(enum_1.SUBSCRIPTION_STATUS),
|
|
24
|
+
default: enum_1.SUBSCRIPTION_STATUS.ACTIVE
|
|
25
|
+
},
|
|
26
|
+
specifications: {
|
|
27
|
+
type: Object,
|
|
28
|
+
default: {},
|
|
29
|
+
select: true
|
|
30
|
+
},
|
|
31
|
+
amount: Number,
|
|
32
|
+
debit_date: String,
|
|
33
|
+
start_date: String,
|
|
34
|
+
expiry_date: String,
|
|
35
|
+
reminder_date: String,
|
|
36
|
+
transaction_retries: Number,
|
|
37
|
+
}, {
|
|
38
|
+
timestamps: true,
|
|
39
|
+
collection: "subscriptions"
|
|
40
|
+
});
|
|
41
|
+
exports.default = (0, mongoose_1.model)("Subscription", subscriptionPlanSchema);
|
package/dist/team.js
CHANGED
|
@@ -28,7 +28,7 @@ const teamSchema = new mongoose_1.Schema({
|
|
|
28
28
|
subscription: {
|
|
29
29
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
30
30
|
required: false,
|
|
31
|
-
ref: "
|
|
31
|
+
ref: "Subscription",
|
|
32
32
|
},
|
|
33
33
|
tenant: { type: mongoose_1.Schema.Types.ObjectId, ref: "Tenancy", required: false }
|
|
34
34
|
}, {
|
package/dist/tenancy.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { ITeam } from "./team";
|
|
|
10
10
|
export { IMember } from "./member";
|
|
11
11
|
export { IInstalledIntegration } from "./installed_integration";
|
|
12
12
|
export { ILog } from "./logs";
|
|
13
|
-
export {
|
|
13
|
+
export { ISubscription } from "./subscription";
|
|
14
14
|
export { ICard } from "./card";
|
|
15
15
|
export { ITenancy } from "./tenancy";
|
|
16
16
|
export { IServer } from "./server";
|
package/dist/types/server.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { SUBSCRIPTION_STATUS } from "../enum";
|
|
3
|
+
export interface ISubscription extends Document {
|
|
4
|
+
team_id: string;
|
|
5
|
+
admin_id: string;
|
|
6
|
+
plan_code: string;
|
|
7
|
+
status: SUBSCRIPTION_STATUS;
|
|
8
|
+
amount: number;
|
|
9
|
+
debit_date: string;
|
|
10
|
+
start_date: string;
|
|
11
|
+
expiry_date: string;
|
|
12
|
+
reminder_date: string;
|
|
13
|
+
specifications: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
}
|
package/dist/types/team.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { IMember, IProject,
|
|
2
|
+
import { IMember, IProject, ISubscription, ITenancy } from "./";
|
|
3
3
|
export interface ITeam extends Document {
|
|
4
4
|
name: string;
|
|
5
5
|
description: string;
|
|
@@ -8,5 +8,5 @@ export interface ITeam extends Document {
|
|
|
8
8
|
image: string;
|
|
9
9
|
isCreator: boolean;
|
|
10
10
|
tenant: ITenancy;
|
|
11
|
-
subscription:
|
|
11
|
+
subscription: ISubscription;
|
|
12
12
|
}
|
package/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { default as Token } from "./token";
|
|
|
8
8
|
export { default as Team } from "./team";
|
|
9
9
|
export { default as Member } from "./member";
|
|
10
10
|
export { default as Log } from "./logs";
|
|
11
|
-
export { default as SubscriptionPlan } from "./
|
|
11
|
+
export { default as SubscriptionPlan } from "./subscription";
|
|
12
12
|
export { default as Card } from "./card";
|
|
13
13
|
export { default as Server } from "./server";
|
|
14
14
|
export { default as Tenancy } from "./tenancy";
|
|
@@ -28,7 +28,7 @@ export {
|
|
|
28
28
|
ITeam,
|
|
29
29
|
IInstalledIntegration,
|
|
30
30
|
ILog,
|
|
31
|
-
|
|
31
|
+
ISubscription,
|
|
32
32
|
ICard
|
|
33
33
|
} from "./types";
|
|
34
34
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brimble/models",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.88",
|
|
4
4
|
"description": "Brimble models",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"ts-node": "^8.10.2",
|
|
22
22
|
"typescript": "^4.9.4"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "a27fbadaa6239b541cc151b7e277f444b44720c9"
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { model, Schema } from "mongoose";
|
|
2
2
|
import {SUBSCRIPTION_STATUS} from "./enum";
|
|
3
|
-
import {
|
|
3
|
+
import {ISubscription} from "./types";
|
|
4
4
|
|
|
5
5
|
const subscriptionPlanSchema: Schema = new Schema({
|
|
6
6
|
team_id: {
|
|
@@ -31,13 +31,14 @@ const subscriptionPlanSchema: Schema = new Schema({
|
|
|
31
31
|
amount: Number,
|
|
32
32
|
debit_date: String,
|
|
33
33
|
start_date: String,
|
|
34
|
+
expiry_date: String,
|
|
34
35
|
reminder_date: String,
|
|
35
36
|
transaction_retries: Number,
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
timestamps: true,
|
|
39
|
-
collection: "
|
|
40
|
+
collection: "subscriptions"
|
|
40
41
|
},
|
|
41
42
|
);
|
|
42
43
|
|
|
43
|
-
export default model<
|
|
44
|
+
export default model<ISubscription>("Subscription", subscriptionPlanSchema);
|
package/team.ts
CHANGED
package/tenancy.ts
CHANGED
package/types/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { ITeam } from "./team";
|
|
|
10
10
|
export { IMember } from "./member";
|
|
11
11
|
export { IInstalledIntegration } from "./installed_integration";
|
|
12
12
|
export { ILog } from "./logs";
|
|
13
|
-
export {
|
|
13
|
+
export { ISubscription } from "./subscription";
|
|
14
14
|
export { ICard } from "./card";
|
|
15
15
|
export { ITenancy } from "./tenancy";
|
|
16
16
|
export { IServer } from "./server";
|
package/types/server.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import {SUBSCRIPTION_STATUS} from "../enum";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export interface ISubscription extends Document {
|
|
4
5
|
team_id: string;
|
|
5
6
|
admin_id: string;
|
|
6
7
|
plan_code: string;
|
|
@@ -8,6 +9,7 @@ export interface ISubscriptionPlan extends Document {
|
|
|
8
9
|
amount: number;
|
|
9
10
|
debit_date: string;
|
|
10
11
|
start_date: string;
|
|
12
|
+
expiry_date: string;
|
|
11
13
|
reminder_date: string;
|
|
12
14
|
specifications: {
|
|
13
15
|
[key: string]: any;
|
package/types/team.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import {IMember, IProject,
|
|
2
|
+
import {IMember, IProject, ISubscription, ITenancy} from "./";
|
|
3
3
|
|
|
4
4
|
export interface ITeam extends Document {
|
|
5
5
|
name: string;
|
|
@@ -9,5 +9,5 @@ export interface ITeam extends Document {
|
|
|
9
9
|
image: string;
|
|
10
10
|
isCreator: boolean;
|
|
11
11
|
tenant: ITenancy;
|
|
12
|
-
subscription:
|
|
12
|
+
subscription: ISubscription;
|
|
13
13
|
}
|