@natrave/shared-entities 9.14.0 → 9.15.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 (76) hide show
  1. package/dist/database-entities/index.d.ts +2 -1
  2. package/dist/database-entities/index.d.ts.map +1 -1
  3. package/dist/database-entities/index.js +18 -1
  4. package/dist/finance/enums/finance-subject-type.enum.d.ts +2 -1
  5. package/dist/finance/enums/finance-subject-type.enum.d.ts.map +1 -1
  6. package/dist/finance/enums/finance-subject-type.enum.js +1 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1 -0
  10. package/dist/sponsorship/audit-events/index.d.ts +2 -0
  11. package/dist/sponsorship/audit-events/index.d.ts.map +1 -0
  12. package/dist/sponsorship/audit-events/index.js +4 -0
  13. package/dist/sponsorship/audit-events/sponsorship-audit-event.entity.d.ts +16 -0
  14. package/dist/sponsorship/audit-events/sponsorship-audit-event.entity.d.ts.map +1 -0
  15. package/dist/sponsorship/audit-events/sponsorship-audit-event.entity.js +112 -0
  16. package/dist/sponsorship/brand-identities/brand-identity.entity.d.ts +17 -0
  17. package/dist/sponsorship/brand-identities/brand-identity.entity.d.ts.map +1 -0
  18. package/dist/sponsorship/brand-identities/brand-identity.entity.js +133 -0
  19. package/dist/sponsorship/brand-identities/index.d.ts +2 -0
  20. package/dist/sponsorship/brand-identities/index.d.ts.map +1 -0
  21. package/dist/sponsorship/brand-identities/index.js +4 -0
  22. package/dist/sponsorship/brands/brand.entity.d.ts +26 -0
  23. package/dist/sponsorship/brands/brand.entity.d.ts.map +1 -0
  24. package/dist/sponsorship/brands/brand.entity.js +194 -0
  25. package/dist/sponsorship/brands/index.d.ts +2 -0
  26. package/dist/sponsorship/brands/index.d.ts.map +1 -0
  27. package/dist/sponsorship/brands/index.js +4 -0
  28. package/dist/sponsorship/constants/index.d.ts +6 -0
  29. package/dist/sponsorship/constants/index.d.ts.map +1 -0
  30. package/dist/sponsorship/constants/index.js +14 -0
  31. package/dist/sponsorship/constants/sponsor-exposure-event-type.d.ts +14 -0
  32. package/dist/sponsorship/constants/sponsor-exposure-event-type.d.ts.map +1 -0
  33. package/dist/sponsorship/constants/sponsor-exposure-event-type.js +22 -0
  34. package/dist/sponsorship/constants/sponsorship-audit.d.ts +21 -0
  35. package/dist/sponsorship/constants/sponsorship-audit.d.ts.map +1 -0
  36. package/dist/sponsorship/constants/sponsorship-audit.js +30 -0
  37. package/dist/sponsorship/constants/sponsorship-brand-identity-status.d.ts +6 -0
  38. package/dist/sponsorship/constants/sponsorship-brand-identity-status.d.ts.map +1 -0
  39. package/dist/sponsorship/constants/sponsorship-brand-identity-status.js +9 -0
  40. package/dist/sponsorship/constants/sponsorship-logo-mime-type.d.ts +7 -0
  41. package/dist/sponsorship/constants/sponsorship-logo-mime-type.d.ts.map +1 -0
  42. package/dist/sponsorship/constants/sponsorship-logo-mime-type.js +8 -0
  43. package/dist/sponsorship/constants/sponsorship-segment-policy.d.ts +7 -0
  44. package/dist/sponsorship/constants/sponsorship-segment-policy.d.ts.map +1 -0
  45. package/dist/sponsorship/constants/sponsorship-segment-policy.js +11 -0
  46. package/dist/sponsorship/exposure-events/index.d.ts +2 -0
  47. package/dist/sponsorship/exposure-events/index.d.ts.map +1 -0
  48. package/dist/sponsorship/exposure-events/index.js +4 -0
  49. package/dist/sponsorship/exposure-events/sponsor-exposure-event.entity.d.ts +13 -0
  50. package/dist/sponsorship/exposure-events/sponsor-exposure-event.entity.d.ts.map +1 -0
  51. package/dist/sponsorship/exposure-events/sponsor-exposure-event.entity.js +99 -0
  52. package/dist/sponsorship/index.d.ts +9 -0
  53. package/dist/sponsorship/index.d.ts.map +1 -0
  54. package/dist/sponsorship/index.js +8 -0
  55. package/dist/sponsorship/segments/index.d.ts +2 -0
  56. package/dist/sponsorship/segments/index.d.ts.map +1 -0
  57. package/dist/sponsorship/segments/index.js +4 -0
  58. package/dist/sponsorship/segments/segment.entity.d.ts +9 -0
  59. package/dist/sponsorship/segments/segment.entity.d.ts.map +1 -0
  60. package/dist/sponsorship/segments/segment.entity.js +52 -0
  61. package/dist/sponsorship/settings/index.d.ts +2 -0
  62. package/dist/sponsorship/settings/index.d.ts.map +1 -0
  63. package/dist/sponsorship/settings/index.js +4 -0
  64. package/dist/sponsorship/settings/settings.entity.d.ts +9 -0
  65. package/dist/sponsorship/settings/settings.entity.d.ts.map +1 -0
  66. package/dist/sponsorship/settings/settings.entity.js +65 -0
  67. package/dist/sponsorship/sponsors/index.d.ts +2 -0
  68. package/dist/sponsorship/sponsors/index.d.ts.map +1 -0
  69. package/dist/sponsorship/sponsors/index.js +4 -0
  70. package/dist/sponsorship/sponsors/sponsor.entity.d.ts +16 -0
  71. package/dist/sponsorship/sponsors/sponsor.entity.d.ts.map +1 -0
  72. package/dist/sponsorship/sponsors/sponsor.entity.js +126 -0
  73. package/dist/sponsorship/sponsorship-check.helper.d.ts +2 -0
  74. package/dist/sponsorship/sponsorship-check.helper.d.ts.map +1 -0
  75. package/dist/sponsorship/sponsorship-check.helper.js +8 -0
  76. package/package.json +1 -1
@@ -0,0 +1,194 @@
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 {
12
+ Check,
13
+ Column,
14
+ CreateDateColumn,
15
+ DeleteDateColumn,
16
+ Entity,
17
+ Index,
18
+ JoinColumn,
19
+ ManyToOne,
20
+ PrimaryGeneratedColumn,
21
+ UpdateDateColumn
22
+ } from "typeorm";
23
+ import { BrandIdentity } from "../brand-identities/brand-identity.entity.js";
24
+ import { SponsorshipLogoMimeType } from "../constants/index.js";
25
+ import { Segment } from "../segments/segment.entity.js";
26
+ import { enumCheck } from "../sponsorship-check.helper.js";
27
+ let Brand = class {
28
+ };
29
+ __decorateClass([
30
+ PrimaryGeneratedColumn("uuid", {
31
+ primaryKeyConstraintName: "PK_sponsorship_brands",
32
+ comment: "Identificador da marca (uuid). Sai para o app."
33
+ })
34
+ ], Brand.prototype, "id", 2);
35
+ __decorateClass([
36
+ Column({
37
+ name: "organization_id",
38
+ type: "int",
39
+ comment: "Organiza\xE7\xE3o dona da marca. Sem FK (outro contexto)."
40
+ })
41
+ ], Brand.prototype, "organizationId", 2);
42
+ __decorateClass([
43
+ Column({
44
+ name: "identity_id",
45
+ type: "uuid",
46
+ nullable: true,
47
+ comment: 'FK brand_identities.id. Liga \xE0 identidade global ("\xC9 a mesma" no cadastro ou "Juntar" no back-office).'
48
+ })
49
+ ], Brand.prototype, "identityId", 2);
50
+ __decorateClass([
51
+ Column({ type: "varchar", length: 40, comment: "Nome da marca. 40 \xE9 o limite da tela." })
52
+ ], Brand.prototype, "name", 2);
53
+ __decorateClass([
54
+ Column({
55
+ name: "normalized_name",
56
+ type: "varchar",
57
+ length: 40,
58
+ comment: "Nome em min\xFAsculo, sem acento, s\xF3 letras e n\xFAmeros. Busca e sugest\xE3o."
59
+ })
60
+ ], Brand.prototype, "normalizedName", 2);
61
+ __decorateClass([
62
+ Column({
63
+ name: "segment_key",
64
+ type: "varchar",
65
+ length: 32,
66
+ nullable: true,
67
+ comment: "FK segments.key. Segmento da marca. Opcional no cadastro."
68
+ })
69
+ ], Brand.prototype, "segmentKey", 2);
70
+ __decorateClass([
71
+ Column({
72
+ name: "instagram_handle",
73
+ type: "varchar",
74
+ length: 30,
75
+ nullable: true,
76
+ comment: 'Instagram sem "@", min\xFAsculo, s\xF3 [a-z0-9._].'
77
+ })
78
+ ], Brand.prototype, "instagramHandle", 2);
79
+ __decorateClass([
80
+ Column({
81
+ name: "whatsapp_e164",
82
+ type: "varchar",
83
+ length: 16,
84
+ nullable: true,
85
+ comment: "WhatsApp em E.164. Privado da organiza\xE7\xE3o: n\xE3o sai para o app."
86
+ })
87
+ ], Brand.prototype, "whatsappE164", 2);
88
+ __decorateClass([
89
+ Column({
90
+ type: "varchar",
91
+ length: 255,
92
+ nullable: true,
93
+ comment: "Site da marca, gravado com https://."
94
+ })
95
+ ], Brand.prototype, "website", 2);
96
+ __decorateClass([
97
+ Column({
98
+ name: "logo_storage_key",
99
+ type: "text",
100
+ nullable: true,
101
+ comment: "Chave da logo no S3, nunca URL. Nulo = sem logo (a faixa usa o nome em texto)."
102
+ })
103
+ ], Brand.prototype, "logoStorageKey", 2);
104
+ __decorateClass([
105
+ Column({
106
+ name: "logo_content_hash",
107
+ type: "char",
108
+ length: 64,
109
+ nullable: true,
110
+ comment: "sha256 do arquivo final da logo. Preenchido se e s\xF3 se logo_storage_key preenchido."
111
+ })
112
+ ], Brand.prototype, "logoContentHash", 2);
113
+ __decorateClass([
114
+ Column({
115
+ name: "logo_mime_type",
116
+ type: "varchar",
117
+ length: 32,
118
+ nullable: true,
119
+ comment: "image/png, image/jpeg ou image/webp. SVG \xE9 convertido em PNG no upload."
120
+ })
121
+ ], Brand.prototype, "logoMimeType", 2);
122
+ __decorateClass([
123
+ Column({
124
+ name: "logo_width_px",
125
+ type: "integer",
126
+ nullable: true,
127
+ comment: "Largura da logo em pixels. D\xE1 a propor\xE7\xE3o para a faixa."
128
+ })
129
+ ], Brand.prototype, "logoWidthPx", 2);
130
+ __decorateClass([
131
+ Column({
132
+ name: "logo_height_px",
133
+ type: "integer",
134
+ nullable: true,
135
+ comment: "Altura da logo em pixels. D\xE1 a propor\xE7\xE3o para a faixa."
136
+ })
137
+ ], Brand.prototype, "logoHeightPx", 2);
138
+ __decorateClass([
139
+ Column({
140
+ name: "created_by_org_user_id",
141
+ type: "int",
142
+ nullable: true,
143
+ comment: "organization_users.id de quem cadastrou. Sem FK."
144
+ })
145
+ ], Brand.prototype, "createdByOrgUserId", 2);
146
+ __decorateClass([
147
+ CreateDateColumn({
148
+ name: "created_at",
149
+ type: "timestamptz",
150
+ default: () => "now()",
151
+ comment: "Cria\xE7\xE3o."
152
+ })
153
+ ], Brand.prototype, "createdAt", 2);
154
+ __decorateClass([
155
+ UpdateDateColumn({
156
+ name: "updated_at",
157
+ type: "timestamptz",
158
+ default: () => "now()",
159
+ comment: "\xDAltima altera\xE7\xE3o."
160
+ })
161
+ ], Brand.prototype, "updatedAt", 2);
162
+ __decorateClass([
163
+ DeleteDateColumn({
164
+ name: "deleted_at",
165
+ type: "timestamptz",
166
+ nullable: true,
167
+ comment: "Exclus\xE3o l\xF3gica."
168
+ })
169
+ ], Brand.prototype, "deletedAt", 2);
170
+ __decorateClass([
171
+ ManyToOne(() => BrandIdentity, { onDelete: "SET NULL" }),
172
+ JoinColumn({ name: "identity_id", foreignKeyConstraintName: "FK_sponsorship_brands_identity" })
173
+ ], Brand.prototype, "identity", 2);
174
+ __decorateClass([
175
+ ManyToOne(() => Segment, { onDelete: "NO ACTION" }),
176
+ JoinColumn({ name: "segment_key", foreignKeyConstraintName: "FK_sponsorship_brands_segment" })
177
+ ], Brand.prototype, "segment", 2);
178
+ Brand = __decorateClass([
179
+ Entity({ schema: "sponsorship", name: "brands" }),
180
+ Check(
181
+ "CHK_sponsorship_brands_logo_mime_type",
182
+ enumCheck("logo_mime_type", Object.values(SponsorshipLogoMimeType), true)
183
+ ),
184
+ Check(
185
+ "CHK_sponsorship_brands_logo_hash_pair",
186
+ '("logo_storage_key" IS NULL) = ("logo_content_hash" IS NULL)'
187
+ ),
188
+ Index("IDX_brands_org_name", ["organizationId", "normalizedName"]),
189
+ Index("IDX_brands_identity", ["identityId"]),
190
+ Index("IDX_brands_org_instagram", ["organizationId", "instagramHandle"])
191
+ ], Brand);
192
+ export {
193
+ Brand
194
+ };
@@ -0,0 +1,2 @@
1
+ export { Brand } from './brand.entity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/brands/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Brand } from "./brand.entity.js";
2
+ export {
3
+ Brand
4
+ };
@@ -0,0 +1,6 @@
1
+ export { SponsorExposureActorKind, SponsorExposureEventType } from './sponsor-exposure-event-type';
2
+ export { SponsorshipActorKind, SponsorshipAuditAction } from './sponsorship-audit';
3
+ export { SponsorshipBrandIdentityStatus } from './sponsorship-brand-identity-status';
4
+ export { SponsorshipLogoMimeType } from './sponsorship-logo-mime-type';
5
+ export { SponsorshipSegmentPolicy } from './sponsorship-segment-policy';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/constants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AACrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { SponsorExposureActorKind, SponsorExposureEventType } from "./sponsor-exposure-event-type.js";
2
+ import { SponsorshipActorKind, SponsorshipAuditAction } from "./sponsorship-audit.js";
3
+ import { SponsorshipBrandIdentityStatus } from "./sponsorship-brand-identity-status.js";
4
+ import { SponsorshipLogoMimeType } from "./sponsorship-logo-mime-type.js";
5
+ import { SponsorshipSegmentPolicy } from "./sponsorship-segment-policy.js";
6
+ export {
7
+ SponsorExposureActorKind,
8
+ SponsorExposureEventType,
9
+ SponsorshipActorKind,
10
+ SponsorshipAuditAction,
11
+ SponsorshipBrandIdentityStatus,
12
+ SponsorshipLogoMimeType,
13
+ SponsorshipSegmentPolicy
14
+ };
@@ -0,0 +1,14 @@
1
+ export declare const SponsorExposureEventType: {
2
+ readonly ART_RENDERED: "ART_RENDERED";
3
+ readonly ART_SHARED: "ART_SHARED";
4
+ readonly ART_DOWNLOADED: "ART_DOWNLOADED";
5
+ readonly FEED_ART_PUBLISHED: "FEED_ART_PUBLISHED";
6
+ };
7
+ export type SponsorExposureEventType = (typeof SponsorExposureEventType)[keyof typeof SponsorExposureEventType];
8
+ export declare const SponsorExposureActorKind: {
9
+ readonly ORGANIZER: "organizer";
10
+ readonly APP_USER: "app_user";
11
+ readonly SYSTEM: "system";
12
+ };
13
+ export type SponsorExposureActorKind = (typeof SponsorExposureActorKind)[keyof typeof SponsorExposureActorKind];
14
+ //# sourceMappingURL=sponsor-exposure-event-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsor-exposure-event-type.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/constants/sponsor-exposure-event-type.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,wBAAwB;;;;;CAS3B,CAAC;AAGX,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC;AAO3E,eAAO,MAAM,wBAAwB;;;;CAO3B,CAAC;AAGX,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ const SponsorExposureEventType = {
2
+ /** A arte com a faixa de patrocinadores foi gerada. */
3
+ ART_RENDERED: "ART_RENDERED",
4
+ /** A arte foi compartilhada. */
5
+ ART_SHARED: "ART_SHARED",
6
+ /** A arte foi baixada. */
7
+ ART_DOWNLOADED: "ART_DOWNLOADED",
8
+ /** A arte foi publicada no feed. */
9
+ FEED_ART_PUBLISHED: "FEED_ART_PUBLISHED"
10
+ };
11
+ const SponsorExposureActorKind = {
12
+ /** O organizador, pela Central. */
13
+ ORGANIZER: "organizer",
14
+ /** Uma pessoa no app (compartilhamento de arte). */
15
+ APP_USER: "app_user",
16
+ /** O sistema (ex.: publicação automática no feed). */
17
+ SYSTEM: "system"
18
+ };
19
+ export {
20
+ SponsorExposureActorKind,
21
+ SponsorExposureEventType
22
+ };
@@ -0,0 +1,21 @@
1
+ export declare const SponsorshipAuditAction: {
2
+ readonly SPONSOR_CREATED: "SPONSOR_CREATED";
3
+ readonly SPONSOR_UPDATED: "SPONSOR_UPDATED";
4
+ readonly SPONSOR_REMOVED: "SPONSOR_REMOVED";
5
+ readonly REORDERED: "REORDERED";
6
+ readonly MASTER_SWAPPED: "MASTER_SWAPPED";
7
+ readonly MASTER_REMOVED: "MASTER_REMOVED";
8
+ readonly LOGO_CHANGED: "LOGO_CHANGED";
9
+ readonly LOGO_REMOVED: "LOGO_REMOVED";
10
+ readonly BRAND_IDENTITY_MERGED: "BRAND_IDENTITY_MERGED";
11
+ readonly BRAND_IDENTITY_UPDATED: "BRAND_IDENTITY_UPDATED";
12
+ };
13
+ export type SponsorshipAuditAction = (typeof SponsorshipAuditAction)[keyof typeof SponsorshipAuditAction];
14
+ export declare const SponsorshipActorKind: {
15
+ readonly ORGANIZER: "organizer";
16
+ readonly BACKOFFICE: "backoffice";
17
+ readonly SYSTEM: "system";
18
+ readonly PUBLIC: "public";
19
+ };
20
+ export type SponsorshipActorKind = (typeof SponsorshipActorKind)[keyof typeof SponsorshipActorKind];
21
+ //# sourceMappingURL=sponsorship-audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsorship-audit.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/constants/sponsorship-audit.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,sBAAsB;;;;;;;;;;;CAezB,CAAC;AAGX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,OAAO,sBAAsB,CAAC,CAAC;AAOvE,eAAO,MAAM,oBAAoB;;;;;CASvB,CAAC;AAGX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,30 @@
1
+ const SponsorshipAuditAction = {
2
+ SPONSOR_CREATED: "SPONSOR_CREATED",
3
+ SPONSOR_UPDATED: "SPONSOR_UPDATED",
4
+ SPONSOR_REMOVED: "SPONSOR_REMOVED",
5
+ /** A ordem dos patrocinadores do campeonato foi regravada. */
6
+ REORDERED: "REORDERED",
7
+ /** Um patrocinador virou master e o master antigo voltou a patrocinador. */
8
+ MASTER_SWAPPED: "MASTER_SWAPPED",
9
+ /** O master deixou de ser master e o campeonato ficou sem master. */
10
+ MASTER_REMOVED: "MASTER_REMOVED",
11
+ LOGO_CHANGED: "LOGO_CHANGED",
12
+ LOGO_REMOVED: "LOGO_REMOVED",
13
+ /** Back-office juntou duas identidades de marca. */
14
+ BRAND_IDENTITY_MERGED: "BRAND_IDENTITY_MERGED",
15
+ BRAND_IDENTITY_UPDATED: "BRAND_IDENTITY_UPDATED"
16
+ };
17
+ const SponsorshipActorKind = {
18
+ /** O organizador, pela Central. */
19
+ ORGANIZER: "organizer",
20
+ /** A equipe NaTrave, pelo back-office. */
21
+ BACKOFFICE: "backoffice",
22
+ /** O sistema (rotina, sincronização). */
23
+ SYSTEM: "system",
24
+ /** Pessoa sem login (reservado; a v1 não grava este valor). */
25
+ PUBLIC: "public"
26
+ };
27
+ export {
28
+ SponsorshipActorKind,
29
+ SponsorshipAuditAction
30
+ };
@@ -0,0 +1,6 @@
1
+ export declare const SponsorshipBrandIdentityStatus: {
2
+ readonly ACTIVE: "active";
3
+ readonly MERGED: "merged";
4
+ };
5
+ export type SponsorshipBrandIdentityStatus = (typeof SponsorshipBrandIdentityStatus)[keyof typeof SponsorshipBrandIdentityStatus];
6
+ //# sourceMappingURL=sponsorship-brand-identity-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsorship-brand-identity-status.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/constants/sponsorship-brand-identity-status.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,8BAA8B;;;CAKjC,CAAC;AAGX,MAAM,MAAM,8BAA8B,GACxC,CAAC,OAAO,8BAA8B,CAAC,CAAC,MAAM,OAAO,8BAA8B,CAAC,CAAC"}
@@ -0,0 +1,9 @@
1
+ const SponsorshipBrandIdentityStatus = {
2
+ /** Identidade em uso. */
3
+ ACTIVE: "active",
4
+ /** Absorvida por outra no "Juntar" do back-office (`merged_into_id` aponta a que ficou). */
5
+ MERGED: "merged"
6
+ };
7
+ export {
8
+ SponsorshipBrandIdentityStatus
9
+ };
@@ -0,0 +1,7 @@
1
+ export declare const SponsorshipLogoMimeType: {
2
+ readonly PNG: "image/png";
3
+ readonly JPEG: "image/jpeg";
4
+ readonly WEBP: "image/webp";
5
+ };
6
+ export type SponsorshipLogoMimeType = (typeof SponsorshipLogoMimeType)[keyof typeof SponsorshipLogoMimeType];
7
+ //# sourceMappingURL=sponsorship-logo-mime-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsorship-logo-mime-type.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/constants/sponsorship-logo-mime-type.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,uBAAuB;;;;CAI1B,CAAC;AAGX,MAAM,MAAM,uBAAuB,GACjC,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,OAAO,uBAAuB,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ const SponsorshipLogoMimeType = {
2
+ PNG: "image/png",
3
+ JPEG: "image/jpeg",
4
+ WEBP: "image/webp"
5
+ };
6
+ export {
7
+ SponsorshipLogoMimeType
8
+ };
@@ -0,0 +1,7 @@
1
+ export declare const SponsorshipSegmentPolicy: {
2
+ readonly ALLOWED: "allowed";
3
+ readonly ADULT_ONLY: "adult_only";
4
+ readonly BLOCKED: "blocked";
5
+ };
6
+ export type SponsorshipSegmentPolicy = (typeof SponsorshipSegmentPolicy)[keyof typeof SponsorshipSegmentPolicy];
7
+ //# sourceMappingURL=sponsorship-segment-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsorship-segment-policy.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/constants/sponsorship-segment-policy.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,wBAAwB;;;;CAO3B,CAAC;AAGX,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ const SponsorshipSegmentPolicy = {
2
+ /** Pode aparecer em qualquer categoria. */
3
+ ALLOWED: "allowed",
4
+ /** Só categoria adulta: não sai em arte nem no app de categoria de base (ex.: bebida alcoólica). */
5
+ ADULT_ONLY: "adult_only",
6
+ /** Não pode ser cadastrado (ex.: apostas, MP 1.394/2026). */
7
+ BLOCKED: "blocked"
8
+ };
9
+ export {
10
+ SponsorshipSegmentPolicy
11
+ };
@@ -0,0 +1,2 @@
1
+ export { SponsorExposureEvent } from './sponsor-exposure-event.entity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/exposure-events/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { SponsorExposureEvent } from "./sponsor-exposure-event.entity.js";
2
+ export {
3
+ SponsorExposureEvent
4
+ };
@@ -0,0 +1,13 @@
1
+ import { SponsorExposureActorKind, SponsorExposureEventType } from '../constants';
2
+ export declare class SponsorExposureEvent {
3
+ id: string;
4
+ occurredAt: Date;
5
+ categoryGroupId: number;
6
+ tournamentId: number | null;
7
+ sponsorId: string | null;
8
+ type: SponsorExposureEventType;
9
+ actorKind: SponsorExposureActorKind;
10
+ userId: string | null;
11
+ metadata: Record<string, unknown> | null;
12
+ }
13
+ //# sourceMappingURL=sponsor-exposure-event.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sponsor-exposure-event.entity.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/exposure-events/sponsor-exposure-event.entity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAgBlF,qBAWa,oBAAoB;IAM/B,EAAE,EAAE,MAAM,CAAC;IAQX,UAAU,EAAE,IAAI,CAAC;IAOjB,eAAe,EAAE,MAAM,CAAC;IAQxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAOzB,IAAI,EAAE,wBAAwB,CAAC;IAQ/B,SAAS,EAAE,wBAAwB,CAAC;IAQpC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAOtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC1C"}
@@ -0,0 +1,99 @@
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 { Check, Column, Entity, Index, PrimaryGeneratedColumn } from "typeorm";
12
+ import { SponsorExposureActorKind, SponsorExposureEventType } from "../constants/index.js";
13
+ import { enumCheck } from "../sponsorship-check.helper.js";
14
+ let SponsorExposureEvent = class {
15
+ };
16
+ __decorateClass([
17
+ PrimaryGeneratedColumn("identity", {
18
+ type: "bigint",
19
+ primaryKeyConstraintName: "PK_sponsorship_exposure_events",
20
+ comment: "Identificador sequencial do evento."
21
+ })
22
+ ], SponsorExposureEvent.prototype, "id", 2);
23
+ __decorateClass([
24
+ Column({
25
+ name: "occurred_at",
26
+ type: "timestamptz",
27
+ default: () => "now()",
28
+ comment: "Quando o evento aconteceu."
29
+ })
30
+ ], SponsorExposureEvent.prototype, "occurredAt", 2);
31
+ __decorateClass([
32
+ Column({
33
+ name: "category_group_id",
34
+ type: "int",
35
+ comment: "Campeonato da arte. Sem FK."
36
+ })
37
+ ], SponsorExposureEvent.prototype, "categoryGroupId", 2);
38
+ __decorateClass([
39
+ Column({
40
+ name: "tournament_id",
41
+ type: "int",
42
+ nullable: true,
43
+ comment: "Categoria (tournaments.id) da arte, quando houver. Sem FK."
44
+ })
45
+ ], SponsorExposureEvent.prototype, "tournamentId", 2);
46
+ __decorateClass([
47
+ Column({
48
+ name: "sponsor_id",
49
+ type: "uuid",
50
+ nullable: true,
51
+ comment: "sponsors.id do patrocinador exposto. Sem FK (inser\xE7\xE3o barata)."
52
+ })
53
+ ], SponsorExposureEvent.prototype, "sponsorId", 2);
54
+ __decorateClass([
55
+ Column({
56
+ type: "varchar",
57
+ length: 32,
58
+ comment: "ART_RENDERED, ART_SHARED, ART_DOWNLOADED ou FEED_ART_PUBLISHED."
59
+ })
60
+ ], SponsorExposureEvent.prototype, "type", 2);
61
+ __decorateClass([
62
+ Column({
63
+ name: "actor_kind",
64
+ type: "varchar",
65
+ length: 16,
66
+ comment: "Quem causou: organizer, app_user (compartilhamento do app) ou system."
67
+ })
68
+ ], SponsorExposureEvent.prototype, "actorKind", 2);
69
+ __decorateClass([
70
+ Column({
71
+ name: "user_id",
72
+ type: "uuid",
73
+ nullable: true,
74
+ comment: "users.id de quem compartilhou, sem FK. Anulado na exclus\xE3o de conta (anonimiza\xE7\xE3o)."
75
+ })
76
+ ], SponsorExposureEvent.prototype, "userId", 2);
77
+ __decorateClass([
78
+ Column({
79
+ type: "jsonb",
80
+ nullable: true,
81
+ comment: "Contexto da arte: fam\xEDlia, formato e tema."
82
+ })
83
+ ], SponsorExposureEvent.prototype, "metadata", 2);
84
+ SponsorExposureEvent = __decorateClass([
85
+ Entity({ schema: "sponsorship", name: "exposure_events" }),
86
+ Check(
87
+ "CHK_sponsorship_exposure_events_type",
88
+ enumCheck("type", Object.values(SponsorExposureEventType))
89
+ ),
90
+ Check(
91
+ "CHK_sponsorship_exposure_events_actor_kind",
92
+ enumCheck("actor_kind", Object.values(SponsorExposureActorKind))
93
+ ),
94
+ Index("IDX_exposure_events_sponsor_type_time", ["sponsorId", "type", "occurredAt"]),
95
+ Index("IDX_exposure_events_championship_type_time", ["categoryGroupId", "type", "occurredAt"])
96
+ ], SponsorExposureEvent);
97
+ export {
98
+ SponsorExposureEvent
99
+ };
@@ -0,0 +1,9 @@
1
+ export * from './audit-events';
2
+ export * from './brand-identities';
3
+ export * from './brands';
4
+ export * from './constants';
5
+ export * from './exposure-events';
6
+ export * from './segments';
7
+ export * from './settings';
8
+ export * from './sponsors';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sponsorship/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ export * from "./audit-events/index.js";
2
+ export * from "./brand-identities/index.js";
3
+ export * from "./brands/index.js";
4
+ export * from "./constants/index.js";
5
+ export * from "./exposure-events/index.js";
6
+ export * from "./segments/index.js";
7
+ export * from "./settings/index.js";
8
+ export * from "./sponsors/index.js";
@@ -0,0 +1,2 @@
1
+ export { Segment } from './segment.entity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/segments/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Segment } from "./segment.entity.js";
2
+ export {
3
+ Segment
4
+ };
@@ -0,0 +1,9 @@
1
+ import { SponsorshipSegmentPolicy } from '../constants';
2
+ export declare class Segment {
3
+ key: string;
4
+ label: string;
5
+ policy: SponsorshipSegmentPolicy;
6
+ sortOrder: number;
7
+ selectable: boolean;
8
+ }
9
+ //# sourceMappingURL=segment.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"segment.entity.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/segments/segment.entity.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAcxD,qBAKa,OAAO;IAQlB,GAAG,EAAE,MAAM,CAAC;IAGZ,KAAK,EAAE,MAAM,CAAC;IAQd,MAAM,EAAE,wBAAwB,CAAC;IAGjC,SAAS,EAAE,MAAM,CAAC;IAMlB,UAAU,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,52 @@
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 { Check, Column, Entity, PrimaryColumn } from "typeorm";
12
+ import { SponsorshipSegmentPolicy } from "../constants/index.js";
13
+ import { enumCheck } from "../sponsorship-check.helper.js";
14
+ let Segment = class {
15
+ };
16
+ __decorateClass([
17
+ PrimaryColumn({
18
+ type: "varchar",
19
+ length: 32,
20
+ primaryKeyConstraintName: "PK_sponsorship_segments",
21
+ comment: "Chave do segmento em UPPER_SNAKE (ex.: SUPERMARKET, BETTING). Segmento novo \xE9 INSERT."
22
+ })
23
+ ], Segment.prototype, "key", 2);
24
+ __decorateClass([
25
+ Column({ type: "varchar", length: 40, comment: "Texto do seletor de segmento." })
26
+ ], Segment.prototype, "label", 2);
27
+ __decorateClass([
28
+ Column({
29
+ type: "varchar",
30
+ length: 16,
31
+ comment: "allowed (livre), adult_only (n\xE3o sai em categoria de base) ou blocked (n\xE3o pode cadastrar)."
32
+ })
33
+ ], Segment.prototype, "policy", 2);
34
+ __decorateClass([
35
+ Column({ name: "sort_order", type: "smallint", comment: "Ordem na lista do seletor." })
36
+ ], Segment.prototype, "sortOrder", 2);
37
+ __decorateClass([
38
+ Column({
39
+ type: "boolean",
40
+ comment: "Falso = o segmento n\xE3o aparece no seletor (ex.: BETTING, bloqueado)."
41
+ })
42
+ ], Segment.prototype, "selectable", 2);
43
+ Segment = __decorateClass([
44
+ Entity({ schema: "sponsorship", name: "segments" }),
45
+ Check(
46
+ "CHK_sponsorship_segments_policy",
47
+ enumCheck("policy", Object.values(SponsorshipSegmentPolicy))
48
+ )
49
+ ], Segment);
50
+ export {
51
+ Segment
52
+ };
@@ -0,0 +1,2 @@
1
+ export { SponsorshipSettings } from './settings.entity';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}