Spaces:
Runtime error
Runtime error
Commit ·
fce755d
1
Parent(s): 7415b6b
capitalize interface names
Browse files- src/models/permissions.ts +2 -2
- src/models/roles.ts +2 -2
- src/models/settings.ts +2 -2
- src/models/users.ts +2 -2
- src/shared/permission.interface.ts +3 -3
- src/shared/role.interface.ts +3 -3
- src/shared/setting.interface.ts +3 -3
- src/shared/user.interface.ts +3 -3
src/models/permissions.ts
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
| 8 |
|
| 9 |
import { sequelize } from '../db/models/index';
|
| 10 |
import Role from './roles';
|
| 11 |
-
import {
|
| 12 |
|
| 13 |
-
class Permission extends Model<InferAttributes<Permission>, InferCreationAttributes<Permission>> implements
|
| 14 |
declare id: CreationOptional<number>;
|
| 15 |
declare role_id: number;
|
| 16 |
declare name: string;
|
|
|
|
| 8 |
|
| 9 |
import { sequelize } from '../db/models/index';
|
| 10 |
import Role from './roles';
|
| 11 |
+
import { PermissionInterface } from '../shared/permission.interface';
|
| 12 |
|
| 13 |
+
class Permission extends Model<InferAttributes<Permission>, InferCreationAttributes<Permission>> implements PermissionInterface {
|
| 14 |
declare id: CreationOptional<number>;
|
| 15 |
declare role_id: number;
|
| 16 |
declare name: string;
|
src/models/roles.ts
CHANGED
|
@@ -8,9 +8,9 @@ import {
|
|
| 8 |
import { sequelize } from '../db/models/index';
|
| 9 |
import User from './users';
|
| 10 |
import Permission from './permissions';
|
| 11 |
-
import {
|
| 12 |
|
| 13 |
-
class Role extends Model<InferAttributes<Role>, InferCreationAttributes<Role>> implements
|
| 14 |
declare id: CreationOptional<number>;
|
| 15 |
declare name: string;
|
| 16 |
declare permissions: string;
|
|
|
|
| 8 |
import { sequelize } from '../db/models/index';
|
| 9 |
import User from './users';
|
| 10 |
import Permission from './permissions';
|
| 11 |
+
import { RoleInterface } from '../shared/role.interface';
|
| 12 |
|
| 13 |
+
class Role extends Model<InferAttributes<Role>, InferCreationAttributes<Role>> implements RoleInterface {
|
| 14 |
declare id: CreationOptional<number>;
|
| 15 |
declare name: string;
|
| 16 |
declare permissions: string;
|
src/models/settings.ts
CHANGED
|
@@ -6,9 +6,9 @@ import {
|
|
| 6 |
CreationOptional,
|
| 7 |
} from 'sequelize';
|
| 8 |
import { sequelize } from '../db/models/index';
|
| 9 |
-
import {
|
| 10 |
|
| 11 |
-
class Setting extends Model<InferAttributes<Setting>, InferCreationAttributes<Setting>> implements
|
| 12 |
declare id: CreationOptional<number>;
|
| 13 |
declare setting_key: string;
|
| 14 |
declare setting_value: string;
|
|
|
|
| 6 |
CreationOptional,
|
| 7 |
} from 'sequelize';
|
| 8 |
import { sequelize } from '../db/models/index';
|
| 9 |
+
import { SettingInterface } from '../shared/setting.interface';
|
| 10 |
|
| 11 |
+
class Setting extends Model<InferAttributes<Setting>, InferCreationAttributes<Setting>> implements SettingInterface {
|
| 12 |
declare id: CreationOptional<number>;
|
| 13 |
declare setting_key: string;
|
| 14 |
declare setting_value: string;
|
src/models/users.ts
CHANGED
|
@@ -7,9 +7,9 @@ import {
|
|
| 7 |
} from 'sequelize';
|
| 8 |
import { sequelize } from '../db/models/index';
|
| 9 |
import Role from './roles';
|
| 10 |
-
import {
|
| 11 |
|
| 12 |
-
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> implements
|
| 13 |
declare id: CreationOptional<number>;
|
| 14 |
declare name: string;
|
| 15 |
declare email: string;
|
|
|
|
| 7 |
} from 'sequelize';
|
| 8 |
import { sequelize } from '../db/models/index';
|
| 9 |
import Role from './roles';
|
| 10 |
+
import { UserInterface } from '../shared/user.interface';
|
| 11 |
|
| 12 |
+
class User extends Model<InferAttributes<User>, InferCreationAttributes<User>> implements UserInterface {
|
| 13 |
declare id: CreationOptional<number>;
|
| 14 |
declare name: string;
|
| 15 |
declare email: string;
|
src/shared/permission.interface.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
export interface
|
| 2 |
-
id?: number;
|
| 3 |
role_id: number;
|
| 4 |
name: string;
|
| 5 |
-
}
|
|
|
|
| 1 |
+
export interface PermissionInterface {
|
| 2 |
+
id?: number; // Optional for creation
|
| 3 |
role_id: number;
|
| 4 |
name: string;
|
| 5 |
+
}
|
src/shared/role.interface.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
export interface
|
| 2 |
-
id?: number;
|
| 3 |
name: string;
|
| 4 |
permissions: string;
|
| 5 |
-
}
|
|
|
|
| 1 |
+
export interface RoleInterface {
|
| 2 |
+
id?: number; // Optional for creation
|
| 3 |
name: string;
|
| 4 |
permissions: string;
|
| 5 |
+
}
|
src/shared/setting.interface.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
export interface
|
| 2 |
-
id?: number;
|
| 3 |
setting_key: string;
|
| 4 |
setting_value: string;
|
| 5 |
-
}
|
|
|
|
| 1 |
+
export interface SettingInterface {
|
| 2 |
+
id?: number; // Optional for creation
|
| 3 |
setting_key: string;
|
| 4 |
setting_value: string;
|
| 5 |
+
}
|
src/shared/user.interface.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
-
export interface
|
| 2 |
-
id?: number;
|
| 3 |
name: string;
|
| 4 |
email: string;
|
| 5 |
role_id: number;
|
| 6 |
status: string;
|
| 7 |
-
}
|
|
|
|
| 1 |
+
export interface UserInterface {
|
| 2 |
+
id?: number; // Optional for creation
|
| 3 |
name: string;
|
| 4 |
email: string;
|
| 5 |
role_id: number;
|
| 6 |
status: string;
|
| 7 |
+
}
|