@ashutoshvohra136/tenant-db-contract 1.0.10 → 1.0.11

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.
@@ -0,0 +1,12 @@
1
+ export declare class DownloadJobsEntity {
2
+ id: string;
3
+ tenantId: string;
4
+ type: string;
5
+ status: string;
6
+ fileUrl: string;
7
+ requestedBy: string;
8
+ filters: any;
9
+ error: string;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ }
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.DownloadJobsEntity = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ let DownloadJobsEntity = class DownloadJobsEntity {
15
+ };
16
+ exports.DownloadJobsEntity = DownloadJobsEntity;
17
+ __decorate([
18
+ (0, typeorm_1.PrimaryColumn)(),
19
+ __metadata("design:type", String)
20
+ ], DownloadJobsEntity.prototype, "id", void 0);
21
+ __decorate([
22
+ (0, typeorm_1.Column)({ name: 'tenant_id' }),
23
+ __metadata("design:type", String)
24
+ ], DownloadJobsEntity.prototype, "tenantId", void 0);
25
+ __decorate([
26
+ (0, typeorm_1.Column)(),
27
+ __metadata("design:type", String)
28
+ ], DownloadJobsEntity.prototype, "type", void 0);
29
+ __decorate([
30
+ (0, typeorm_1.Column)({
31
+ type: 'enum',
32
+ enum: ['PENDING', 'PROCESSING', 'COMPLETED', 'FAILED'],
33
+ default: 'PENDING',
34
+ }),
35
+ __metadata("design:type", String)
36
+ ], DownloadJobsEntity.prototype, "status", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.Column)({ name: 'file_url', nullable: true }),
39
+ __metadata("design:type", String)
40
+ ], DownloadJobsEntity.prototype, "fileUrl", void 0);
41
+ __decorate([
42
+ (0, typeorm_1.Column)({ name: 'requested_by', nullable: true }),
43
+ __metadata("design:type", String)
44
+ ], DownloadJobsEntity.prototype, "requestedBy", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.Column)({ type: 'json', nullable: true }),
47
+ __metadata("design:type", Object)
48
+ ], DownloadJobsEntity.prototype, "filters", void 0);
49
+ __decorate([
50
+ (0, typeorm_1.Column)({ nullable: true }),
51
+ __metadata("design:type", String)
52
+ ], DownloadJobsEntity.prototype, "error", void 0);
53
+ __decorate([
54
+ (0, typeorm_1.CreateDateColumn)({ name: 'created_at' }),
55
+ __metadata("design:type", Date)
56
+ ], DownloadJobsEntity.prototype, "createdAt", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.UpdateDateColumn)({ name: 'updated_at' }),
59
+ __metadata("design:type", Date)
60
+ ], DownloadJobsEntity.prototype, "updatedAt", void 0);
61
+ exports.DownloadJobsEntity = DownloadJobsEntity = __decorate([
62
+ (0, typeorm_1.Entity)('download_jobs')
63
+ ], DownloadJobsEntity);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ashutoshvohra136/tenant-db-contract",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -0,0 +1,38 @@
1
+ import { Entity, PrimaryColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';
2
+
3
+ @Entity('download_jobs')
4
+ export class DownloadJobsEntity {
5
+ @PrimaryColumn()
6
+ id: string; // jobId from BullMQ
7
+
8
+ @Column({ name: 'tenant_id' })
9
+ tenantId: string;
10
+
11
+ @Column()
12
+ type: string; // INVENTORY, ATTENDANCE, etc.
13
+
14
+ @Column({
15
+ type: 'enum',
16
+ enum: ['PENDING', 'PROCESSING', 'COMPLETED', 'FAILED'],
17
+ default: 'PENDING',
18
+ })
19
+ status: string;
20
+
21
+ @Column({ name: 'file_url', nullable: true })
22
+ fileUrl: string;
23
+
24
+ @Column({ name: 'requested_by', nullable: true })
25
+ requestedBy: string;
26
+
27
+ @Column({ type: 'json', nullable: true })
28
+ filters: any;
29
+
30
+ @Column({ nullable: true })
31
+ error: string;
32
+
33
+ @CreateDateColumn({ name: 'created_at' })
34
+ createdAt: Date;
35
+
36
+ @UpdateDateColumn({ name: 'updated_at' })
37
+ updatedAt: Date;
38
+ }