mblabs-roccato-backend-commons 1.0.48 → 1.0.50
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/database/entities/account-module.d.ts +1 -0
- package/dist/database/entities/account-module.js +5 -0
- package/dist/database/entities/group-module.d.ts +1 -0
- package/dist/database/entities/group-module.js +5 -0
- package/dist/database/entities/profile-module.d.ts +1 -0
- package/dist/database/entities/profile-module.js +5 -0
- package/dist/database/migrations/1749142329095-CreateGroupModuleTable.js +5 -0
- package/dist/database/migrations/1749142343254-CreateAccountModuleTable.js +5 -0
- package/dist/database/migrations/1751576312683-CreateProfileModuleTable.js +1 -0
- package/dist/services/date.d.ts +1 -1
- package/dist/services/date.js +4 -3
- package/package.json +1 -1
- package/src/database/entities/account-module.ts +3 -0
- package/src/database/entities/group-module.ts +3 -0
- package/src/database/entities/profile-module.ts +3 -0
- package/src/database/migrations/1749142329095-CreateGroupModuleTable.ts +5 -0
- package/src/database/migrations/1749142343254-CreateAccountModuleTable.ts +5 -0
- package/src/database/migrations/1751576312683-CreateProfileModuleTable.ts +1 -0
- package/src/services/date.ts +6 -4
|
@@ -27,6 +27,7 @@ let AccountModuleEntity = class AccountModuleEntity extends base_1.default {
|
|
|
27
27
|
canReview;
|
|
28
28
|
canDownload;
|
|
29
29
|
canUpload;
|
|
30
|
+
canSupport;
|
|
30
31
|
constructor(partial) {
|
|
31
32
|
super();
|
|
32
33
|
Object.assign(this, partial);
|
|
@@ -77,6 +78,10 @@ __decorate([
|
|
|
77
78
|
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
78
79
|
__metadata("design:type", Boolean)
|
|
79
80
|
], AccountModuleEntity.prototype, "canUpload", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
83
|
+
__metadata("design:type", Boolean)
|
|
84
|
+
], AccountModuleEntity.prototype, "canSupport", void 0);
|
|
80
85
|
AccountModuleEntity = __decorate([
|
|
81
86
|
(0, typeorm_1.Entity)('account_module'),
|
|
82
87
|
__metadata("design:paramtypes", [Object])
|
|
@@ -27,6 +27,7 @@ let GroupModuleEntity = class GroupModuleEntity extends base_1.default {
|
|
|
27
27
|
canReview;
|
|
28
28
|
canDownload;
|
|
29
29
|
canUpload;
|
|
30
|
+
canSupport;
|
|
30
31
|
constructor(partial) {
|
|
31
32
|
super();
|
|
32
33
|
Object.assign(this, partial);
|
|
@@ -77,6 +78,10 @@ __decorate([
|
|
|
77
78
|
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
78
79
|
__metadata("design:type", Boolean)
|
|
79
80
|
], GroupModuleEntity.prototype, "canUpload", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
83
|
+
__metadata("design:type", Boolean)
|
|
84
|
+
], GroupModuleEntity.prototype, "canSupport", void 0);
|
|
80
85
|
GroupModuleEntity = __decorate([
|
|
81
86
|
(0, typeorm_1.Entity)('group_module'),
|
|
82
87
|
__metadata("design:paramtypes", [Object])
|
|
@@ -27,6 +27,7 @@ let ProfileModuleEntity = class ProfileModuleEntity extends base_1.default {
|
|
|
27
27
|
canReview;
|
|
28
28
|
canDownload;
|
|
29
29
|
canUpload;
|
|
30
|
+
canSupport;
|
|
30
31
|
constructor(partial) {
|
|
31
32
|
super();
|
|
32
33
|
Object.assign(this, partial);
|
|
@@ -77,6 +78,10 @@ __decorate([
|
|
|
77
78
|
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
78
79
|
__metadata("design:type", Boolean)
|
|
79
80
|
], ProfileModuleEntity.prototype, "canUpload", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.Column)({ type: 'boolean', nullable: true }),
|
|
83
|
+
__metadata("design:type", Boolean)
|
|
84
|
+
], ProfileModuleEntity.prototype, "canSupport", void 0);
|
|
80
85
|
ProfileModuleEntity = __decorate([
|
|
81
86
|
(0, typeorm_1.Entity)('profile_module'),
|
|
82
87
|
__metadata("design:paramtypes", [Object])
|
|
@@ -24,6 +24,7 @@ class CreateProfileModuleTable1751576312683 {
|
|
|
24
24
|
{ name: 'canAssign', type: 'boolean', isNullable: true },
|
|
25
25
|
{ name: 'canReview', type: 'boolean', isNullable: true },
|
|
26
26
|
{ name: 'canDownload', type: 'boolean', isNullable: true },
|
|
27
|
+
{ name: 'canSupport', type: 'boolean', isNullable: true },
|
|
27
28
|
{ name: 'canUpload', type: 'boolean', isNullable: true },
|
|
28
29
|
{ name: 'createdBy', type: 'varchar', isNullable: true },
|
|
29
30
|
{ name: 'createdAt', type: 'timestamptz', default: 'now()' },
|
package/dist/services/date.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ declare class DateService {
|
|
|
24
24
|
getCurrentTimestamp(): number;
|
|
25
25
|
getMillisFromFormattedDate(date: string, format?: string): number;
|
|
26
26
|
getMonthsInRange(startDate: Date, endDate: Date): string[];
|
|
27
|
-
isSameDay(inp: Date, compare?: Date): boolean;
|
|
27
|
+
isSameDay(inp: Date | string, compare?: Date): boolean;
|
|
28
28
|
isToday(date: Date): boolean;
|
|
29
29
|
}
|
|
30
30
|
declare const _default: DateService;
|
package/dist/services/date.js
CHANGED
|
@@ -13,6 +13,7 @@ class DateService {
|
|
|
13
13
|
if (luxon_1.DateTime.fromFormat(inp, format).isValid) {
|
|
14
14
|
return luxon_1.DateTime.fromFormat(inp, format).toJSDate();
|
|
15
15
|
}
|
|
16
|
+
return luxon_1.DateTime.local().toJSDate();
|
|
16
17
|
}
|
|
17
18
|
toFormat(inp, format = constants_1.DATE.SYSTEM.COMMON_DATE) {
|
|
18
19
|
if (inp instanceof Date) {
|
|
@@ -107,9 +108,9 @@ class DateService {
|
|
|
107
108
|
return months;
|
|
108
109
|
}
|
|
109
110
|
isSameDay(inp, compare = this.getCurrentDate()) {
|
|
110
|
-
const
|
|
111
|
-
const
|
|
112
|
-
return
|
|
111
|
+
const startDate = luxon_1.DateTime.fromJSDate(this.toDate(inp)).startOf('day');
|
|
112
|
+
const endDate = luxon_1.DateTime.fromJSDate(this.toDate(compare)).startOf('day');
|
|
113
|
+
return startDate.equals(endDate);
|
|
113
114
|
}
|
|
114
115
|
isToday(date) {
|
|
115
116
|
return this.isSameDay(date);
|
package/package.json
CHANGED
|
@@ -39,6 +39,9 @@ export default class AccountModuleEntity extends BaseEntity {
|
|
|
39
39
|
@Column({ type: 'boolean', nullable: true })
|
|
40
40
|
public canUpload?: boolean;
|
|
41
41
|
|
|
42
|
+
@Column({ type: 'boolean', nullable: true })
|
|
43
|
+
public canSupport?: boolean;
|
|
44
|
+
|
|
42
45
|
constructor (partial: Partial<AccountModuleEntity>) {
|
|
43
46
|
super();
|
|
44
47
|
Object.assign(this, partial);
|
|
@@ -39,6 +39,9 @@ export default class GroupModuleEntity extends BaseEntity {
|
|
|
39
39
|
@Column({ type: 'boolean', nullable: true })
|
|
40
40
|
public canUpload?: boolean;
|
|
41
41
|
|
|
42
|
+
@Column({ type: 'boolean', nullable: true })
|
|
43
|
+
public canSupport?: boolean;
|
|
44
|
+
|
|
42
45
|
constructor (partial: Partial<GroupModuleEntity>) {
|
|
43
46
|
super();
|
|
44
47
|
Object.assign(this, partial);
|
|
@@ -49,6 +49,9 @@ export default class ProfileModuleEntity extends BaseEntity {
|
|
|
49
49
|
@Column({ type: 'boolean', nullable: true })
|
|
50
50
|
public canUpload?: boolean;
|
|
51
51
|
|
|
52
|
+
@Column({ type: 'boolean', nullable: true })
|
|
53
|
+
public canSupport?: boolean;
|
|
54
|
+
|
|
52
55
|
constructor (partial: Partial<ProfileModuleEntity>) {
|
|
53
56
|
super();
|
|
54
57
|
Object.assign(this, partial);
|
|
@@ -22,6 +22,7 @@ export class CreateProfileModuleTable1751576312683 implements MigrationInterface
|
|
|
22
22
|
{ name: 'canAssign', type: 'boolean', isNullable: true },
|
|
23
23
|
{ name: 'canReview', type: 'boolean', isNullable: true },
|
|
24
24
|
{ name: 'canDownload', type: 'boolean', isNullable: true },
|
|
25
|
+
{ name: 'canSupport', type: 'boolean', isNullable: true },
|
|
25
26
|
{ name: 'canUpload', type: 'boolean', isNullable: true },
|
|
26
27
|
{ name: 'createdBy', type: 'varchar', isNullable: true },
|
|
27
28
|
{ name: 'createdAt', type: 'timestamptz', default: 'now()' },
|
package/src/services/date.ts
CHANGED
|
@@ -15,6 +15,8 @@ class DateService {
|
|
|
15
15
|
if (DateTime.fromFormat(inp, format).isValid) {
|
|
16
16
|
return DateTime.fromFormat(inp, format).toJSDate();
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
return DateTime.local().toJSDate();
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
public toFormat (inp: Date | string, format = DATE.SYSTEM.COMMON_DATE): string {
|
|
@@ -141,11 +143,11 @@ class DateService {
|
|
|
141
143
|
return months;
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
public isSameDay (inp: Date, compare = this.getCurrentDate()): boolean {
|
|
145
|
-
const
|
|
146
|
-
const
|
|
146
|
+
public isSameDay (inp: Date | string, compare = this.getCurrentDate()): boolean {
|
|
147
|
+
const startDate = DateTime.fromJSDate(this.toDate(inp)).startOf('day');
|
|
148
|
+
const endDate = DateTime.fromJSDate(this.toDate(compare)).startOf('day');
|
|
147
149
|
|
|
148
|
-
return
|
|
150
|
+
return startDate.equals(endDate);
|
|
149
151
|
}
|
|
150
152
|
|
|
151
153
|
public isToday (date: Date): boolean {
|