@ashutoshvohra136/tenant-db-contract 1.0.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/.prettierrc +32 -0
- package/README.md +12 -0
- package/dist/constants/alert-messages.d.ts +10 -0
- package/dist/constants/alert-messages.js +14 -0
- package/dist/constants/common.option.d.ts +7 -0
- package/dist/constants/common.option.js +10 -0
- package/dist/constants/context.option.d.ts +4 -0
- package/dist/constants/context.option.js +8 -0
- package/dist/constants/date-time.option.d.ts +5 -0
- package/dist/constants/date-time.option.js +21 -0
- package/dist/constants/encryption.option.d.ts +4 -0
- package/dist/constants/encryption.option.js +8 -0
- package/dist/constants/events.option.d.ts +6 -0
- package/dist/constants/events.option.js +10 -0
- package/dist/constants/roles.option.d.ts +8 -0
- package/dist/constants/roles.option.js +12 -0
- package/dist/constants/status-code.option.d.ts +4 -0
- package/dist/constants/status-code.option.js +31 -0
- package/dist/entities/AchievementHistory.d.ts +11 -0
- package/dist/entities/AchievementHistory.js +48 -0
- package/dist/entities/AlertMessages.d.ts +9 -0
- package/dist/entities/AlertMessages.js +45 -0
- package/dist/entities/Analysis.d.ts +17 -0
- package/dist/entities/Analysis.js +68 -0
- package/dist/entities/Answers.d.ts +10 -0
- package/dist/entities/Answers.js +45 -0
- package/dist/entities/ApiResponses.d.ts +14 -0
- package/dist/entities/ApiResponses.js +63 -0
- package/dist/entities/Attachments.d.ts +24 -0
- package/dist/entities/Attachments.js +95 -0
- package/dist/entities/AttendanceDetails.d.ts +25 -0
- package/dist/entities/AttendanceDetails.js +111 -0
- package/dist/entities/BeatPlanCheckIns.d.ts +23 -0
- package/dist/entities/BeatPlanCheckIns.js +96 -0
- package/dist/entities/BeatPlanVisits.d.ts +28 -0
- package/dist/entities/BeatPlanVisits.js +109 -0
- package/dist/entities/BranchManagerBrandsMappings.d.ts +11 -0
- package/dist/entities/BranchManagerBrandsMappings.js +53 -0
- package/dist/entities/BranchManagerMerchandiserMappings.d.ts +12 -0
- package/dist/entities/BranchManagerMerchandiserMappings.js +75 -0
- package/dist/entities/BrandWiseCategory.d.ts +10 -0
- package/dist/entities/BrandWiseCategory.js +44 -0
- package/dist/entities/Brands.d.ts +25 -0
- package/dist/entities/Brands.js +91 -0
- package/dist/entities/Category.d.ts +17 -0
- package/dist/entities/Category.js +70 -0
- package/dist/entities/DamagedProductsRequests.d.ts +12 -0
- package/dist/entities/DamagedProductsRequests.js +50 -0
- package/dist/entities/DamagedProductsRequestsDetails.d.ts +19 -0
- package/dist/entities/DamagedProductsRequestsDetails.js +74 -0
- package/dist/entities/Enum/ImageType.d.ts +8 -0
- package/dist/entities/Enum/ImageType.js +12 -0
- package/dist/entities/Enum/LogType.d.ts +9 -0
- package/dist/entities/Enum/LogType.js +14 -0
- package/dist/entities/Enum/Months.d.ts +14 -0
- package/dist/entities/Enum/Months.js +18 -0
- package/dist/entities/Enum/UserRole.d.ts +13 -0
- package/dist/entities/Enum/UserRole.js +18 -0
- package/dist/entities/Enum/UserRosterAssignStatus.d.ts +8 -0
- package/dist/entities/Enum/UserRosterAssignStatus.js +12 -0
- package/dist/entities/Inventory.d.ts +14 -0
- package/dist/entities/Inventory.js +60 -0
- package/dist/entities/InventoryDetails.d.ts +20 -0
- package/dist/entities/InventoryDetails.js +80 -0
- package/dist/entities/LeaveRequests.d.ts +18 -0
- package/dist/entities/LeaveRequests.js +78 -0
- package/dist/entities/LeaveTypes.d.ts +12 -0
- package/dist/entities/LeaveTypes.js +50 -0
- package/dist/entities/LoginHistory.d.ts +18 -0
- package/dist/entities/LoginHistory.js +89 -0
- package/dist/entities/Notifications.d.ts +18 -0
- package/dist/entities/Notifications.js +73 -0
- package/dist/entities/Offer.d.ts +11 -0
- package/dist/entities/Offer.js +51 -0
- package/dist/entities/OfferLaunch.d.ts +10 -0
- package/dist/entities/OfferLaunch.js +44 -0
- package/dist/entities/POSMMaterials.d.ts +8 -0
- package/dist/entities/POSMMaterials.js +39 -0
- package/dist/entities/POSMRequest.d.ts +12 -0
- package/dist/entities/POSMRequest.js +50 -0
- package/dist/entities/POSMRequestDetails.d.ts +18 -0
- package/dist/entities/POSMRequestDetails.js +70 -0
- package/dist/entities/PasswordManager.d.ts +12 -0
- package/dist/entities/PasswordManager.js +57 -0
- package/dist/entities/Products.d.ts +43 -0
- package/dist/entities/Products.js +170 -0
- package/dist/entities/Question.d.ts +16 -0
- package/dist/entities/Question.js +69 -0
- package/dist/entities/Roles.d.ts +13 -0
- package/dist/entities/Roles.js +50 -0
- package/dist/entities/SalesPunch.d.ts +19 -0
- package/dist/entities/SalesPunch.js +73 -0
- package/dist/entities/SalesPunchingAIAnalysis.d.ts +11 -0
- package/dist/entities/SalesPunchingAIAnalysis.js +49 -0
- package/dist/entities/Schemes.d.ts +12 -0
- package/dist/entities/Schemes.js +53 -0
- package/dist/entities/Shifts.d.ts +14 -0
- package/dist/entities/Shifts.js +57 -0
- package/dist/entities/StockRequest.d.ts +22 -0
- package/dist/entities/StockRequest.js +88 -0
- package/dist/entities/StockRequestDetails.d.ts +20 -0
- package/dist/entities/StockRequestDetails.js +78 -0
- package/dist/entities/StoreBrandsMapping.d.ts +12 -0
- package/dist/entities/StoreBrandsMapping.js +57 -0
- package/dist/entities/StoreShifts.d.ts +13 -0
- package/dist/entities/StoreShifts.js +56 -0
- package/dist/entities/Stores.d.ts +25 -0
- package/dist/entities/Stores.js +92 -0
- package/dist/entities/Task.d.ts +19 -0
- package/dist/entities/Task.js +79 -0
- package/dist/entities/TaskAttachment.d.ts +9 -0
- package/dist/entities/TaskAttachment.js +41 -0
- package/dist/entities/TermsAndCondition.d.ts +9 -0
- package/dist/entities/TermsAndCondition.js +43 -0
- package/dist/entities/UplaodedImages.d.ts +10 -0
- package/dist/entities/UplaodedImages.js +52 -0
- package/dist/entities/UserDetails.d.ts +22 -0
- package/dist/entities/UserDetails.js +97 -0
- package/dist/entities/UserLocations.d.ts +13 -0
- package/dist/entities/UserLocations.js +62 -0
- package/dist/entities/UserQuestionAttemptHistory.d.ts +13 -0
- package/dist/entities/UserQuestionAttemptHistory.js +54 -0
- package/dist/entities/UserRoster.d.ts +17 -0
- package/dist/entities/UserRoster.js +73 -0
- package/dist/entities/UserRosterChanges.d.ts +14 -0
- package/dist/entities/UserRosterChanges.js +59 -0
- package/dist/entities/UserStoreChangedHistory.d.ts +12 -0
- package/dist/entities/UserStoreChangedHistory.js +56 -0
- package/dist/entities/UserVideosAttemptsHistory.d.ts +17 -0
- package/dist/entities/UserVideosAttemptsHistory.js +76 -0
- package/dist/entities/Users.d.ts +92 -0
- package/dist/entities/Users.js +301 -0
- package/dist/entities/Versions.d.ts +15 -0
- package/dist/entities/Versions.js +67 -0
- package/dist/entities/Videos.d.ts +17 -0
- package/dist/entities/Videos.js +62 -0
- package/dist/entities/automation_executions.entity.d.ts +7 -0
- package/dist/entities/automation_executions.entity.js +39 -0
- package/dist/entities/automations.entity.d.ts +16 -0
- package/dist/entities/automations.entity.js +75 -0
- package/dist/entities/entitiesV2/Inventory.d.ts +14 -0
- package/dist/entities/entitiesV2/Inventory.js +60 -0
- package/dist/entities/entitiesV2/InventoryDetails.d.ts +20 -0
- package/dist/entities/entitiesV2/InventoryDetails.js +80 -0
- package/dist/entities/entitiesV2/StockRequest.d.ts +22 -0
- package/dist/entities/entitiesV2/StockRequest.js +88 -0
- package/dist/entities/entitiesV2/StockRequestDetails.d.ts +20 -0
- package/dist/entities/entitiesV2/StockRequestDetails.js +78 -0
- package/dist/entities/fcm.entity.d.ts +9 -0
- package/dist/entities/fcm.entity.js +41 -0
- package/dist/entities/index.d.ts +61 -0
- package/dist/entities/index.js +126 -0
- package/dist/entities/notification-user-history.entity.d.ts +16 -0
- package/dist/entities/notification-user-history.entity.js +68 -0
- package/dist/entities/out-of-range.entity.d.ts +11 -0
- package/dist/entities/out-of-range.entity.js +49 -0
- package/dist/entities/permission-policy.entity.d.ts +7 -0
- package/dist/entities/permission-policy.entity.js +40 -0
- package/dist/entities/target.d.ts +17 -0
- package/dist/entities/target.js +72 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +17 -0
- package/package.json +17 -0
- package/src/constants/alert-messages.ts +10 -0
- package/src/constants/common.option.ts +8 -0
- package/src/constants/context.option.ts +4 -0
- package/src/constants/date-time.option.ts +19 -0
- package/src/constants/encryption.option.ts +4 -0
- package/src/constants/events.option.ts +6 -0
- package/src/constants/roles.option.ts +8 -0
- package/src/constants/status-code.option.ts +43 -0
- package/src/entities/AchievementHistory.ts +37 -0
- package/src/entities/AlertMessages.ts +33 -0
- package/src/entities/Analysis.ts +53 -0
- package/src/entities/Answers.ts +36 -0
- package/src/entities/ApiResponses.ts +45 -0
- package/src/entities/Attachments.ts +81 -0
- package/src/entities/AttendanceDetails.ts +86 -0
- package/src/entities/BeatPlanCheckIns.ts +82 -0
- package/src/entities/BeatPlanVisits.ts +88 -0
- package/src/entities/BranchManagerBrandsMappings.ts +41 -0
- package/src/entities/BranchManagerMerchandiserMappings.ts +65 -0
- package/src/entities/BrandWiseCategory.ts +32 -0
- package/src/entities/Brands.ts +73 -0
- package/src/entities/Category.ts +57 -0
- package/src/entities/DamagedProductsRequests.ts +44 -0
- package/src/entities/DamagedProductsRequestsDetails.ts +65 -0
- package/src/entities/Enum/ImageType.ts +8 -0
- package/src/entities/Enum/LogType.ts +10 -0
- package/src/entities/Enum/Months.ts +14 -0
- package/src/entities/Enum/UserRole.ts +14 -0
- package/src/entities/Enum/UserRosterAssignStatus.ts +8 -0
- package/src/entities/Inventory.ts +50 -0
- package/src/entities/InventoryDetails.ts +63 -0
- package/src/entities/LeaveRequests.ts +61 -0
- package/src/entities/LeaveTypes.ts +38 -0
- package/src/entities/LoginHistory.ts +70 -0
- package/src/entities/Notifications.ts +62 -0
- package/src/entities/Offer.ts +35 -0
- package/src/entities/OfferLaunch.ts +31 -0
- package/src/entities/POSMMaterials.ts +33 -0
- package/src/entities/POSMRequest.ts +41 -0
- package/src/entities/POSMRequestDetails.ts +59 -0
- package/src/entities/PasswordManager.ts +44 -0
- package/src/entities/Products.ts +145 -0
- package/src/entities/Question.ts +57 -0
- package/src/entities/Roles.ts +36 -0
- package/src/entities/SalesPunch.ts +63 -0
- package/src/entities/SalesPunchingAIAnalysis.ts +36 -0
- package/src/entities/Schemes.ts +39 -0
- package/src/entities/Shifts.ts +41 -0
- package/src/entities/StockRequest.ts +68 -0
- package/src/entities/StockRequestDetails.ts +63 -0
- package/src/entities/StoreBrandsMapping.ts +44 -0
- package/src/entities/StoreShifts.ts +46 -0
- package/src/entities/Stores.ts +68 -0
- package/src/entities/Task.ts +60 -0
- package/src/entities/TaskAttachment.ts +29 -0
- package/src/entities/TermsAndCondition.ts +29 -0
- package/src/entities/UplaodedImages.ts +37 -0
- package/src/entities/UserDetails.ts +74 -0
- package/src/entities/UserLocations.ts +49 -0
- package/src/entities/UserQuestionAttemptHistory.ts +49 -0
- package/src/entities/UserRoster.ts +58 -0
- package/src/entities/UserRosterChanges.ts +44 -0
- package/src/entities/UserStoreChangedHistory.ts +40 -0
- package/src/entities/UserVideosAttemptsHistory.ts +64 -0
- package/src/entities/Users.ts +259 -0
- package/src/entities/Versions.ts +47 -0
- package/src/entities/Videos.ts +48 -0
- package/src/entities/automation_executions.entity.ts +24 -0
- package/src/entities/automations.entity.ts +60 -0
- package/src/entities/entitiesV2/Inventory.ts +51 -0
- package/src/entities/entitiesV2/InventoryDetails.ts +63 -0
- package/src/entities/entitiesV2/StockRequest.ts +68 -0
- package/src/entities/entitiesV2/StockRequestDetails.ts +63 -0
- package/src/entities/fcm.entity.ts +30 -0
- package/src/entities/index.ts +61 -0
- package/src/entities/notification-user-history.entity.ts +51 -0
- package/src/entities/out-of-range.entity.ts +36 -0
- package/src/entities/permission-policy.entity.ts +25 -0
- package/src/entities/target.ts +54 -0
- package/src/index.ts +1 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseEntity,
|
|
3
|
+
Column,
|
|
4
|
+
CreateDateColumn,
|
|
5
|
+
Entity,
|
|
6
|
+
JoinColumn,
|
|
7
|
+
ManyToOne,
|
|
8
|
+
PrimaryGeneratedColumn,
|
|
9
|
+
UpdateDateColumn,
|
|
10
|
+
} from 'typeorm';
|
|
11
|
+
import { Users } from './Users';
|
|
12
|
+
|
|
13
|
+
@Entity('fcm')
|
|
14
|
+
export class FCM extends BaseEntity {
|
|
15
|
+
@PrimaryGeneratedColumn({ type: 'bigint', name: 'id' })
|
|
16
|
+
id!: string;
|
|
17
|
+
|
|
18
|
+
@Column('text', { name: 'name', nullable: true })
|
|
19
|
+
name?: string | null;
|
|
20
|
+
|
|
21
|
+
@CreateDateColumn({ type: 'datetime' })
|
|
22
|
+
created_at!: Date;
|
|
23
|
+
|
|
24
|
+
@UpdateDateColumn({ type: 'datetime' })
|
|
25
|
+
updated_at!: Date;
|
|
26
|
+
|
|
27
|
+
@ManyToOne(() => Users, (user) => user.fcm)
|
|
28
|
+
@JoinColumn({ name: 'user_id' })
|
|
29
|
+
user?: Users;
|
|
30
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export {AchievementHistory} from './AchievementHistory';
|
|
2
|
+
export {AlertMessages} from './AlertMessages';
|
|
3
|
+
export {Analysis} from './Analysis';
|
|
4
|
+
export {Answers} from './Answers';
|
|
5
|
+
export {Attachement} from './Attachments';
|
|
6
|
+
export {AttendanceDetails} from './AttendanceDetails';
|
|
7
|
+
export {BeatPlanCheckins} from './BeatPlanCheckIns';
|
|
8
|
+
export {BeatPlanVisits} from './BeatPlanVisits';
|
|
9
|
+
export {BranchManagerBrandsMappings} from './BranchManagerBrandsMappings';
|
|
10
|
+
export {BranchManagerMerchandiserMappings} from './BranchManagerMerchandiserMappings';
|
|
11
|
+
export {Brands} from './Brands';
|
|
12
|
+
export {BrandWiseCategory} from './BrandWiseCategory';
|
|
13
|
+
export {Catagory} from './Category';
|
|
14
|
+
export {DamagedProductsRequest} from './DamagedProductsRequests';
|
|
15
|
+
export {DamagedProductsRequestDetails} from './DamagedProductsRequestsDetails';
|
|
16
|
+
export {FCM} from './fcm.entity';
|
|
17
|
+
export {Inventory} from './Inventory';
|
|
18
|
+
export {InventoryDetails} from './InventoryDetails';
|
|
19
|
+
export {LeaveRequests} from './LeaveRequests';
|
|
20
|
+
export {LeaveTypes} from './LeaveTypes';
|
|
21
|
+
export {LoginHistory} from './LoginHistory';
|
|
22
|
+
export {NotificationUserHistory} from './notification-user-history.entity';
|
|
23
|
+
export {Notification} from './Notifications';
|
|
24
|
+
export {Offers} from './Offer';
|
|
25
|
+
export {OfferLaunch} from './OfferLaunch';
|
|
26
|
+
export {OutOfRange} from './out-of-range.entity';
|
|
27
|
+
export {PasswordManager} from './PasswordManager';
|
|
28
|
+
export {POSMMaterials} from './POSMMaterials';
|
|
29
|
+
export {POSMRequest} from './POSMRequest';
|
|
30
|
+
export {POSMRequestDetails} from './POSMRequestDetails';
|
|
31
|
+
export {Product} from './Products';
|
|
32
|
+
export {Questions} from './Question';
|
|
33
|
+
export {Roles} from './Roles';
|
|
34
|
+
export {SalesPunching} from './SalesPunch';
|
|
35
|
+
export {SalesPunchingAiAnalysis} from './SalesPunchingAIAnalysis';
|
|
36
|
+
export {Schemes} from './Schemes';
|
|
37
|
+
export {Shifts} from './Shifts';
|
|
38
|
+
export {StoreShifts} from './StoreShifts'
|
|
39
|
+
export {StockRequest} from './StockRequest';
|
|
40
|
+
export {StockRequestDetails} from './StockRequestDetails';
|
|
41
|
+
export {StoreBrandsMappings} from './StoreBrandsMapping';
|
|
42
|
+
export {Stores} from './Stores';
|
|
43
|
+
export {Target} from './target';
|
|
44
|
+
export {Task} from './Task';
|
|
45
|
+
export {TaskAttachment} from './TaskAttachment';
|
|
46
|
+
export {TermsAndCondition} from './TermsAndCondition';
|
|
47
|
+
export {UploadedImages} from './UplaodedImages';
|
|
48
|
+
export {UserDetails} from './UserDetails';
|
|
49
|
+
export {UsersQuestionsAttemptsHistory} from './UserQuestionAttemptHistory';
|
|
50
|
+
export {UserRosters} from './UserRoster';
|
|
51
|
+
export {UsersRosterChangeLogs} from './UserRosterChanges';
|
|
52
|
+
export {UserStoreChangeHistory} from './UserStoreChangedHistory';
|
|
53
|
+
export {UsersVideosAttemptsHistory} from './UserVideosAttemptsHistory';
|
|
54
|
+
export {Version} from './Versions';
|
|
55
|
+
export {Videos} from './Videos';
|
|
56
|
+
export {Users} from './Users';
|
|
57
|
+
export {Automations} from './automations.entity';
|
|
58
|
+
export {AutomationExecutions} from './automation_executions.entity';
|
|
59
|
+
export {APIResponse} from './ApiResponses';
|
|
60
|
+
export {UserLocations} from './UserLocations';
|
|
61
|
+
export {PermissionPolicy} from './permission-policy.entity'
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
CreateDateColumn,
|
|
6
|
+
UpdateDateColumn,
|
|
7
|
+
BaseEntity,
|
|
8
|
+
ManyToOne,
|
|
9
|
+
JoinColumn,
|
|
10
|
+
} from 'typeorm';
|
|
11
|
+
import { Users } from './Users';
|
|
12
|
+
import { Notification } from './Notifications';
|
|
13
|
+
// import { Roles } from './Roles';
|
|
14
|
+
|
|
15
|
+
@Entity({ name: 'notifications_user_history' })
|
|
16
|
+
export class NotificationUserHistory extends BaseEntity {
|
|
17
|
+
@PrimaryGeneratedColumn('increment', { type: 'bigint' })
|
|
18
|
+
id!: bigint;
|
|
19
|
+
|
|
20
|
+
@ManyToOne(() => Users, (user) => user.id)
|
|
21
|
+
@JoinColumn({ name: 'user_id' })
|
|
22
|
+
user!: Users;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'varchar' })
|
|
25
|
+
image!: string;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'varchar', nullable: true })
|
|
28
|
+
brand_image!: string;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'varchar' })
|
|
31
|
+
title!: string;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'varchar' })
|
|
34
|
+
content!: string;
|
|
35
|
+
|
|
36
|
+
@Column({ type: 'tinyint', default: 0 })
|
|
37
|
+
read_status?: number;
|
|
38
|
+
|
|
39
|
+
@Column({ type: 'tinyint', default: 1 })
|
|
40
|
+
status?: number;
|
|
41
|
+
|
|
42
|
+
@ManyToOne(() => Notification, (notification) => notification.notification_user_history)
|
|
43
|
+
@JoinColumn({ name: 'notification_id' })
|
|
44
|
+
notificationHistory?: Notification;
|
|
45
|
+
|
|
46
|
+
@CreateDateColumn({ type: 'datetime' })
|
|
47
|
+
created_at!: Date;
|
|
48
|
+
|
|
49
|
+
@UpdateDateColumn({ type: 'datetime' })
|
|
50
|
+
updated_at!: Date;
|
|
51
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseEntity,
|
|
3
|
+
Column,
|
|
4
|
+
CreateDateColumn,
|
|
5
|
+
Entity,
|
|
6
|
+
JoinColumn,
|
|
7
|
+
ManyToOne,
|
|
8
|
+
PrimaryGeneratedColumn,
|
|
9
|
+
UpdateDateColumn,
|
|
10
|
+
} from 'typeorm';
|
|
11
|
+
import { Users } from './Users';
|
|
12
|
+
|
|
13
|
+
@Entity('out_of_range')
|
|
14
|
+
export class OutOfRange extends BaseEntity {
|
|
15
|
+
@PrimaryGeneratedColumn({ type: 'bigint', name: 'id' })
|
|
16
|
+
id!: string;
|
|
17
|
+
|
|
18
|
+
@Column('text', { name: 'lat', nullable: true })
|
|
19
|
+
lat?: string | null;
|
|
20
|
+
|
|
21
|
+
@Column('text', { name: 'long', nullable: true })
|
|
22
|
+
long?: string | null;
|
|
23
|
+
|
|
24
|
+
@Column('text', { name: 'radius', nullable: true })
|
|
25
|
+
radius?: string | null;
|
|
26
|
+
|
|
27
|
+
@CreateDateColumn({ type: 'datetime' })
|
|
28
|
+
created_at!: Date;
|
|
29
|
+
|
|
30
|
+
@UpdateDateColumn({ type: 'datetime' })
|
|
31
|
+
updated_at!: Date;
|
|
32
|
+
|
|
33
|
+
@ManyToOne(() => Users, (user) => user.outOfRange)
|
|
34
|
+
@JoinColumn({ name: 'user_id' })
|
|
35
|
+
user?: Users;
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
Index,
|
|
6
|
+
} from 'typeorm';
|
|
7
|
+
|
|
8
|
+
@Entity('permission_policy')
|
|
9
|
+
@Index(['role_id', 'module_id', 'permission_code'], { unique: true })
|
|
10
|
+
export class PermissionPolicy {
|
|
11
|
+
@PrimaryGeneratedColumn()
|
|
12
|
+
id: number;
|
|
13
|
+
|
|
14
|
+
@Column()
|
|
15
|
+
role_id: number;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'uuid' })
|
|
18
|
+
module_id: string;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'varchar', length: 100 })
|
|
21
|
+
permission_code: string;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'boolean', default: true })
|
|
24
|
+
is_active: boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BaseEntity,
|
|
3
|
+
Column,
|
|
4
|
+
CreateDateColumn,
|
|
5
|
+
Entity,
|
|
6
|
+
JoinColumn,
|
|
7
|
+
ManyToOne,
|
|
8
|
+
OneToMany,
|
|
9
|
+
PrimaryGeneratedColumn,
|
|
10
|
+
UpdateDateColumn,
|
|
11
|
+
} from 'typeorm';
|
|
12
|
+
import { Users } from './Users';
|
|
13
|
+
import { Months } from './Enum/Months';
|
|
14
|
+
import { Product } from './Products';
|
|
15
|
+
import { AchievementHistory } from './AchievementHistory';
|
|
16
|
+
|
|
17
|
+
@Entity('targets')
|
|
18
|
+
export class Target extends BaseEntity {
|
|
19
|
+
@PrimaryGeneratedColumn({ type: 'bigint', name: 'id' })
|
|
20
|
+
id!: string; // Use `string` if your application handles bigint as strings
|
|
21
|
+
|
|
22
|
+
@Column({
|
|
23
|
+
type: 'enum',
|
|
24
|
+
enum: Months,
|
|
25
|
+
nullable: false, // Make it non-nullable if required
|
|
26
|
+
})
|
|
27
|
+
month!: Months;
|
|
28
|
+
|
|
29
|
+
@Column({ type: 'int', nullable: false }) // Use `int` for year
|
|
30
|
+
year!: number;
|
|
31
|
+
|
|
32
|
+
@Column({ type: 'int', nullable: false, default: 0 }) // Use `int` for target
|
|
33
|
+
target!: number;
|
|
34
|
+
|
|
35
|
+
@Column({ type: 'varchar', nullable: true, default: '0' }) // Keep as `varchar` if achievement is a string
|
|
36
|
+
achievement!: string;
|
|
37
|
+
|
|
38
|
+
@CreateDateColumn({ type: 'datetime' })
|
|
39
|
+
created_at!: Date;
|
|
40
|
+
|
|
41
|
+
@UpdateDateColumn({ type: 'datetime' })
|
|
42
|
+
updated_at!: Date;
|
|
43
|
+
|
|
44
|
+
@ManyToOne(() => Product, (product) => product.targets)
|
|
45
|
+
@JoinColumn({ name: 'product_id' })
|
|
46
|
+
product!: Product;
|
|
47
|
+
|
|
48
|
+
@ManyToOne(() => Users, (user) => user.targets)
|
|
49
|
+
@JoinColumn({ name: 'user_id' })
|
|
50
|
+
users!: Users;
|
|
51
|
+
|
|
52
|
+
@OneToMany(() => AchievementHistory, (achievementHistory) => achievementHistory.target)
|
|
53
|
+
AchHistory!: AchievementHistory[];
|
|
54
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './entities';
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2019",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"outDir": "dist",
|
|
7
|
+
"emitDecoratorMetadata": true,
|
|
8
|
+
"experimentalDecorators": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"strictPropertyInitialization": false,
|
|
11
|
+
"types": ["node"]
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|