shared-dto 1.0.32 → 1.0.33

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,24 @@
1
+ export declare enum PaymentStatus {
2
+ WAITING = "WAITING",
3
+ COMPLETED = "COMPLETED",
4
+ CANCELLED = "CANCELLED",
5
+ ON_HOLD = "ON_HOLD"
6
+ }
7
+ export declare class CreatePaymentDTO {
8
+ title: string;
9
+ description: string;
10
+ status: PaymentStatus;
11
+ dueDate: Date;
12
+ apartmentId: string;
13
+ assignedUserIds: string[];
14
+ createdById: string;
15
+ prise: string;
16
+ imgsUrls?: string[];
17
+ assignedUsers?: string[];
18
+ }
19
+ export declare class UpdatedPaymentDTO extends CreatePaymentDTO {
20
+ id: string;
21
+ }
22
+ export declare class PaymentDTO extends UpdatedPaymentDTO {
23
+ }
24
+ //# sourceMappingURL=Payments.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Payments.dto.d.ts","sourceRoot":"","sources":["../src/Payments.dto.ts"],"names":[],"mappings":"AAGA,oBAAY,aAAa;IACrB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,OAAO,YAAY;CACpB;AAEH,qBAAa,gBAAgB;IAG3B,KAAK,EAAE,MAAM,CAAC;IAId,WAAW,EAAE,MAAM,CAAC;IAGpB,MAAM,EAAE,aAAa,CAAC;IAItB,OAAO,EAAE,IAAI,CAAC;IAId,WAAW,EAAE,MAAM,CAAC;IAIpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAI1B,WAAW,EAAE,MAAM,CAAC;IAIpB,KAAK,EAAE,MAAM,CAAC;IAId,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAIpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAED,qBAAa,iBAAkB,SAAQ,gBAAgB;IAIrD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,qBAAa,UAAW,SAAQ,iBAAiB;CAAG"}
@@ -0,0 +1,84 @@
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.PaymentDTO = exports.UpdatedPaymentDTO = exports.CreatePaymentDTO = exports.PaymentStatus = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ var PaymentStatus;
15
+ (function (PaymentStatus) {
16
+ PaymentStatus["WAITING"] = "WAITING";
17
+ PaymentStatus["COMPLETED"] = "COMPLETED";
18
+ PaymentStatus["CANCELLED"] = "CANCELLED";
19
+ PaymentStatus["ON_HOLD"] = "ON_HOLD";
20
+ })(PaymentStatus || (exports.PaymentStatus = PaymentStatus = {}));
21
+ class CreatePaymentDTO {
22
+ }
23
+ exports.CreatePaymentDTO = CreatePaymentDTO;
24
+ __decorate([
25
+ (0, class_validator_1.IsString)(),
26
+ (0, class_validator_1.IsNotEmpty)(),
27
+ __metadata("design:type", String)
28
+ ], CreatePaymentDTO.prototype, "title", void 0);
29
+ __decorate([
30
+ (0, class_validator_1.IsString)(),
31
+ (0, class_validator_1.IsNotEmpty)(),
32
+ __metadata("design:type", String)
33
+ ], CreatePaymentDTO.prototype, "description", void 0);
34
+ __decorate([
35
+ (0, class_validator_1.IsEnum)(PaymentStatus),
36
+ __metadata("design:type", String)
37
+ ], CreatePaymentDTO.prototype, "status", void 0);
38
+ __decorate([
39
+ (0, class_validator_1.IsOptional)(),
40
+ (0, class_validator_1.IsDate)(),
41
+ __metadata("design:type", Date)
42
+ ], CreatePaymentDTO.prototype, "dueDate", void 0);
43
+ __decorate([
44
+ (0, class_validator_1.IsString)(),
45
+ (0, class_validator_1.IsNotEmpty)(),
46
+ __metadata("design:type", String)
47
+ ], CreatePaymentDTO.prototype, "apartmentId", void 0);
48
+ __decorate([
49
+ (0, class_validator_1.IsArray)(),
50
+ (0, class_validator_1.IsString)({ each: true }),
51
+ __metadata("design:type", Array)
52
+ ], CreatePaymentDTO.prototype, "assignedUserIds", void 0);
53
+ __decorate([
54
+ (0, class_validator_1.IsString)(),
55
+ (0, class_validator_1.IsNotEmpty)(),
56
+ __metadata("design:type", String)
57
+ ], CreatePaymentDTO.prototype, "createdById", void 0);
58
+ __decorate([
59
+ (0, class_validator_1.IsNumber)(),
60
+ (0, class_validator_1.IsNotEmpty)(),
61
+ __metadata("design:type", String)
62
+ ], CreatePaymentDTO.prototype, "prise", void 0);
63
+ __decorate([
64
+ (0, class_validator_1.IsArray)(),
65
+ (0, class_validator_1.IsString)({ each: true }),
66
+ __metadata("design:type", Array)
67
+ ], CreatePaymentDTO.prototype, "imgsUrls", void 0);
68
+ __decorate([
69
+ (0, class_validator_1.IsArray)(),
70
+ (0, class_validator_1.IsString)({ each: true }),
71
+ __metadata("design:type", Array)
72
+ ], CreatePaymentDTO.prototype, "assignedUsers", void 0);
73
+ class UpdatedPaymentDTO extends CreatePaymentDTO {
74
+ }
75
+ exports.UpdatedPaymentDTO = UpdatedPaymentDTO;
76
+ __decorate([
77
+ (0, class_validator_1.IsString)(),
78
+ (0, class_validator_1.IsNotEmpty)(),
79
+ __metadata("design:type", String)
80
+ ], UpdatedPaymentDTO.prototype, "id", void 0);
81
+ class PaymentDTO extends UpdatedPaymentDTO {
82
+ }
83
+ exports.PaymentDTO = PaymentDTO;
84
+ //# sourceMappingURL=Payments.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Payments.dto.js","sourceRoot":"","sources":["../src/Payments.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qDAAsG;AAEtG,IAAY,aAKT;AALH,WAAY,aAAa;IACrB,oCAAmB,CAAA;IACnB,wCAAuB,CAAA;IACvB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;AACrB,CAAC,EALS,aAAa,6BAAb,aAAa,QAKtB;AAEH,MAAa,gBAAgB;CAuC5B;AAvCD,4CAuCC;AApCC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;+CACC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACO;AAGpB;IADC,IAAA,wBAAM,EAAC,aAAa,CAAC;;gDACA;AAItB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,GAAE;8BACA,IAAI;iDAAC;AAId;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACO;AAIpB;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;yDACC;AAI1B;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACO;AAIpB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;+CACC;AAId;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;kDACL;AAIpB;IAFC,IAAA,yBAAO,GAAE;IACT,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;uDACA;AAG3B,MAAa,iBAAkB,SAAQ,gBAAgB;CAKtD;AALD,8CAKC;AADC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;6CACF;AAGb,MAAa,UAAW,SAAQ,iBAAiB;CAAG;AAApD,gCAAoD"}
package/dist/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './UserDTO.dto';
2
2
  export * from './Apartment.dto';
3
3
  export * from './Task.dto';
4
4
  export * from './Duty.dto';
5
+ export * from './Payments.dto';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
package/dist/index.js CHANGED
@@ -18,4 +18,5 @@ __exportStar(require("./UserDTO.dto"), exports);
18
18
  __exportStar(require("./Apartment.dto"), exports);
19
19
  __exportStar(require("./Task.dto"), exports);
20
20
  __exportStar(require("./Duty.dto"), exports);
21
+ __exportStar(require("./Payments.dto"), exports);
21
22
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,kDAAgC;AAChC,6CAA2B;AAC3B,6CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,kDAAgC;AAChC,6CAA2B;AAC3B,6CAA0B;AAC1B,iDAA8B"}
package/package.json CHANGED
@@ -1,22 +1,22 @@
1
- {
2
- "name": "shared-dto",
3
- "version": "1.0.32",
4
- "main": "dist/index.js",
5
- "types": "dist/index.d.ts",
6
- "scripts": {
7
- "build": "tsc",
8
- "version-bump": "npm version patch",
9
- "publish-lib": "npm publish --access public",
10
- "update-frontend": "cd ../front_end && npm install shared-dto@latest",
11
- "update-backend": "cd ../back_end && npm install shared-dto@latest",
12
- "update-all": "npm run build && npm run version-bump && npm run publish-lib && npm run update-frontend && npm run update-backend"
13
- },
14
- "devDependencies": {
15
- "typescript": "^5.6.2"
16
- },
17
- "dependencies": {
18
- "class-transformer": "^0.5.1",
19
- "class-validator": "^0.14.1",
20
- "reflect-metadata": "^0.2.2"
21
- }
22
- }
1
+ {
2
+ "name": "shared-dto",
3
+ "version": "1.0.33",
4
+ "main": "dist/index.js",
5
+ "types": "dist/index.d.ts",
6
+ "scripts": {
7
+ "build": "tsc",
8
+ "version-bump": "npm version patch",
9
+ "publish-lib": "npm publish --access public",
10
+ "update-frontend": "cd ../front_end && npm install shared-dto@latest",
11
+ "update-backend": "cd ../back_end && npm install shared-dto@latest",
12
+ "update-all": "npm run build && npm run version-bump && npm run publish-lib && npm run update-frontend && npm run update-backend"
13
+ },
14
+ "devDependencies": {
15
+ "typescript": "^5.6.2"
16
+ },
17
+ "dependencies": {
18
+ "class-transformer": "^0.5.1",
19
+ "class-validator": "^0.14.1",
20
+ "reflect-metadata": "^0.2.2"
21
+ }
22
+ }
@@ -1,46 +1,46 @@
1
- import { DutyType } from "./Duty.dto";
2
-
3
- export class ApartmentDTO {
4
- id: string;
5
- name: string;
6
- city: string;
7
- street: string;
8
- number: string;
9
- selectedWashing: string;
10
- selectedBit: string;
11
- fromDate: string | undefined |null;
12
- toDate: string | undefined | null;
13
- partnersNumber: string;
14
- rent: string;
15
- apartmentDuties?: ApartmentDutyDTO[];
16
- }
17
-
18
- export class createApartmentDTO extends ApartmentDTO {
19
- createDutyDTO?: createDutyDTO[] ;
20
- }
21
- export class createDutyDTO {
22
- type: DutyType;
23
- days: WeekDay[];
24
- description?: string;
25
- }
26
- export class ApartmentDutyDTO {
27
- id: string;
28
- type: DutyType;
29
- days: WeekDay[];
30
- description?: string;
31
- assignedUsers: string[];
32
- apartmentId: string;
33
- createdAt?: Date;
34
- updatedAt?: Date;
35
- }
36
-
37
-
38
- export enum WeekDay {
39
- SUNDAY = 'SUNDAY',
40
- MONDAY = 'MONDAY',
41
- TUESDAY = 'TUESDAY',
42
- WEDNESDAY = 'WEDNESDAY',
43
- THURSDAY = 'THURSDAY',
44
- FRIDAY = 'FRIDAY',
45
- SATURDAY = 'SATURDAY'
46
- }
1
+ import { DutyType } from "./Duty.dto";
2
+
3
+ export class ApartmentDTO {
4
+ id: string;
5
+ name: string;
6
+ city: string;
7
+ street: string;
8
+ number: string;
9
+ selectedWashing: string;
10
+ selectedBit: string;
11
+ fromDate: string | undefined |null;
12
+ toDate: string | undefined | null;
13
+ partnersNumber: string;
14
+ rent: string;
15
+ apartmentDuties?: ApartmentDutyDTO[];
16
+ }
17
+
18
+ export class createApartmentDTO extends ApartmentDTO {
19
+ createDutyDTO?: createDutyDTO[] ;
20
+ }
21
+ export class createDutyDTO {
22
+ type: DutyType;
23
+ days: WeekDay[];
24
+ description?: string;
25
+ }
26
+ export class ApartmentDutyDTO {
27
+ id: string;
28
+ type: DutyType;
29
+ days: WeekDay[];
30
+ description?: string;
31
+ assignedUsers: string[];
32
+ apartmentId: string;
33
+ createdAt?: Date;
34
+ updatedAt?: Date;
35
+ }
36
+
37
+
38
+ export enum WeekDay {
39
+ SUNDAY = 'SUNDAY',
40
+ MONDAY = 'MONDAY',
41
+ TUESDAY = 'TUESDAY',
42
+ WEDNESDAY = 'WEDNESDAY',
43
+ THURSDAY = 'THURSDAY',
44
+ FRIDAY = 'FRIDAY',
45
+ SATURDAY = 'SATURDAY'
46
+ }
package/src/Duty.dto.ts CHANGED
@@ -1,75 +1,75 @@
1
- import { IsString ,IsNotEmpty ,IsEnum ,IsBoolean ,IsDate ,IsOptional} from "class-validator";
2
-
3
- export enum DutyType {
4
- CLEANING = 'CLEANING',
5
- DISHES = 'DISHES',
6
- SHOPPING = 'SHOPPING',
7
- DOG_WALKING = 'DOG_WALKING',
8
- OTHER = 'OTHER'
9
- }
10
-
11
- export class CreateDutyDto {
12
- @IsEnum(DutyType)
13
- @IsNotEmpty()
14
- type: DutyType;
15
-
16
- @IsOptional()
17
- @IsString()
18
- description?: string;
19
-
20
- @IsBoolean()
21
- @IsOptional()
22
- isDone?: boolean;
23
-
24
- @IsString()
25
- @IsNotEmpty()
26
- userUid: string;
27
-
28
- @IsString()
29
- @IsNotEmpty()
30
- apartmentId: string;
31
-
32
- @IsDate()
33
- @IsOptional()
34
- dutyDate?: Date;
35
- }
36
-
37
- export class UpdateDutyDto extends CreateDutyDto {
38
- @IsString()
39
- @IsNotEmpty()
40
- id: string;
41
- }
42
-
43
- export class DutyDTO {
44
- @IsString()
45
- @IsNotEmpty()
46
- id: string;
47
-
48
- @IsEnum(DutyType)
49
- @IsNotEmpty()
50
- type: DutyType;
51
-
52
- @IsOptional()
53
- @IsString()
54
- description?: string;
55
-
56
- @IsBoolean()
57
- isDone: boolean;
58
-
59
- @IsString()
60
- @IsNotEmpty()
61
- userId: string;
62
-
63
- @IsString()
64
- @IsNotEmpty()
65
- apartmentId: string;
66
-
67
- @IsDate()
68
- dutyDate: Date;
69
-
70
- @IsDate()
71
- createdAt: Date;
72
-
73
- @IsDate()
74
- updatedAt: Date;
1
+ import { IsString ,IsNotEmpty ,IsEnum ,IsBoolean ,IsDate ,IsOptional} from "class-validator";
2
+
3
+ export enum DutyType {
4
+ CLEANING = 'CLEANING',
5
+ DISHES = 'DISHES',
6
+ SHOPPING = 'SHOPPING',
7
+ DOG_WALKING = 'DOG_WALKING',
8
+ OTHER = 'OTHER'
9
+ }
10
+
11
+ export class CreateDutyDto {
12
+ @IsEnum(DutyType)
13
+ @IsNotEmpty()
14
+ type: DutyType;
15
+
16
+ @IsOptional()
17
+ @IsString()
18
+ description?: string;
19
+
20
+ @IsBoolean()
21
+ @IsOptional()
22
+ isDone?: boolean;
23
+
24
+ @IsString()
25
+ @IsNotEmpty()
26
+ userUid: string;
27
+
28
+ @IsString()
29
+ @IsNotEmpty()
30
+ apartmentId: string;
31
+
32
+ @IsDate()
33
+ @IsOptional()
34
+ dutyDate?: Date;
35
+ }
36
+
37
+ export class UpdateDutyDto extends CreateDutyDto {
38
+ @IsString()
39
+ @IsNotEmpty()
40
+ id: string;
41
+ }
42
+
43
+ export class DutyDTO {
44
+ @IsString()
45
+ @IsNotEmpty()
46
+ id: string;
47
+
48
+ @IsEnum(DutyType)
49
+ @IsNotEmpty()
50
+ type: DutyType;
51
+
52
+ @IsOptional()
53
+ @IsString()
54
+ description?: string;
55
+
56
+ @IsBoolean()
57
+ isDone: boolean;
58
+
59
+ @IsString()
60
+ @IsNotEmpty()
61
+ userId: string;
62
+
63
+ @IsString()
64
+ @IsNotEmpty()
65
+ apartmentId: string;
66
+
67
+ @IsDate()
68
+ dutyDate: Date;
69
+
70
+ @IsDate()
71
+ createdAt: Date;
72
+
73
+ @IsDate()
74
+ updatedAt: Date;
75
75
  }
@@ -0,0 +1,59 @@
1
+ // src/tasks/dto/create-task.dto.ts
2
+ import { IsString, IsNotEmpty, IsOptional, IsEnum, IsDate, IsArray, IsNumber } from 'class-validator';
3
+
4
+ export enum PaymentStatus {
5
+ WAITING = 'WAITING',
6
+ COMPLETED = 'COMPLETED',
7
+ CANCELLED = 'CANCELLED',
8
+ ON_HOLD = 'ON_HOLD'
9
+ }
10
+
11
+ export class CreatePaymentDTO {
12
+ @IsString()
13
+ @IsNotEmpty()
14
+ title: string;
15
+
16
+ @IsString()
17
+ @IsNotEmpty()
18
+ description: string;
19
+
20
+ @IsEnum(PaymentStatus)
21
+ status: PaymentStatus;
22
+
23
+ @IsOptional()
24
+ @IsDate()
25
+ dueDate: Date;
26
+
27
+ @IsString()
28
+ @IsNotEmpty()
29
+ apartmentId: string;
30
+
31
+ @IsArray()
32
+ @IsString({ each: true })
33
+ assignedUserIds: string[];
34
+
35
+ @IsString()
36
+ @IsNotEmpty()
37
+ createdById: string;
38
+
39
+ @IsNumber()
40
+ @IsNotEmpty()
41
+ prise: string;
42
+
43
+ @IsArray()
44
+ @IsString({ each: true })
45
+ imgsUrls?: string[];
46
+
47
+ @IsArray()
48
+ @IsString({ each: true })
49
+ assignedUsers?: string[];
50
+ }
51
+
52
+ export class UpdatedPaymentDTO extends CreatePaymentDTO {
53
+
54
+ @IsString()
55
+ @IsNotEmpty()
56
+ id: string;
57
+ }
58
+
59
+ export class PaymentDTO extends UpdatedPaymentDTO {}
package/src/Task.dto.ts CHANGED
@@ -1,112 +1,112 @@
1
- // src/tasks/dto/create-task.dto.ts
2
- import { IsString, IsNotEmpty, IsOptional, IsEnum, IsDate, IsArray } from 'class-validator';
3
-
4
- export enum TaskStatus {
5
- PENDING = 'PENDING',
6
- IN_PROGRESS = 'IN_PROGRESS',
7
- COMPLETED = 'COMPLETED',
8
- CANCELLED = 'CANCELLED',
9
- ON_HOLD = 'ON_HOLD'
10
- }
11
-
12
- export enum Priority {
13
- LOW = 'LOW',
14
- MEDIUM = 'MEDIUM',
15
- HIGH = 'HIGH',
16
- URGENT = 'URGENT'
17
- }
18
-
19
- export class CreateTaskDto {
20
- @IsString()
21
- @IsNotEmpty()
22
- title: string;
23
-
24
- @IsString()
25
- @IsNotEmpty()
26
- description: string;
27
-
28
- @IsEnum(TaskStatus)
29
- status: TaskStatus;
30
-
31
- @IsOptional()
32
- @IsDate()
33
- dueDate?: Date;
34
-
35
- @IsOptional()
36
- @IsEnum(Priority)
37
- priority?: Priority;
38
-
39
- @IsString()
40
- @IsNotEmpty()
41
- apartmentId: string;
42
-
43
- @IsArray()
44
- @IsString({ each: true })
45
- assignedUserIds: string[];
46
-
47
- @IsString()
48
- @IsNotEmpty()
49
- createdById: string;
50
-
51
- @IsOptional()
52
- @IsArray()
53
- @IsString({ each: true })
54
- attachments?: string[];
55
- }
56
-
57
- export class updatedTaskDTO extends CreateTaskDto {
58
-
59
- @IsString()
60
- @IsNotEmpty()
61
- id: string;
62
- }
63
-
64
-
65
- export class TaskDTO {
66
- @IsString()
67
- @IsNotEmpty()
68
- id: string;
69
-
70
- @IsString()
71
- @IsNotEmpty()
72
- title: string;
73
-
74
- @IsString()
75
- @IsNotEmpty()
76
- description: string;
77
-
78
- @IsEnum(TaskStatus)
79
- @IsNotEmpty()
80
- status: TaskStatus;
81
-
82
- @IsDate()
83
- createdAt: Date;
84
-
85
- @IsDate()
86
- updatedAt: Date;
87
-
88
- @IsOptional()
89
- @IsDate()
90
- dueDate?: Date;
91
-
92
- @IsOptional()
93
- @IsEnum(Priority)
94
- priority?: Priority;
95
-
96
- @IsString()
97
- @IsNotEmpty()
98
- apartmentId: string;
99
-
100
- @IsArray()
101
- @IsString({ each: true })
102
- assignedUserIds: string[];
103
-
104
- @IsString()
105
- @IsNotEmpty()
106
- createdById: string;
107
-
108
- @IsOptional()
109
- @IsArray()
110
- @IsString({ each: true })
111
- attachments?: string[];
1
+ // src/tasks/dto/create-task.dto.ts
2
+ import { IsString, IsNotEmpty, IsOptional, IsEnum, IsDate, IsArray } from 'class-validator';
3
+
4
+ export enum TaskStatus {
5
+ PENDING = 'PENDING',
6
+ IN_PROGRESS = 'IN_PROGRESS',
7
+ COMPLETED = 'COMPLETED',
8
+ CANCELLED = 'CANCELLED',
9
+ ON_HOLD = 'ON_HOLD'
10
+ }
11
+
12
+ export enum Priority {
13
+ LOW = 'LOW',
14
+ MEDIUM = 'MEDIUM',
15
+ HIGH = 'HIGH',
16
+ URGENT = 'URGENT'
17
+ }
18
+
19
+ export class CreateTaskDto {
20
+ @IsString()
21
+ @IsNotEmpty()
22
+ title: string;
23
+
24
+ @IsString()
25
+ @IsNotEmpty()
26
+ description: string;
27
+
28
+ @IsEnum(TaskStatus)
29
+ status: TaskStatus;
30
+
31
+ @IsOptional()
32
+ @IsDate()
33
+ dueDate?: Date;
34
+
35
+ @IsOptional()
36
+ @IsEnum(Priority)
37
+ priority?: Priority;
38
+
39
+ @IsString()
40
+ @IsNotEmpty()
41
+ apartmentId: string;
42
+
43
+ @IsArray()
44
+ @IsString({ each: true })
45
+ assignedUserIds: string[];
46
+
47
+ @IsString()
48
+ @IsNotEmpty()
49
+ createdById: string;
50
+
51
+ @IsOptional()
52
+ @IsArray()
53
+ @IsString({ each: true })
54
+ attachments?: string[];
55
+ }
56
+
57
+ export class updatedTaskDTO extends CreateTaskDto {
58
+
59
+ @IsString()
60
+ @IsNotEmpty()
61
+ id: string;
62
+ }
63
+
64
+
65
+ export class TaskDTO {
66
+ @IsString()
67
+ @IsNotEmpty()
68
+ id: string;
69
+
70
+ @IsString()
71
+ @IsNotEmpty()
72
+ title: string;
73
+
74
+ @IsString()
75
+ @IsNotEmpty()
76
+ description: string;
77
+
78
+ @IsEnum(TaskStatus)
79
+ @IsNotEmpty()
80
+ status: TaskStatus;
81
+
82
+ @IsDate()
83
+ createdAt: Date;
84
+
85
+ @IsDate()
86
+ updatedAt: Date;
87
+
88
+ @IsOptional()
89
+ @IsDate()
90
+ dueDate?: Date;
91
+
92
+ @IsOptional()
93
+ @IsEnum(Priority)
94
+ priority?: Priority;
95
+
96
+ @IsString()
97
+ @IsNotEmpty()
98
+ apartmentId: string;
99
+
100
+ @IsArray()
101
+ @IsString({ each: true })
102
+ assignedUserIds: string[];
103
+
104
+ @IsString()
105
+ @IsNotEmpty()
106
+ createdById: string;
107
+
108
+ @IsOptional()
109
+ @IsArray()
110
+ @IsString({ each: true })
111
+ attachments?: string[];
112
112
  }
@@ -1,34 +1,34 @@
1
- import { IsNotEmpty, IsString } from "class-validator";
2
-
3
-
4
- export class UserDTO {
5
- uid:string;
6
- email: string | null | undefined;
7
- name: string | null | undefined;
8
- phone: string | null | undefined;
9
- profileURL: string | null | undefined;
10
- userType: string | null | undefined;
11
- }
12
-
13
- export class BaseUserDto {
14
- @IsString()
15
- @IsNotEmpty()
16
- uid: string;
17
-
18
- @IsString()
19
- @IsNotEmpty()
20
- name: string;
21
-
22
- @IsString()
23
- @IsNotEmpty()
24
- aprtmontID: string;
25
-
26
- @IsString()
27
- @IsNotEmpty()
28
- profileURL: string;
29
-
30
- @IsString()
31
- @IsNotEmpty()
32
- userType:string;
33
- }
1
+ import { IsNotEmpty, IsString } from "class-validator";
2
+
3
+
4
+ export class UserDTO {
5
+ uid:string;
6
+ email: string | null | undefined;
7
+ name: string | null | undefined;
8
+ phone: string | null | undefined;
9
+ profileURL: string | null | undefined;
10
+ userType: string | null | undefined;
11
+ }
12
+
13
+ export class BaseUserDto {
14
+ @IsString()
15
+ @IsNotEmpty()
16
+ uid: string;
17
+
18
+ @IsString()
19
+ @IsNotEmpty()
20
+ name: string;
21
+
22
+ @IsString()
23
+ @IsNotEmpty()
24
+ aprtmontID: string;
25
+
26
+ @IsString()
27
+ @IsNotEmpty()
28
+ profileURL: string;
29
+
30
+ @IsString()
31
+ @IsNotEmpty()
32
+ userType:string;
33
+ }
34
34
 
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
- export * from './UserDTO.dto';
2
- export * from './Apartment.dto';
3
- export * from './Task.dto';
4
- export * from './Duty.dto'
1
+ export * from './UserDTO.dto';
2
+ export * from './Apartment.dto';
3
+ export * from './Task.dto';
4
+ export * from './Duty.dto'
5
+ export * from './Payments.dto'
package/tsconfig.json CHANGED
@@ -1,37 +1,37 @@
1
- {
2
- "compilerOptions": {
3
- "moduleResolution": "node",
4
-
5
- "strictPropertyInitialization": false,
6
- /* Language and Environment */
7
- "target": "es2016",
8
- "experimentalDecorators": true,
9
- "emitDecoratorMetadata": true,
10
- "module": "commonjs",
11
- "esModuleInterop": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "strict": true,
14
- "skipLibCheck": true,
15
-
16
- /* Emit */
17
- "declaration": true,
18
- "declarationMap": true,
19
- "outDir": "./dist",
20
- "removeComments": true,
21
- "sourceMap": true,
22
- "baseUrl": ".",
23
- "paths": {
24
- "shared-dto": ["node_modules/shared-dto/dist/index"]
25
-
26
- // "shared-dto": ["dist/index"],
27
- // "shared-dto/*": ["dist/*"]
28
- }
29
- },
30
- "include": [
31
- "src/**/*.ts"
32
- ],
33
- "exclude": [
34
- "node_modules",
35
- "dist"
36
- ]
37
- }
1
+ {
2
+ "compilerOptions": {
3
+ "moduleResolution": "node",
4
+
5
+ "strictPropertyInitialization": false,
6
+ /* Language and Environment */
7
+ "target": "es2016",
8
+ "experimentalDecorators": true,
9
+ "emitDecoratorMetadata": true,
10
+ "module": "commonjs",
11
+ "esModuleInterop": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "strict": true,
14
+ "skipLibCheck": true,
15
+
16
+ /* Emit */
17
+ "declaration": true,
18
+ "declarationMap": true,
19
+ "outDir": "./dist",
20
+ "removeComments": true,
21
+ "sourceMap": true,
22
+ "baseUrl": ".",
23
+ "paths": {
24
+ "shared-dto": ["node_modules/shared-dto/dist/index"]
25
+
26
+ // "shared-dto": ["dist/index"],
27
+ // "shared-dto/*": ["dist/*"]
28
+ }
29
+ },
30
+ "include": [
31
+ "src/**/*.ts"
32
+ ],
33
+ "exclude": [
34
+ "node_modules",
35
+ "dist"
36
+ ]
37
+ }