90dc-core 1.8.0 → 1.8.2
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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Model } from "sequelize-typescript";
|
|
2
2
|
import { SubscriptionLog } from "./SubscriptionLog";
|
|
3
3
|
import { PersistedUser } from "./PersistedUser";
|
|
4
|
+
import type { CreationOptional } from "sequelize";
|
|
4
5
|
export declare class Subscription extends Model {
|
|
5
6
|
userUuid: string;
|
|
6
7
|
identifier: string;
|
|
@@ -11,4 +12,5 @@ export declare class Subscription extends Model {
|
|
|
11
12
|
startDate: Date;
|
|
12
13
|
user: PersistedUser;
|
|
13
14
|
subscriptionLogs: SubscriptionLog[];
|
|
15
|
+
createdAt: CreationOptional<Date> | null;
|
|
14
16
|
}
|
|
@@ -4,7 +4,7 @@ var __decorate = this && this.__decorate || function(decorators, target, key, de
|
|
|
4
4
|
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;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import { BelongsTo, Column, DataType, ForeignKey, HasMany, Model, PrimaryKey, Table } from "sequelize-typescript";
|
|
7
|
+
import { BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, HasMany, Model, PrimaryKey, Table } from "sequelize-typescript";
|
|
8
8
|
import { SubscriptionLog } from "./SubscriptionLog";
|
|
9
9
|
import { PersistedUser } from "./PersistedUser";
|
|
10
10
|
export let Subscription = class Subscription extends Model {
|
|
@@ -60,10 +60,18 @@ __decorate([
|
|
|
60
60
|
__decorate([
|
|
61
61
|
HasMany(()=>SubscriptionLog)
|
|
62
62
|
], Subscription.prototype, "subscriptionLogs", void 0);
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
__decorate([
|
|
64
|
+
CreatedAt,
|
|
65
|
+
Default(null) // Set the default value to null
|
|
66
|
+
,
|
|
67
|
+
Column({
|
|
68
|
+
type: DataType.DATE,
|
|
69
|
+
allowNull: true,
|
|
70
|
+
defaultValue: new Date()
|
|
66
71
|
})
|
|
72
|
+
], Subscription.prototype, "createdAt", void 0);
|
|
73
|
+
Subscription = __decorate([
|
|
74
|
+
Table
|
|
67
75
|
], Subscription);
|
|
68
76
|
|
|
69
77
|
//# sourceMappingURL=Subscription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/lib/dbmodels/Subscription.ts"],"sourcesContent":["import {\n BelongsTo,\n Column,\n DataType,\n ForeignKey,\n HasMany,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport { SubscriptionLog } from \"./SubscriptionLog\";\nimport {PersistedUser} from \"./PersistedUser\";\n\n@Table
|
|
1
|
+
{"version":3,"sources":["../../../src/lib/dbmodels/Subscription.ts"],"sourcesContent":["import {\n BelongsTo,\n Column, CreatedAt,\n DataType, Default,\n ForeignKey,\n HasMany,\n Model,\n PrimaryKey,\n Table,\n} from \"sequelize-typescript\";\nimport { SubscriptionLog } from \"./SubscriptionLog\";\nimport {PersistedUser} from \"./PersistedUser\";\nimport type {CreationOptional} from \"sequelize\";\n\n@Table\nexport class Subscription extends Model {\n @ForeignKey(() => PersistedUser)\n @PrimaryKey\n @Column({\n type: DataType.UUID,\n allowNull: false,\n primaryKey: true,\n })\n declare userUuid: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare identifier: string;\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare platform: \"google\" | \"apple\" | \"mollie\";\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare status: \"active\" | \"canceled\" | \"expired\";\n\n @Column({ type: DataType.TEXT, allowNull: false })\n declare type: string;\n\n @Column({ type: DataType.DATE, allowNull: false })\n declare expiresOn: Date;\n\n @Column({ type: DataType.DATE, allowNull: false })\n declare startDate: Date;\n\n @BelongsTo(() => PersistedUser)\n declare user: PersistedUser;\n\n @HasMany(() => SubscriptionLog)\n declare subscriptionLogs: SubscriptionLog[];\n\n @CreatedAt\n @Default(null) // Set the default value to null\n @Column({ type: DataType.DATE, allowNull: true, defaultValue: new Date() })\n declare createdAt: CreationOptional<Date> | null;\n}\n"],"names":["BelongsTo","Column","CreatedAt","DataType","Default","ForeignKey","HasMany","Model","PrimaryKey","Table","SubscriptionLog","PersistedUser","Subscription","type","UUID","allowNull","primaryKey","TEXT","DATE","defaultValue","Date"],"mappings":";;;;;;AAAA,SACEA,SAAS,EACTC,MAAM,EAAEC,SAAS,EACjBC,QAAQ,EAAEC,OAAO,EACjBC,UAAU,EACVC,OAAO,EACPC,KAAK,EACLC,UAAU,EACVC,KAAK,QACA,uBAAuB;AAC9B,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAAQC,aAAa,QAAO,kBAAkB;AAI9C,WAAaC,eAAN,2BAA2BL;AAsClC,EAAC;;IArCEF,WAAW,IAAMM;IACjBH;IACAP,OAAO;QACNY,MAAMV,SAASW,IAAI;QACnBC,WAAW,KAAK;QAChBC,YAAY,IAAI;IAClB;GAPWJ;;IAUVX,OAAO;QAAEY,MAAMV,SAASc,IAAI;QAAEF,WAAW,KAAK;IAAC;GAVrCH;;IAaVX,OAAO;QAAEY,MAAMV,SAASc,IAAI;QAAEF,WAAW,KAAK;IAAC;GAbrCH;;IAgBVX,OAAO;QAAEY,MAAMV,SAASc,IAAI;QAAEF,WAAW,KAAK;IAAC;GAhBrCH;;IAmBVX,OAAO;QAAEY,MAAMV,SAASc,IAAI;QAAEF,WAAW,KAAK;IAAC;GAnBrCH;;IAsBVX,OAAO;QAAEY,MAAMV,SAASe,IAAI;QAAEH,WAAW,KAAK;IAAC;GAtBrCH;;IAyBVX,OAAO;QAAEY,MAAMV,SAASe,IAAI;QAAEH,WAAW,KAAK;IAAC;GAzBrCH;;IA4BVZ,UAAU,IAAMW;GA5BNC;;IA+BVN,QAAQ,IAAMI;GA/BJE;;IAkCVV;IACAE,QAAQ,IAAI,EAAE,gCAAgC;;IAC9CH,OAAO;QAAEY,MAAMV,SAASe,IAAI;QAAEH,WAAW,IAAI;QAAEI,cAAc,IAAIC;IAAO;GApC9DR;AAAAA;IADZH;GACYG"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BelongsTo,
|
|
3
|
-
Column,
|
|
4
|
-
DataType,
|
|
3
|
+
Column, CreatedAt,
|
|
4
|
+
DataType, Default,
|
|
5
5
|
ForeignKey,
|
|
6
6
|
HasMany,
|
|
7
7
|
Model,
|
|
@@ -10,8 +10,9 @@ import {
|
|
|
10
10
|
} from "sequelize-typescript";
|
|
11
11
|
import { SubscriptionLog } from "./SubscriptionLog";
|
|
12
12
|
import {PersistedUser} from "./PersistedUser";
|
|
13
|
+
import type {CreationOptional} from "sequelize";
|
|
13
14
|
|
|
14
|
-
@Table
|
|
15
|
+
@Table
|
|
15
16
|
export class Subscription extends Model {
|
|
16
17
|
@ForeignKey(() => PersistedUser)
|
|
17
18
|
@PrimaryKey
|
|
@@ -45,4 +46,9 @@ export class Subscription extends Model {
|
|
|
45
46
|
|
|
46
47
|
@HasMany(() => SubscriptionLog)
|
|
47
48
|
declare subscriptionLogs: SubscriptionLog[];
|
|
49
|
+
|
|
50
|
+
@CreatedAt
|
|
51
|
+
@Default(null) // Set the default value to null
|
|
52
|
+
@Column({ type: DataType.DATE, allowNull: true, defaultValue: new Date() })
|
|
53
|
+
declare createdAt: CreationOptional<Date> | null;
|
|
48
54
|
}
|