@natrave/shared-entities 8.46.0 → 8.48.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.
Files changed (31) hide show
  1. package/dist/app-auth/users/user.entity.d.ts +1 -0
  2. package/dist/app-auth/users/user.entity.d.ts.map +1 -1
  3. package/dist/app-auth/users/user.entity.js +12 -1
  4. package/dist/database-entities/index.d.ts +2 -1
  5. package/dist/database-entities/index.d.ts.map +1 -1
  6. package/dist/database-entities/index.js +4 -0
  7. package/dist/identity/identity-layer.enum.d.ts +6 -0
  8. package/dist/identity/identity-layer.enum.d.ts.map +1 -0
  9. package/dist/identity/identity-layer.enum.js +9 -0
  10. package/dist/identity/index.d.ts +3 -0
  11. package/dist/identity/index.d.ts.map +1 -0
  12. package/dist/identity/index.js +5 -0
  13. package/dist/identity/views/index.d.ts +4 -0
  14. package/dist/identity/views/index.d.ts.map +1 -0
  15. package/dist/identity/views/index.js +7 -0
  16. package/dist/identity/views/member-identity-views.sql.d.ts +12 -0
  17. package/dist/identity/views/member-identity-views.sql.d.ts.map +1 -0
  18. package/dist/identity/views/member-identity-views.sql.js +113 -0
  19. package/dist/identity/views/member-team-identity.view.d.ts +20 -0
  20. package/dist/identity/views/member-team-identity.view.d.ts.map +1 -0
  21. package/dist/identity/views/member-team-identity.view.js +75 -0
  22. package/dist/identity/views/member-tournament-identity.view.d.ts +27 -0
  23. package/dist/identity/views/member-tournament-identity.view.d.ts.map +1 -0
  24. package/dist/identity/views/member-tournament-identity.view.js +96 -0
  25. package/dist/index.d.ts +1 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -0
  28. package/dist/teams/player-team/player-team.entity.d.ts +2 -0
  29. package/dist/teams/player-team/player-team.entity.d.ts.map +1 -1
  30. package/dist/teams/player-team/player-team.entity.js +21 -1
  31. package/package.json +5 -2
@@ -11,6 +11,7 @@ export declare class User {
11
11
  updatedAt: Date;
12
12
  deletedAt: Date | null;
13
13
  name: string | null;
14
+ nickname: string | null;
14
15
  birthDate: string | null;
15
16
  shirtNumber: number | null;
16
17
  email: string;
@@ -1 +1 @@
1
- {"version":3,"file":"user.entity.d.ts","sourceRoot":"","sources":["../../../src/app-auth/users/user.entity.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAC;AAChG,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAa7C,qBAgBa,IAAI;IAIf,EAAE,EAAE,MAAM,CAAC;IAUX,SAAS,EAAE,MAAM,CAAC;IAOlB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IASvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAQpB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAQzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,KAAK,EAAE,MAAM,CAAC;IAQd,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAQtB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAS5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAUvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IASrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IASxB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQhC,cAAc,EAAE,MAAM,CAAC;IAKvB,aAAa,EAAE,YAAY,EAAE,CAAC;IAK9B,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IAKtC,MAAM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IAAI,CAAC;IASxB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQhC,cAAc,EAAE,MAAM,CAAC;IAKvB,aAAa,EAAE,YAAY,EAAE,CAAC;IAK9B,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IAKtC,MAAM,EAAE,MAAM,CAAC;IAGf,aAAa,EAAE,YAAY,EAAE,CAAC;IAG9B,gBAAgB,EAAE,eAAe,EAAE,CAAC;IAMpC,sBAAsB,EAAE,0BAA0B,GAAG,IAAI,CAAC;IAG1D,8BAA8B,EAAE,6BAA6B,EAAE,CAAC;IAMhE,WAAW,IAAI,IAAI;CAGpB"}
@@ -10,6 +10,7 @@ var __decorateClass = (decorators, target, key, kind) => {
10
10
  };
11
11
  import {
12
12
  BeforeInsert,
13
+ Check,
13
14
  Column,
14
15
  CreateDateColumn,
15
16
  DeleteDateColumn,
@@ -79,6 +80,15 @@ __decorateClass([
79
80
  comment: "Nome do usu\xE1rio."
80
81
  })
81
82
  ], User.prototype, "name", 2);
83
+ __decorateClass([
84
+ Column({
85
+ name: "nickname",
86
+ type: "varchar",
87
+ length: 50,
88
+ nullable: true,
89
+ comment: "Apelido do usu\xE1rio (perfil). NULL = sem apelido."
90
+ })
91
+ ], User.prototype, "nickname", 2);
82
92
  __decorateClass([
83
93
  Column({
84
94
  name: "birth_date",
@@ -211,7 +221,8 @@ User = __decorateClass([
211
221
  Index("IDX_users_updated_at", ["updatedAt"]),
212
222
  Index("IDX_users_name", ["name"], { where: '"deleted_at" IS NULL' }),
213
223
  Index("IDX_users_gender", ["gender"], { where: '"deleted_at" IS NULL' }),
214
- Index("IDX_users_id_session_version", ["id", "sessionVersion"])
224
+ Index("IDX_users_id_session_version", ["id", "sessionVersion"]),
225
+ Check("CHK_users_nickname", `"nickname" IS NULL OR btrim("nickname") <> ''`)
215
226
  ], User);
216
227
  export {
217
228
  User
@@ -7,6 +7,7 @@ import { FeedActivity, FeedActivityReaction, FeedActivitySubject, FeedOutbox } f
7
7
  import { FinanceAuditEvent, FinanceEntry, FinanceEntryItem, FinanceLedger } from '../finance';
8
8
  import { FriendlyBoardPreference, FriendlyChallenge, FriendlyChallengeExtra, FriendlyHistory, FriendlyMatch, FriendlyMatchAttendance, FriendlyMatchExtra, FriendlyMatchGoal, FriendlyMatchMvp, FriendlyMvpVote, FriendlyOpenChallengeExtra, FriendlyRequest, FriendlyScoreEvent, FriendlyStaffCommand, FriendlyStaffCommandEffect } from '../friendlies';
9
9
  import { TeamPlayerMergeHistory } from '../history-logs';
10
+ import { MemberTeamIdentity, MemberTournamentIdentity } from '../identity';
10
11
  import { Notification, NotificationDelivery, NotificationDispatchLog, PushDeviceToken, UserNotificationPreference } from '../notifications';
11
12
  import { Payment, PaymentProvider, UserPaymentProvider } from '../payments';
12
13
  import { Player, PlayerPersonalData, PlayerPosition } from '../players';
@@ -14,5 +15,5 @@ import { Promotion, PromotionAdvertiser, PromotionContact, PromotionCreative, Pr
14
15
  import { PlayerTeam, Team, TeamAccessCode, TeamFollow, TeamJoinRequest, TeamKit, TeamModality, TeamSponsor, TeamTrophy } from '../teams';
15
16
  import { CategoryBroadcastSetting, Referee, RegulationExtraction, Tournament, TournamentAllowedPhone, TournamentBillingOutbox, TournamentBracket, TournamentBracketSlot, TournamentCategoryGroup, TournamentContact, TournamentCoupon, TournamentCreationDraft, TournamentFacility, TournamentFollow, TournamentFormatConfig, TournamentGroup, TournamentGroupContact, TournamentMatch, TournamentMatchAvailability, TournamentMatchCard, TournamentMatchGoal, TournamentMatchKit, TournamentMatchObservation, TournamentMatchPlayerNumber, TournamentMatchReferee, TournamentMatchRule, TournamentMatchSchema, TournamentMatchSubstitution, TournamentMatchTimeout, TournamentPayment, TournamentPenaltyShootout, TournamentPlayer, TournamentPlayerRule, TournamentPointsAdjustment, TournamentPrizeRule, TournamentPublicationChargeRule, TournamentRegistrationRequest, TournamentRegistrationRequirement, TournamentRegulationFieldStatus, TournamentRound, TournamentTeam, TournamentTeamInvitation, TournamentTeamMemberNote, TournamentTieBreakConfig } from '../tournaments';
16
17
  import { UserDomainEvent, UserEventView } from '../user-events';
17
- export declare const DATABASE_ENTITIES: (typeof PasswordReset | typeof Notification | typeof User | typeof NotificationDelivery | typeof NotificationDispatchLog | typeof PushDeviceToken | typeof UserNotificationPreference | typeof TeamPlayerMergeHistory | typeof Team | typeof PlayerTeam | typeof Player | typeof TournamentMatchGoal | typeof TournamentTeam | typeof TournamentMatch | typeof TournamentPlayer | typeof TournamentMatchKit | typeof TournamentMatchSubstitution | typeof TournamentMatchTimeout | typeof TournamentPenaltyShootout | typeof CategoryBroadcastSetting | typeof Tournament | typeof TournamentMatchReferee | typeof Referee | typeof RegulationExtraction | typeof TournamentAllowedPhone | typeof PhoneNumber | typeof TournamentBillingOutbox | typeof TournamentGroupContact | typeof TournamentCategoryGroup | typeof Organization | typeof TournamentContact | typeof Coupon | typeof CouponUsage | typeof TournamentCoupon | typeof TournamentCreationDraft | typeof City | typeof FacilityImage | typeof Facility | typeof FacilityOwner | typeof Field | typeof FieldImage | typeof TournamentFacility | typeof TournamentFollow | typeof TournamentFormatConfig | typeof TournamentMatchObservation | typeof TournamentMatchPlayerNumber | typeof TournamentMatchRule | typeof TournamentMatchSchema | typeof TournamentMatchAvailability | typeof UserPaymentProvider | typeof PaymentProvider | typeof Payment | typeof TournamentPayment | typeof OrganizationUser | typeof TournamentPlayerRule | typeof TournamentPointsAdjustment | typeof TournamentPrizeRule | typeof TournamentPublicationChargeRule | typeof TournamentRegistrationRequest | typeof TournamentRegistrationRequirement | typeof TournamentRegulationFieldStatus | typeof TournamentRound | typeof TournamentTeamInvitation | typeof TournamentTeamMemberNote | typeof TournamentTieBreakConfig | typeof Address | typeof OrganizationUserBillingInfo | typeof TournamentGroup | typeof TournamentBracket | typeof TournamentBracketSlot | typeof TeamTrophy | typeof TournamentMatchCard | typeof TeamAccessCode | typeof TeamJoinRequest | typeof TeamKit | typeof TeamModality | typeof TeamSponsor | typeof TeamFollow | typeof PlayerPosition | typeof PlayerPersonalData | typeof UserAuthProvider | typeof RefreshToken | typeof UserLocality | typeof UserOnboardingIntent | typeof UserVerification | typeof BillingProduct | typeof BillingPlan | typeof BillingSubscriptionGrant | typeof BillingSubscription | typeof BillingSubscriptionItem | typeof BillingAccount | typeof BillingEvent | typeof BillingInvoice | typeof BillingInvoiceLineItem | typeof BillingMatchUsage | typeof BillingPayment | typeof BillingProviderWebhookEvent | typeof FeedActivityReaction | typeof FeedActivity | typeof FeedActivitySubject | typeof FeedOutbox | typeof FinanceAuditEvent | typeof FinanceEntryItem | typeof FinanceEntry | typeof FinanceLedger | typeof FriendlyBoardPreference | typeof FriendlyMatchAttendance | typeof FriendlyMatch | typeof FriendlyMatchExtra | typeof FriendlyMatchGoal | typeof FriendlyMatchMvp | typeof FriendlyMvpVote | typeof FriendlyOpenChallengeExtra | typeof FriendlyChallenge | typeof FriendlyStaffCommand | typeof FriendlyScoreEvent | typeof FriendlyChallengeExtra | typeof FriendlyHistory | typeof FriendlyRequest | typeof FriendlyStaffCommandEffect | typeof PromotionContact | typeof Promotion | typeof PromotionCreative | typeof PromotionTarget | typeof PromotionAdvertiser | typeof PromotionEvent | typeof PromotionUserState | typeof UserDomainEvent | typeof UserEventView)[];
18
+ export declare const DATABASE_ENTITIES: (typeof PasswordReset | typeof Notification | typeof User | typeof NotificationDelivery | typeof NotificationDispatchLog | typeof PushDeviceToken | typeof UserNotificationPreference | typeof TeamPlayerMergeHistory | typeof Team | typeof PlayerTeam | typeof Player | typeof TournamentMatchGoal | typeof TournamentTeam | typeof TournamentMatch | typeof TournamentPlayer | typeof TournamentMatchKit | typeof TournamentMatchSubstitution | typeof TournamentMatchTimeout | typeof TournamentPenaltyShootout | typeof CategoryBroadcastSetting | typeof Tournament | typeof TournamentMatchReferee | typeof Referee | typeof RegulationExtraction | typeof TournamentAllowedPhone | typeof PhoneNumber | typeof TournamentBillingOutbox | typeof TournamentGroupContact | typeof TournamentCategoryGroup | typeof Organization | typeof TournamentContact | typeof Coupon | typeof CouponUsage | typeof TournamentCoupon | typeof TournamentCreationDraft | typeof City | typeof FacilityImage | typeof Facility | typeof FacilityOwner | typeof Field | typeof FieldImage | typeof TournamentFacility | typeof TournamentFollow | typeof TournamentFormatConfig | typeof TournamentMatchObservation | typeof TournamentMatchPlayerNumber | typeof TournamentMatchRule | typeof TournamentMatchSchema | typeof TournamentMatchAvailability | typeof UserPaymentProvider | typeof PaymentProvider | typeof Payment | typeof TournamentPayment | typeof OrganizationUser | typeof TournamentPlayerRule | typeof TournamentPointsAdjustment | typeof TournamentPrizeRule | typeof TournamentPublicationChargeRule | typeof TournamentRegistrationRequest | typeof TournamentRegistrationRequirement | typeof TournamentRegulationFieldStatus | typeof TournamentRound | typeof TournamentTeamInvitation | typeof TournamentTeamMemberNote | typeof TournamentTieBreakConfig | typeof Address | typeof OrganizationUserBillingInfo | typeof TournamentGroup | typeof TournamentBracket | typeof TournamentBracketSlot | typeof TeamTrophy | typeof TournamentMatchCard | typeof TeamAccessCode | typeof TeamJoinRequest | typeof TeamKit | typeof TeamModality | typeof TeamSponsor | typeof TeamFollow | typeof PlayerPosition | typeof PlayerPersonalData | typeof UserAuthProvider | typeof RefreshToken | typeof UserLocality | typeof UserOnboardingIntent | typeof UserVerification | typeof BillingProduct | typeof BillingPlan | typeof BillingSubscriptionGrant | typeof BillingSubscription | typeof BillingSubscriptionItem | typeof BillingAccount | typeof BillingEvent | typeof BillingInvoice | typeof BillingInvoiceLineItem | typeof BillingMatchUsage | typeof BillingPayment | typeof BillingProviderWebhookEvent | typeof FeedActivityReaction | typeof FeedActivity | typeof FeedActivitySubject | typeof FeedOutbox | typeof FinanceAuditEvent | typeof FinanceEntryItem | typeof FinanceEntry | typeof FinanceLedger | typeof FriendlyBoardPreference | typeof FriendlyMatchAttendance | typeof FriendlyMatch | typeof FriendlyMatchExtra | typeof FriendlyMatchGoal | typeof FriendlyMatchMvp | typeof FriendlyMvpVote | typeof FriendlyOpenChallengeExtra | typeof FriendlyChallenge | typeof FriendlyStaffCommand | typeof FriendlyScoreEvent | typeof FriendlyChallengeExtra | typeof FriendlyHistory | typeof FriendlyRequest | typeof FriendlyStaffCommandEffect | typeof MemberTeamIdentity | typeof MemberTournamentIdentity | typeof PromotionContact | typeof Promotion | typeof PromotionCreative | typeof PromotionTarget | typeof PromotionAdvertiser | typeof PromotionEvent | typeof PromotionUserState | typeof UserDomainEvent | typeof UserEventView)[];
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database-entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,cAAc,EACd,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,EAC3B,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,kBAAk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C/B,6BAA6B,EAC7B,iCAAiC,EAEjC,+BAA+B,EAC/B,eAAe,EAEf,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,iBAAiB,u6GAqI7B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database-entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,IAAI,EACJ,gBAAgB,EAChB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,iBAAiB,EACjB,cAAc,EACd,WAAW,EACX,cAAc,EACd,2BAA2B,EAC3B,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,2BAA2B,EAC3B,WAAW,EACZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EACL,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,aAAa,EACb,aAAa,EACb,KAAK,EACL,UAAU,EACX,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC9F,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EAEf,0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ACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EAEjC,+BAA+B,EAC/B,eAAe,EAEf,cAAc,EACd,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,iBAAiB,q+GAwI7B,CAAC"}
@@ -58,6 +58,7 @@ import {
58
58
  FriendlyStaffCommandEffect
59
59
  } from "../friendlies/index.js";
60
60
  import { TeamPlayerMergeHistory } from "../history-logs/index.js";
61
+ import { MemberTeamIdentity, MemberTournamentIdentity } from "../identity/index.js";
61
62
  import {
62
63
  Notification,
63
64
  NotificationDelivery,
@@ -252,6 +253,9 @@ const DATABASE_ENTITIES = [
252
253
  TournamentBracketSlot,
253
254
  UserDomainEvent,
254
255
  UserEventView,
256
+ // Visões de identidade (synchronize: false): criadas pela migration do app-auth-service.
257
+ MemberTeamIdentity,
258
+ MemberTournamentIdentity,
255
259
  UserLocality,
256
260
  FriendlyChallenge,
257
261
  FriendlyChallengeExtra,
@@ -0,0 +1,6 @@
1
+ export declare enum IdentityLayer {
2
+ TOURNAMENT = "tournament",
3
+ TEAM = "team",
4
+ PERSON = "person"
5
+ }
6
+ //# sourceMappingURL=identity-layer.enum.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity-layer.enum.d.ts","sourceRoot":"","sources":["../../src/identity/identity-layer.enum.ts"],"names":[],"mappings":"AAWA,oBAAY,aAAa;IACvB,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB"}
@@ -0,0 +1,9 @@
1
+ var IdentityLayer = /* @__PURE__ */ ((IdentityLayer2) => {
2
+ IdentityLayer2["TOURNAMENT"] = "tournament";
3
+ IdentityLayer2["TEAM"] = "team";
4
+ IdentityLayer2["PERSON"] = "person";
5
+ return IdentityLayer2;
6
+ })(IdentityLayer || {});
7
+ export {
8
+ IdentityLayer
9
+ };
@@ -0,0 +1,3 @@
1
+ export { IdentityLayer } from './identity-layer.enum';
2
+ export * from './views';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,cAAc,SAAS,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { IdentityLayer } from "./identity-layer.enum.js";
2
+ export * from "./views/index.js";
3
+ export {
4
+ IdentityLayer
5
+ };
@@ -0,0 +1,4 @@
1
+ export * from './member-identity-views.sql';
2
+ export { MemberTeamIdentity } from './member-team-identity.view';
3
+ export { MemberTournamentIdentity } from './member-tournament-identity.view';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/identity/views/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from "./member-identity-views.sql.js";
2
+ import { MemberTeamIdentity } from "./member-team-identity.view.js";
3
+ import { MemberTournamentIdentity } from "./member-tournament-identity.view.js";
4
+ export {
5
+ MemberTeamIdentity,
6
+ MemberTournamentIdentity
7
+ };
@@ -0,0 +1,12 @@
1
+ export declare const MEMBER_TEAM_IDENTITY_VIEW = "member_team_identity";
2
+ export declare const MEMBER_TOURNAMENT_IDENTITY_VIEW = "member_tournament_identity";
3
+ export interface MemberIdentityViewsVersion {
4
+ version: number;
5
+ teamSelect: string;
6
+ tournamentSelect: string;
7
+ up: readonly string[];
8
+ down: readonly string[];
9
+ }
10
+ export declare const MEMBER_IDENTITY_VIEWS_V1: MemberIdentityViewsVersion;
11
+ export declare const MEMBER_IDENTITY_VIEWS_LATEST: MemberIdentityViewsVersion;
12
+ //# sourceMappingURL=member-identity-views.sql.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member-identity-views.sql.d.ts","sourceRoot":"","sources":["../../../src/identity/views/member-identity-views.sql.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,yBAAyB,yBAAyB,CAAC;AAChE,eAAO,MAAM,+BAA+B,+BAA+B,CAAC;AAG5E,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,MAAM,CAAC;IAEnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,EAAE,EAAE,SAAS,MAAM,EAAE,CAAC;IACtB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB;AA6GD,eAAO,MAAM,wBAAwB,EAAE,0BAsBtC,CAAC;AAGF,eAAO,MAAM,4BAA4B,4BAA2B,CAAC"}
@@ -0,0 +1,113 @@
1
+ const MEMBER_TEAM_IDENTITY_VIEW = "member_team_identity";
2
+ const MEMBER_TOURNAMENT_IDENTITY_VIEW = "member_tournament_identity";
3
+ const TEAM_SELECT_V1 = `
4
+ SELECT
5
+ pt.id AS player_team_id,
6
+ pt.player_id AS player_id,
7
+ pt.team_id AS team_id,
8
+ p.user_id AS user_id,
9
+ (p.user_id IS NOT NULL) AS has_account,
10
+ COALESCE(pt.display_name, person.name) AS name,
11
+ CASE
12
+ WHEN pt.display_name IS NOT NULL THEN 'team'
13
+ WHEN person.name IS NOT NULL THEN 'person'
14
+ END AS name_source,
15
+ COALESCE(pt.photo_url, person.photo_url) AS photo_url,
16
+ CASE
17
+ WHEN pt.photo_url IS NOT NULL THEN 'team'
18
+ WHEN person.photo_url IS NOT NULL THEN 'person'
19
+ END AS photo_source,
20
+ pt.nickname AS nickname,
21
+ pt.shirt_number AS shirt_number,
22
+ pt.positions::text[] AS positions,
23
+ pt.type::text AS type,
24
+ pt.role::text AS role,
25
+ pt.is_admin AS is_admin,
26
+ pt.deleted_at AS deleted_at
27
+ FROM player_teams pt
28
+ JOIN players p
29
+ ON p.id = pt.player_id
30
+ LEFT JOIN users u
31
+ ON u.id = p.user_id
32
+ AND u.deleted_at IS NULL
33
+ CROSS JOIN LATERAL (
34
+ SELECT
35
+ COALESCE(NULLIF(btrim(u.name), ''), NULLIF(btrim(p.nickname), '')) AS name,
36
+ NULLIF(btrim(u.image_url), '') AS photo_url
37
+ ) person
38
+ `.trim();
39
+ const TOURNAMENT_SELECT_V1 = `
40
+ SELECT
41
+ tp.id AS tournament_player_id,
42
+ tp.team_id AS tournament_team_id,
43
+ tp.player_team_id AS player_team_id,
44
+ mti.player_id AS player_id,
45
+ mti.team_id AS team_id,
46
+ mti.user_id AS user_id,
47
+ mti.has_account AS has_account,
48
+ COALESCE(tp.display_name, mti.name) AS name,
49
+ CASE
50
+ WHEN tp.display_name IS NOT NULL THEN 'tournament'
51
+ ELSE mti.name_source
52
+ END AS name_source,
53
+ COALESCE(tp.photo_url, mti.photo_url) AS photo_url,
54
+ CASE
55
+ WHEN tp.photo_url IS NOT NULL THEN 'tournament'
56
+ ELSE mti.photo_source
57
+ END AS photo_source,
58
+ COALESCE(tp.nickname, mti.nickname) AS nickname,
59
+ CASE
60
+ WHEN tp.nickname IS NOT NULL THEN 'tournament'
61
+ WHEN mti.nickname IS NOT NULL THEN 'team'
62
+ END AS nickname_source,
63
+ COALESCE(tp.shirt_number, mti.shirt_number) AS shirt_number,
64
+ CASE
65
+ WHEN tp.shirt_number IS NOT NULL THEN 'tournament'
66
+ WHEN mti.shirt_number IS NOT NULL THEN 'team'
67
+ END AS shirt_number_source,
68
+ COALESCE(tp.positions::text[], mti.positions) AS positions,
69
+ CASE
70
+ WHEN tp.positions IS NOT NULL THEN 'tournament'
71
+ ELSE 'team'
72
+ END AS positions_source,
73
+ mti.type AS type,
74
+ mti.role AS role,
75
+ tp.is_owner AS is_owner,
76
+ tp.created_at AS called_up_at,
77
+ tp.deleted_at AS deleted_at,
78
+ mti.deleted_at AS team_member_deleted_at
79
+ FROM tournament_players tp
80
+ JOIN member_team_identity mti
81
+ ON mti.player_team_id = tp.player_team_id
82
+ `.trim();
83
+ const comment = (target, text) => `COMMENT ON ${target} IS '${text.replace(/'/g, "''")}'`;
84
+ const MEMBER_IDENTITY_VIEWS_V1 = {
85
+ version: 1,
86
+ teamSelect: TEAM_SELECT_V1,
87
+ tournamentSelect: TOURNAMENT_SELECT_V1,
88
+ up: [
89
+ `DROP VIEW IF EXISTS ${MEMBER_TOURNAMENT_IDENTITY_VIEW}`,
90
+ `DROP VIEW IF EXISTS ${MEMBER_TEAM_IDENTITY_VIEW}`,
91
+ `CREATE VIEW ${MEMBER_TEAM_IDENTITY_VIEW} AS ${TEAM_SELECT_V1}`,
92
+ `CREATE VIEW ${MEMBER_TOURNAMENT_IDENTITY_VIEW} AS ${TOURNAMENT_SELECT_V1}`,
93
+ comment(
94
+ `VIEW ${MEMBER_TEAM_IDENTITY_VIEW}`,
95
+ "Identidade v1 do membro no time: player_teams, depois a pessoa (users, players.nickname). Defini\xE7\xE3o em @natrave/shared-entities (docs/IDENTIDADE.md)."
96
+ ),
97
+ comment(
98
+ `VIEW ${MEMBER_TOURNAMENT_IDENTITY_VIEW}`,
99
+ "Identidade v1 do membro na categoria: tournament_players, depois member_team_identity. Defini\xE7\xE3o em @natrave/shared-entities (docs/IDENTIDADE.md)."
100
+ )
101
+ ],
102
+ down: [
103
+ `DROP VIEW IF EXISTS ${MEMBER_TOURNAMENT_IDENTITY_VIEW}`,
104
+ `DROP VIEW IF EXISTS ${MEMBER_TEAM_IDENTITY_VIEW}`
105
+ ]
106
+ };
107
+ const MEMBER_IDENTITY_VIEWS_LATEST = MEMBER_IDENTITY_VIEWS_V1;
108
+ export {
109
+ MEMBER_IDENTITY_VIEWS_LATEST,
110
+ MEMBER_IDENTITY_VIEWS_V1,
111
+ MEMBER_TEAM_IDENTITY_VIEW,
112
+ MEMBER_TOURNAMENT_IDENTITY_VIEW
113
+ };
@@ -0,0 +1,20 @@
1
+ import { IdentityLayer } from '../identity-layer.enum';
2
+ export declare class MemberTeamIdentity {
3
+ playerTeamId: number;
4
+ playerId: number;
5
+ teamId: number;
6
+ userId: string | null;
7
+ hasAccount: boolean;
8
+ name: string | null;
9
+ nameSource: IdentityLayer.TEAM | IdentityLayer.PERSON | null;
10
+ photoUrl: string | null;
11
+ photoSource: IdentityLayer.TEAM | IdentityLayer.PERSON | null;
12
+ nickname: string | null;
13
+ shirtNumber: number | null;
14
+ positions: string[];
15
+ type: string;
16
+ role: string | null;
17
+ isAdmin: boolean;
18
+ deletedAt: Date | null;
19
+ }
20
+ //# sourceMappingURL=member-team-identity.view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member-team-identity.view.d.ts","sourceRoot":"","sources":["../../../src/identity/views/member-team-identity.view.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAavD,qBAKa,kBAAkB;IAE7B,YAAY,EAAE,MAAM,CAAC;IAGrB,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,UAAU,EAAE,OAAO,CAAC;IAIpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpB,UAAU,EAAE,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC;IAG7D,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,WAAW,EAAE,aAAa,CAAC,IAAI,GAAG,aAAa,CAAC,MAAM,GAAG,IAAI,CAAC;IAI9D,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAI3B,SAAS,EAAE,MAAM,EAAE,CAAC;IAIpB,IAAI,EAAE,MAAM,CAAC;IAIb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpB,OAAO,EAAE,OAAO,CAAC;IAIjB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB"}
@@ -0,0 +1,75 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result) __defProp(target, key, result);
9
+ return result;
10
+ };
11
+ import { ViewColumn, ViewEntity } from "typeorm";
12
+ import {
13
+ MEMBER_IDENTITY_VIEWS_LATEST,
14
+ MEMBER_TEAM_IDENTITY_VIEW
15
+ } from "./member-identity-views.sql.js";
16
+ let MemberTeamIdentity = class {
17
+ };
18
+ __decorateClass([
19
+ ViewColumn({ name: "player_team_id" })
20
+ ], MemberTeamIdentity.prototype, "playerTeamId", 2);
21
+ __decorateClass([
22
+ ViewColumn({ name: "player_id" })
23
+ ], MemberTeamIdentity.prototype, "playerId", 2);
24
+ __decorateClass([
25
+ ViewColumn({ name: "team_id" })
26
+ ], MemberTeamIdentity.prototype, "teamId", 2);
27
+ __decorateClass([
28
+ ViewColumn({ name: "user_id" })
29
+ ], MemberTeamIdentity.prototype, "userId", 2);
30
+ __decorateClass([
31
+ ViewColumn({ name: "has_account" })
32
+ ], MemberTeamIdentity.prototype, "hasAccount", 2);
33
+ __decorateClass([
34
+ ViewColumn()
35
+ ], MemberTeamIdentity.prototype, "name", 2);
36
+ __decorateClass([
37
+ ViewColumn({ name: "name_source" })
38
+ ], MemberTeamIdentity.prototype, "nameSource", 2);
39
+ __decorateClass([
40
+ ViewColumn({ name: "photo_url" })
41
+ ], MemberTeamIdentity.prototype, "photoUrl", 2);
42
+ __decorateClass([
43
+ ViewColumn({ name: "photo_source" })
44
+ ], MemberTeamIdentity.prototype, "photoSource", 2);
45
+ __decorateClass([
46
+ ViewColumn()
47
+ ], MemberTeamIdentity.prototype, "nickname", 2);
48
+ __decorateClass([
49
+ ViewColumn({ name: "shirt_number" })
50
+ ], MemberTeamIdentity.prototype, "shirtNumber", 2);
51
+ __decorateClass([
52
+ ViewColumn()
53
+ ], MemberTeamIdentity.prototype, "positions", 2);
54
+ __decorateClass([
55
+ ViewColumn()
56
+ ], MemberTeamIdentity.prototype, "type", 2);
57
+ __decorateClass([
58
+ ViewColumn()
59
+ ], MemberTeamIdentity.prototype, "role", 2);
60
+ __decorateClass([
61
+ ViewColumn({ name: "is_admin" })
62
+ ], MemberTeamIdentity.prototype, "isAdmin", 2);
63
+ __decorateClass([
64
+ ViewColumn({ name: "deleted_at" })
65
+ ], MemberTeamIdentity.prototype, "deletedAt", 2);
66
+ MemberTeamIdentity = __decorateClass([
67
+ ViewEntity({
68
+ name: MEMBER_TEAM_IDENTITY_VIEW,
69
+ expression: MEMBER_IDENTITY_VIEWS_LATEST.teamSelect,
70
+ synchronize: false
71
+ })
72
+ ], MemberTeamIdentity);
73
+ export {
74
+ MemberTeamIdentity
75
+ };
@@ -0,0 +1,27 @@
1
+ import { IdentityLayer } from '../identity-layer.enum';
2
+ export declare class MemberTournamentIdentity {
3
+ tournamentPlayerId: number;
4
+ tournamentTeamId: number;
5
+ playerTeamId: number;
6
+ playerId: number;
7
+ teamId: number;
8
+ userId: string | null;
9
+ hasAccount: boolean;
10
+ name: string | null;
11
+ nameSource: IdentityLayer | null;
12
+ photoUrl: string | null;
13
+ photoSource: IdentityLayer | null;
14
+ nickname: string | null;
15
+ nicknameSource: IdentityLayer.TOURNAMENT | IdentityLayer.TEAM | null;
16
+ shirtNumber: number | null;
17
+ shirtNumberSource: IdentityLayer.TOURNAMENT | IdentityLayer.TEAM | null;
18
+ positions: string[];
19
+ positionsSource: IdentityLayer.TOURNAMENT | IdentityLayer.TEAM;
20
+ type: string;
21
+ role: string | null;
22
+ isOwner: boolean;
23
+ calledUpAt: Date;
24
+ deletedAt: Date | null;
25
+ teamMemberDeletedAt: Date | null;
26
+ }
27
+ //# sourceMappingURL=member-tournament-identity.view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member-tournament-identity.view.d.ts","sourceRoot":"","sources":["../../../src/identity/views/member-tournament-identity.view.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAavD,qBAKa,wBAAwB;IAEnC,kBAAkB,EAAE,MAAM,CAAC;IAI3B,gBAAgB,EAAE,MAAM,CAAC;IAGzB,YAAY,EAAE,MAAM,CAAC;IAGrB,QAAQ,EAAE,MAAM,CAAC;IAIjB,MAAM,EAAE,MAAM,CAAC;IAGf,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,UAAU,EAAE,OAAO,CAAC;IAGpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpB,UAAU,EAAE,aAAa,GAAG,IAAI,CAAC;IAGjC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,WAAW,EAAE,aAAa,GAAG,IAAI,CAAC;IAGlC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAGxB,cAAc,EAAE,aAAa,CAAC,UAAU,GAAG,aAAa,CAAC,IAAI,GAAG,IAAI,CAAC;IAGrE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAG3B,iBAAiB,EAAE,aAAa,CAAC,UAAU,GAAG,aAAa,CAAC,IAAI,GAAG,IAAI,CAAC;IAIxE,SAAS,EAAE,MAAM,EAAE,CAAC;IAGpB,eAAe,EAAE,aAAa,CAAC,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC;IAI/D,IAAI,EAAE,MAAM,CAAC;IAIb,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAGpB,OAAO,EAAE,OAAO,CAAC;IAGjB,UAAU,EAAE,IAAI,CAAC;IAIjB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAIvB,mBAAmB,EAAE,IAAI,GAAG,IAAI,CAAC;CAClC"}
@@ -0,0 +1,96 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result) __defProp(target, key, result);
9
+ return result;
10
+ };
11
+ import { ViewColumn, ViewEntity } from "typeorm";
12
+ import {
13
+ MEMBER_IDENTITY_VIEWS_LATEST,
14
+ MEMBER_TOURNAMENT_IDENTITY_VIEW
15
+ } from "./member-identity-views.sql.js";
16
+ let MemberTournamentIdentity = class {
17
+ };
18
+ __decorateClass([
19
+ ViewColumn({ name: "tournament_player_id" })
20
+ ], MemberTournamentIdentity.prototype, "tournamentPlayerId", 2);
21
+ __decorateClass([
22
+ ViewColumn({ name: "tournament_team_id" })
23
+ ], MemberTournamentIdentity.prototype, "tournamentTeamId", 2);
24
+ __decorateClass([
25
+ ViewColumn({ name: "player_team_id" })
26
+ ], MemberTournamentIdentity.prototype, "playerTeamId", 2);
27
+ __decorateClass([
28
+ ViewColumn({ name: "player_id" })
29
+ ], MemberTournamentIdentity.prototype, "playerId", 2);
30
+ __decorateClass([
31
+ ViewColumn({ name: "team_id" })
32
+ ], MemberTournamentIdentity.prototype, "teamId", 2);
33
+ __decorateClass([
34
+ ViewColumn({ name: "user_id" })
35
+ ], MemberTournamentIdentity.prototype, "userId", 2);
36
+ __decorateClass([
37
+ ViewColumn({ name: "has_account" })
38
+ ], MemberTournamentIdentity.prototype, "hasAccount", 2);
39
+ __decorateClass([
40
+ ViewColumn()
41
+ ], MemberTournamentIdentity.prototype, "name", 2);
42
+ __decorateClass([
43
+ ViewColumn({ name: "name_source" })
44
+ ], MemberTournamentIdentity.prototype, "nameSource", 2);
45
+ __decorateClass([
46
+ ViewColumn({ name: "photo_url" })
47
+ ], MemberTournamentIdentity.prototype, "photoUrl", 2);
48
+ __decorateClass([
49
+ ViewColumn({ name: "photo_source" })
50
+ ], MemberTournamentIdentity.prototype, "photoSource", 2);
51
+ __decorateClass([
52
+ ViewColumn()
53
+ ], MemberTournamentIdentity.prototype, "nickname", 2);
54
+ __decorateClass([
55
+ ViewColumn({ name: "nickname_source" })
56
+ ], MemberTournamentIdentity.prototype, "nicknameSource", 2);
57
+ __decorateClass([
58
+ ViewColumn({ name: "shirt_number" })
59
+ ], MemberTournamentIdentity.prototype, "shirtNumber", 2);
60
+ __decorateClass([
61
+ ViewColumn({ name: "shirt_number_source" })
62
+ ], MemberTournamentIdentity.prototype, "shirtNumberSource", 2);
63
+ __decorateClass([
64
+ ViewColumn()
65
+ ], MemberTournamentIdentity.prototype, "positions", 2);
66
+ __decorateClass([
67
+ ViewColumn({ name: "positions_source" })
68
+ ], MemberTournamentIdentity.prototype, "positionsSource", 2);
69
+ __decorateClass([
70
+ ViewColumn()
71
+ ], MemberTournamentIdentity.prototype, "type", 2);
72
+ __decorateClass([
73
+ ViewColumn()
74
+ ], MemberTournamentIdentity.prototype, "role", 2);
75
+ __decorateClass([
76
+ ViewColumn({ name: "is_owner" })
77
+ ], MemberTournamentIdentity.prototype, "isOwner", 2);
78
+ __decorateClass([
79
+ ViewColumn({ name: "called_up_at" })
80
+ ], MemberTournamentIdentity.prototype, "calledUpAt", 2);
81
+ __decorateClass([
82
+ ViewColumn({ name: "deleted_at" })
83
+ ], MemberTournamentIdentity.prototype, "deletedAt", 2);
84
+ __decorateClass([
85
+ ViewColumn({ name: "team_member_deleted_at" })
86
+ ], MemberTournamentIdentity.prototype, "teamMemberDeletedAt", 2);
87
+ MemberTournamentIdentity = __decorateClass([
88
+ ViewEntity({
89
+ name: MEMBER_TOURNAMENT_IDENTITY_VIEW,
90
+ expression: MEMBER_IDENTITY_VIEWS_LATEST.tournamentSelect,
91
+ synchronize: false
92
+ })
93
+ ], MemberTournamentIdentity);
94
+ export {
95
+ MemberTournamentIdentity
96
+ };
package/dist/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './feed';
10
10
  export * from './finance';
11
11
  export * from './friendlies';
12
12
  export * from './history-logs';
13
+ export * from './identity';
13
14
  export * from './notifications';
14
15
  export * from './payments';
15
16
  export * from './players';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
package/dist/index.js CHANGED
@@ -10,6 +10,7 @@ export * from "./feed/index.js";
10
10
  export * from "./finance/index.js";
11
11
  export * from "./friendlies/index.js";
12
12
  export * from "./history-logs/index.js";
13
+ export * from "./identity/index.js";
13
14
  export * from "./notifications/index.js";
14
15
  export * from "./payments/index.js";
15
16
  export * from "./players/index.js";
@@ -9,6 +9,8 @@ export declare class PlayerTeam {
9
9
  id: number;
10
10
  playerId: number;
11
11
  teamId: number;
12
+ displayName: string | null;
13
+ photoUrl: string | null;
12
14
  type: TeamMemberType;
13
15
  role: TechnicalStaffRole | null;
14
16
  positions: Position[];
@@ -1 +1 @@
1
- {"version":3,"file":"player-team.entity.d.ts","sourceRoot":"","sources":["../../../src/teams/player-team/player-team.entity.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+EAA+E,CAAC;AACvH,OAAO,EAAE,QAAQ,EAAE,MAAM,mDAAmD,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,qCAAqC,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+DAA+D,CAAC;AACjG,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,qBAYa,UAAU;IAKrB,EAAE,EAAE,MAAM,CAAC;IAIX,QAAQ,EAAE,MAAM,CAAC;IAGjB,MAAM,EAAE,MAAM,CAAC;IAQf,IAAI,EAAE,cAAc,CAAC;IAQrB,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAShC,S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Q,EAAE,MAAM,GAAG,IAAI,CAAC;IAQxB,IAAI,EAAE,cAAc,CAAC;IAQrB,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAShC,SAAS,EAAE,QAAQ,EAAE,CAAC;IAQtB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAQxB,OAAO,EAAE,OAAO,CAAC;IAWjB,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IAUvC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQhC,qBAAqB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQrC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAGvB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAKhB,MAAM,EAAE,MAAM,CAAC;IAIf,IAAI,EAAE,IAAI,CAAC;IAGX,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IAItC,cAAc,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAI/C,mBAAmB,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;CACrD"}
@@ -9,6 +9,7 @@ var __decorateClass = (decorators, target, key, kind) => {
9
9
  return result;
10
10
  };
11
11
  import {
12
+ Check,
12
13
  Column,
13
14
  CreateDateColumn,
14
15
  DeleteDateColumn,
@@ -40,6 +41,24 @@ __decorateClass([
40
41
  __decorateClass([
41
42
  Column({ name: "team_id", type: "int", comment: "FK teams.id" })
42
43
  ], PlayerTeam.prototype, "teamId", 2);
44
+ __decorateClass([
45
+ Column({
46
+ name: "display_name",
47
+ type: "varchar",
48
+ length: 255,
49
+ nullable: true,
50
+ comment: "Nome do membro neste time, copiado da pessoa ao entrar. NULL usa o da pessoa (users.name ou players.nickname)."
51
+ })
52
+ ], PlayerTeam.prototype, "displayName", 2);
53
+ __decorateClass([
54
+ Column({
55
+ name: "photo_url",
56
+ type: "varchar",
57
+ length: 500,
58
+ nullable: true,
59
+ comment: "Foto do membro neste time, copiada da pessoa ao entrar. NULL usa a da pessoa (users.image_url)."
60
+ })
61
+ ], PlayerTeam.prototype, "photoUrl", 2);
43
62
  __decorateClass([
44
63
  Column({
45
64
  type: "enum",
@@ -155,7 +174,8 @@ PlayerTeam = __decorateClass([
155
174
  Index("IDX_player_teams_is_admin", ["isAdmin"]),
156
175
  Index("IDX_player_teams_deleted_at", ["deletedAt"]),
157
176
  Index("IDX_player_teams_created_by_organization", ["createdByOrganizationId"]),
158
- Index("IDX_player_teams_player_deleted", ["playerId", "deletedAt"])
177
+ Index("IDX_player_teams_player_deleted", ["playerId", "deletedAt"]),
178
+ Check("CHK_player_teams_display_name", `"display_name" IS NULL OR btrim("display_name") <> ''`)
159
179
  ], PlayerTeam);
160
180
  export {
161
181
  PlayerTeam
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@natrave/shared-entities",
3
- "version": "8.46.0",
3
+ "version": "8.48.0",
4
4
  "description": "Entidades compartilhadass da NaTrave",
5
5
  "module": "dist/index.js",
6
6
  "main": "dist/index.js",
@@ -27,6 +27,7 @@
27
27
  "devDependencies": {
28
28
  "@changesets/cli": "^2.29.8",
29
29
  "@eslint/js": "^10.0.1",
30
+ "@types/pg": "8.11.10",
30
31
  "@typescript-eslint/eslint-plugin": "^8.55.0",
31
32
  "@typescript-eslint/parser": "^8.55.0",
32
33
  "esbuild": "^0.27.3",
@@ -38,6 +39,7 @@
38
39
  "glob": "^13.0.2",
39
40
  "husky": "^9.1.7",
40
41
  "lint-staged": "^16.2.7",
42
+ "pg": "8.13.1",
41
43
  "prettier": "^3.8.1",
42
44
  "ts-node": "^10.9.2",
43
45
  "typescript": "5.8.2"
@@ -58,6 +60,7 @@
58
60
  "clean": "rm -rf dist",
59
61
  "lint": "eslint src --ext .ts",
60
62
  "check:types": "tsc --noEmit",
61
- "watch": "tsc --watch"
63
+ "watch": "tsc --watch",
64
+ "test:db": "pnpm build && node --test 'tests/**/*.test.mjs'"
62
65
  }
63
66
  }