@fiado/type-kit 1.0.28 → 1.0.29

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.
@@ -3,7 +3,9 @@ export declare class GroupCreateRequest {
3
3
  id: string;
4
4
  name: string;
5
5
  description: string;
6
- leader: string;
6
+ leader?: string | null;
7
7
  status: GroupStatus;
8
8
  codeToRefer: string | null;
9
+ leaderNames?: string | null;
10
+ phoneNumber?: string | null;
9
11
  }
@@ -11,8 +11,8 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.GroupCreateRequest = void 0;
13
13
  const class_validator_1 = require("class-validator");
14
- const GroupStatus_1 = require("../enums/GroupStatus");
15
14
  const class_transformer_1 = require("class-transformer");
15
+ const GroupStatus_1 = require("../enums/GroupStatus");
16
16
  class GroupCreateRequest {
17
17
  }
18
18
  exports.GroupCreateRequest = GroupCreateRequest;
@@ -35,8 +35,9 @@ __decorate([
35
35
  __metadata("design:type", String)
36
36
  ], GroupCreateRequest.prototype, "description", void 0);
37
37
  __decorate([
38
- (0, class_validator_1.IsNotEmpty)(),
38
+ (0, class_validator_1.IsOptional)(),
39
39
  (0, class_validator_1.IsEmail)(),
40
+ (0, class_transformer_1.Transform)(({ value }) => value ?? null),
40
41
  __metadata("design:type", String)
41
42
  ], GroupCreateRequest.prototype, "leader", void 0);
42
43
  __decorate([
@@ -49,3 +50,17 @@ __decorate([
49
50
  (0, class_transformer_1.Transform)(({ value }) => value ?? null),
50
51
  __metadata("design:type", String)
51
52
  ], GroupCreateRequest.prototype, "codeToRefer", void 0);
53
+ __decorate([
54
+ (0, class_validator_1.IsOptional)(),
55
+ (0, class_validator_1.IsString)(),
56
+ (0, class_validator_1.Length)(1, 100),
57
+ (0, class_transformer_1.Transform)(({ value }) => value ?? null),
58
+ __metadata("design:type", String)
59
+ ], GroupCreateRequest.prototype, "leaderNames", void 0);
60
+ __decorate([
61
+ (0, class_validator_1.IsOptional)(),
62
+ (0, class_validator_1.IsString)(),
63
+ (0, class_validator_1.Length)(10, 15),
64
+ (0, class_transformer_1.Transform)(({ value }) => value ?? null),
65
+ __metadata("design:type", String)
66
+ ], GroupCreateRequest.prototype, "phoneNumber", void 0);
@@ -4,6 +4,8 @@ export declare class GroupResponse {
4
4
  name: string;
5
5
  description: string;
6
6
  status: GroupStatus;
7
- leadger: string;
8
- codesToRefer: string[];
7
+ leadger: string | null;
8
+ leaderNames: string | null;
9
+ phoneNumber: string | null;
10
+ codesToRefer: string;
9
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fiado/type-kit",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "",
5
5
  "main": "bin/index.js",
6
6
  "types": "bin/index.d.ts",
@@ -1,11 +1,8 @@
1
1
  import { IsEmail, IsEnum, IsNotEmpty, IsOptional, IsString, Length } from "class-validator";
2
- import { GroupStatus } from "../enums/GroupStatus";
3
2
  import { Transform } from "class-transformer";
4
-
5
-
3
+ import { GroupStatus } from "../enums/GroupStatus";
6
4
 
7
5
  export class GroupCreateRequest {
8
-
9
6
  @IsNotEmpty()
10
7
  @IsString()
11
8
  @Length(3, 50)
@@ -21,15 +18,28 @@ export class GroupCreateRequest {
21
18
  @Length(1, 200)
22
19
  description: string;
23
20
 
24
- @IsNotEmpty()
21
+ @IsOptional()
25
22
  @IsEmail()
26
- leader: string
23
+ @Transform(({ value }) => value ?? null)
24
+ leader?: string | null;
27
25
 
28
26
  @IsEnum(GroupStatus)
29
- status: GroupStatus
27
+ status: GroupStatus;
30
28
 
31
29
  @IsOptional()
32
30
  @Length(3, 20)
33
31
  @Transform(({ value }) => value ?? null)
34
32
  codeToRefer: string | null;
35
- }
33
+
34
+ @IsOptional()
35
+ @IsString()
36
+ @Length(1, 100)
37
+ @Transform(({ value }) => value ?? null)
38
+ leaderNames?: string | null;
39
+
40
+ @IsOptional()
41
+ @IsString()
42
+ @Length(10, 15)
43
+ @Transform(({ value }) => value ?? null)
44
+ phoneNumber?: string | null;
45
+ }
@@ -7,9 +7,10 @@ export class GroupResponse {
7
7
  name: string
8
8
  description: string
9
9
  status: GroupStatus
10
- leadger: string
11
- codesToRefer: string[]
12
-
10
+ leadger: string | null
11
+ leaderNames: string | null
12
+ phoneNumber: string | null
13
+ codesToRefer: string
13
14
  }
14
15
 
15
16