@natrave/shared-entities 1.16.0 → 1.18.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.
@@ -16,6 +16,7 @@ export declare class OrganizationUser implements IOrganizationUser {
16
16
  emailVerifiedAt: Date | null;
17
17
  createdAt: Date;
18
18
  updatedAt: Date;
19
+ deletedAt: Date | null;
19
20
  organization: Organization;
20
21
  tournamentPayments: TournamentPayment[];
21
22
  billingInfo: OrganizationUserBillingInfo;
@@ -1 +1 @@
1
- {"version":3,"file":"organization-user.entity.d.ts","sourceRoot":"","sources":["../../../src/central-auth/organization-users/organization-user.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAexF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEhD,qBAWa,gBAAiB,YAAW,iBAAiB;IAExD,EAAE,EAAE,MAAM,CAAC;IAOX,cAAc,EAAE,MAAM,CAAC;IAQvB,SAAS,EAAE,MAAM,CAAC;IAQlB,QAAQ,EAAE,MAAM,CAAC;IAQjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAOxB,KAAK,EAAE,MAAM,CAAC;IAOd,KAAK,EAAE,MAAM,CAAC;IAQd,MAAM,EAAE,sBAAsB,CAAC;IAU/B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ1B,eAAe,EAAE,OAAO,CAAC;IAQzB,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAO7B,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAShB,YAAY,EAAE,YAAY,CAAC;IAM3B,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IAMxC,WAAW,EAAE,2BAA2B,CAAC;CAC1C"}
1
+ {"version":3,"file":"organization-user.entity.d.ts","sourceRoot":"","sources":["../../../src/central-auth/organization-users/organization-user.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAexF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAKhD,qBAiBa,gBAAiB,YAAW,iBAAiB;IAExD,EAAE,EAAE,MAAM,CAAC;IAOX,cAAc,EAAE,MAAM,CAAC;IAQvB,SAAS,EAAE,MAAM,CAAC;IAQlB,QAAQ,EAAE,MAAM,CAAC;IAQjB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAOxB,KAAK,EAAE,MAAM,CAAC;IAOd,KAAK,EAAE,MAAM,CAAC;IAQd,MAAM,EAAE,sBAAsB,CAAC;IAU/B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ1B,eAAe,EAAE,OAAO,CAAC;IAQzB,eAAe,EAAE,IAAI,GAAG,IAAI,CAAC;IAO7B,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IASvB,YAAY,EAAE,YAAY,CAAC;IAM3B,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;IAMxC,WAAW,EAAE,2BAA2B,CAAC;CAC1C"}
@@ -12,6 +12,7 @@ import { OrganizationUserStatus } from "@natrave/auth-service-types";
12
12
  import {
13
13
  Column,
14
14
  CreateDateColumn,
15
+ DeleteDateColumn,
15
16
  Entity,
16
17
  Index,
17
18
  JoinColumn,
@@ -19,7 +20,6 @@ import {
19
20
  OneToMany,
20
21
  OneToOne,
21
22
  PrimaryGeneratedColumn,
22
- Unique,
23
23
  UpdateDateColumn
24
24
  } from "typeorm";
25
25
  import { TournamentPayment } from "../../tournaments/index.js";
@@ -121,6 +121,14 @@ __decorateClass([
121
121
  comment: "Data da \xFAltima atualiza\xE7\xE3o do registro."
122
122
  })
123
123
  ], OrganizationUser.prototype, "updatedAt", 2);
124
+ __decorateClass([
125
+ DeleteDateColumn({
126
+ name: "deleted_at",
127
+ type: "timestamptz",
128
+ nullable: true,
129
+ comment: "Data de exclus\xE3o l\xF3gica (soft delete) do registro; nulo quando ativo."
130
+ })
131
+ ], OrganizationUser.prototype, "deletedAt", 2);
124
132
  __decorateClass([
125
133
  ManyToOne(() => Organization, (organization) => organization.users, { onDelete: "CASCADE" }),
126
134
  JoinColumn({ name: "organization_id" })
@@ -132,10 +140,16 @@ __decorateClass([
132
140
  OneToOne(() => OrganizationUserBillingInfo, (billingInfo) => billingInfo.organizationUser)
133
141
  ], OrganizationUser.prototype, "billingInfo", 2);
134
142
  OrganizationUser = __decorateClass([
135
- Unique("UQ_organization_users_document", ["document"]),
136
- Unique("UQ_organization_users_email", ["email"]),
137
- Unique("UQ_organization_users_phone", ["phone"]),
138
- Unique("UQ_organization_users_externalId", ["externalId"]),
143
+ Index("UQ_organization_users_document", ["document"], {
144
+ unique: true,
145
+ where: '"deleted_at" IS NULL'
146
+ }),
147
+ Index("UQ_organization_users_email", ["email"], { unique: true, where: '"deleted_at" IS NULL' }),
148
+ Index("UQ_organization_users_phone", ["phone"], { unique: true, where: '"deleted_at" IS NULL' }),
149
+ Index("UQ_organization_users_externalId", ["externalId"], {
150
+ unique: true,
151
+ where: '"deleted_at" IS NULL'
152
+ }),
139
153
  Index("idx_organization_user_document", ["document"]),
140
154
  Index("idx_organization_user_email", ["email"]),
141
155
  Index("idx_organization_user_phone", ["phone"]),
@@ -14,6 +14,7 @@ export declare class Organization implements IOrganization {
14
14
  isActualOrganization: boolean;
15
15
  createdAt: Date;
16
16
  updatedAt: Date;
17
+ deletedAt: Date | null;
17
18
  users: OrganizationUser[];
18
19
  tournaments: Tournament[];
19
20
  phoneNumbers: PhoneNumber[];
@@ -1 +1 @@
1
- {"version":3,"file":"organization.entity.d.ts","sourceRoot":"","sources":["../../../src/central-auth/organizations/organization.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAYlG,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAU/C,qBAUa,YAAa,YAAW,aAAa;IAEhD,EAAE,EAAE,MAAM,CAAC;IAOX,IAAI,EAAE,MAAM,CAAC;IAQb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,MAAM,CAAC;IAOd,IAAI,EAAE,gBAAgB,CAAC;IAOvB,MAAM,EAAE,kBAAkB,CAAC;IAU3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ1B,oBAAoB,EAAE,OAAO,CAAC;IAO9B,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAM1B,WAAW,EAAE,UAAU,EAAE,CAAC;IAM1B,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B"}
1
+ {"version":3,"file":"organization.entity.d.ts","sourceRoot":"","sources":["../../../src/central-auth/organizations/organization.entity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAYlG,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAa/C,qBAaa,YAAa,YAAW,aAAa;IAEhD,EAAE,EAAE,MAAM,CAAC;IAOX,IAAI,EAAE,MAAM,CAAC;IAQb,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,KAAK,EAAE,MAAM,CAAC;IAGd,KAAK,EAAE,MAAM,CAAC;IAOd,IAAI,EAAE,gBAAgB,CAAC;IAOvB,MAAM,EAAE,kBAAkB,CAAC;IAU3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ1B,oBAAoB,EAAE,OAAO,CAAC;IAO9B,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAQvB,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAM1B,WAAW,EAAE,UAAU,EAAE,CAAC;IAM1B,YAAY,EAAE,WAAW,EAAE,CAAC;CAC7B"}
@@ -12,11 +12,11 @@ import { OrganizationStatus, OrganizationType } from "@natrave/auth-service-type
12
12
  import {
13
13
  Column,
14
14
  CreateDateColumn,
15
+ DeleteDateColumn,
15
16
  Entity,
16
17
  Index,
17
18
  OneToMany,
18
19
  PrimaryGeneratedColumn,
19
- Unique,
20
20
  UpdateDateColumn
21
21
  } from "typeorm";
22
22
  import { Tournament } from "../../tournaments/index.js";
@@ -93,6 +93,14 @@ __decorateClass([
93
93
  comment: "Data da \xFAltima atualiza\xE7\xE3o do registro."
94
94
  })
95
95
  ], Organization.prototype, "updatedAt", 2);
96
+ __decorateClass([
97
+ DeleteDateColumn({
98
+ name: "deleted_at",
99
+ type: "timestamptz",
100
+ nullable: true,
101
+ comment: "Data de exclus\xE3o l\xF3gica (soft delete) do registro; nulo quando ativo."
102
+ })
103
+ ], Organization.prototype, "deletedAt", 2);
96
104
  __decorateClass([
97
105
  OneToMany(() => OrganizationUser, (user) => user.organization)
98
106
  ], Organization.prototype, "users", 2);
@@ -103,10 +111,13 @@ __decorateClass([
103
111
  OneToMany(() => PhoneNumber, (phone) => phone.organization)
104
112
  ], Organization.prototype, "phoneNumbers", 2);
105
113
  Organization = __decorateClass([
106
- Unique("UQ_organization_document", ["document"]),
107
- Unique("UQ_organization_email", ["email"]),
108
- Unique("UQ_organization_phone", ["phone"]),
109
- Unique("UQ_organization_externalId", ["externalId"]),
114
+ Index("UQ_organization_document", ["document"], { unique: true, where: '"deleted_at" IS NULL' }),
115
+ Index("UQ_organization_email", ["email"], { unique: true, where: '"deleted_at" IS NULL' }),
116
+ Index("UQ_organization_phone", ["phone"], { unique: true, where: '"deleted_at" IS NULL' }),
117
+ Index("UQ_organization_externalId", ["externalId"], {
118
+ unique: true,
119
+ where: '"deleted_at" IS NULL'
120
+ }),
110
121
  Index("idx_organization_document", ["document"]),
111
122
  Index("idx_organization_email", ["email"]),
112
123
  Index("idx_organization_phone", ["phone"]),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natrave/shared-entities",
3
- "version": "1.16.0",
3
+ "version": "1.18.0",
4
4
  "description": "Entidades compartilhadass da NaTrave",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -39,10 +39,11 @@
39
39
  "husky": "^9.1.7",
40
40
  "lint-staged": "^16.2.7",
41
41
  "prettier": "^3.8.1",
42
- "ts-node": "^10.9.2"
42
+ "ts-node": "^10.9.2",
43
+ "typescript": "5.8.2"
43
44
  },
44
45
  "dependencies": {
45
- "@natrave/auth-service-types": "^1.1.63",
46
+ "@natrave/auth-service-types": "^1.2.2",
46
47
  "@natrave/facility-service-types": "^0.0.9",
47
48
  "@natrave/notification-service-types": "^1.1.73",
48
49
  "@natrave/tournaments-service-types": "^1.4.4",