@natrave/shared-entities 9.14.0 → 9.16.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.
- package/dist/database-entities/index.d.ts +3 -2
- package/dist/database-entities/index.d.ts.map +1 -1
- package/dist/database-entities/index.js +22 -1
- package/dist/finance/enums/finance-subject-type.enum.d.ts +2 -1
- package/dist/finance/enums/finance-subject-type.enum.d.ts.map +1 -1
- package/dist/finance/enums/finance-subject-type.enum.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/sponsorship/audit-events/index.d.ts +2 -0
- package/dist/sponsorship/audit-events/index.d.ts.map +1 -0
- package/dist/sponsorship/audit-events/index.js +4 -0
- package/dist/sponsorship/audit-events/sponsorship-audit-event.entity.d.ts +16 -0
- package/dist/sponsorship/audit-events/sponsorship-audit-event.entity.d.ts.map +1 -0
- package/dist/sponsorship/audit-events/sponsorship-audit-event.entity.js +112 -0
- package/dist/sponsorship/brand-identities/brand-identity.entity.d.ts +17 -0
- package/dist/sponsorship/brand-identities/brand-identity.entity.d.ts.map +1 -0
- package/dist/sponsorship/brand-identities/brand-identity.entity.js +133 -0
- package/dist/sponsorship/brand-identities/index.d.ts +2 -0
- package/dist/sponsorship/brand-identities/index.d.ts.map +1 -0
- package/dist/sponsorship/brand-identities/index.js +4 -0
- package/dist/sponsorship/brands/brand.entity.d.ts +26 -0
- package/dist/sponsorship/brands/brand.entity.d.ts.map +1 -0
- package/dist/sponsorship/brands/brand.entity.js +194 -0
- package/dist/sponsorship/brands/index.d.ts +2 -0
- package/dist/sponsorship/brands/index.d.ts.map +1 -0
- package/dist/sponsorship/brands/index.js +4 -0
- package/dist/sponsorship/constants/index.d.ts +6 -0
- package/dist/sponsorship/constants/index.d.ts.map +1 -0
- package/dist/sponsorship/constants/index.js +14 -0
- package/dist/sponsorship/constants/sponsor-exposure-event-type.d.ts +14 -0
- package/dist/sponsorship/constants/sponsor-exposure-event-type.d.ts.map +1 -0
- package/dist/sponsorship/constants/sponsor-exposure-event-type.js +22 -0
- package/dist/sponsorship/constants/sponsorship-audit.d.ts +21 -0
- package/dist/sponsorship/constants/sponsorship-audit.d.ts.map +1 -0
- package/dist/sponsorship/constants/sponsorship-audit.js +30 -0
- package/dist/sponsorship/constants/sponsorship-brand-identity-status.d.ts +6 -0
- package/dist/sponsorship/constants/sponsorship-brand-identity-status.d.ts.map +1 -0
- package/dist/sponsorship/constants/sponsorship-brand-identity-status.js +9 -0
- package/dist/sponsorship/constants/sponsorship-logo-mime-type.d.ts +7 -0
- package/dist/sponsorship/constants/sponsorship-logo-mime-type.d.ts.map +1 -0
- package/dist/sponsorship/constants/sponsorship-logo-mime-type.js +8 -0
- package/dist/sponsorship/constants/sponsorship-segment-policy.d.ts +7 -0
- package/dist/sponsorship/constants/sponsorship-segment-policy.d.ts.map +1 -0
- package/dist/sponsorship/constants/sponsorship-segment-policy.js +11 -0
- package/dist/sponsorship/exposure-events/index.d.ts +2 -0
- package/dist/sponsorship/exposure-events/index.d.ts.map +1 -0
- package/dist/sponsorship/exposure-events/index.js +4 -0
- package/dist/sponsorship/exposure-events/sponsor-exposure-event.entity.d.ts +13 -0
- package/dist/sponsorship/exposure-events/sponsor-exposure-event.entity.d.ts.map +1 -0
- package/dist/sponsorship/exposure-events/sponsor-exposure-event.entity.js +99 -0
- package/dist/sponsorship/index.d.ts +9 -0
- package/dist/sponsorship/index.d.ts.map +1 -0
- package/dist/sponsorship/index.js +8 -0
- package/dist/sponsorship/segments/index.d.ts +2 -0
- package/dist/sponsorship/segments/index.d.ts.map +1 -0
- package/dist/sponsorship/segments/index.js +4 -0
- package/dist/sponsorship/segments/segment.entity.d.ts +9 -0
- package/dist/sponsorship/segments/segment.entity.d.ts.map +1 -0
- package/dist/sponsorship/segments/segment.entity.js +52 -0
- package/dist/sponsorship/settings/index.d.ts +2 -0
- package/dist/sponsorship/settings/index.d.ts.map +1 -0
- package/dist/sponsorship/settings/index.js +4 -0
- package/dist/sponsorship/settings/settings.entity.d.ts +9 -0
- package/dist/sponsorship/settings/settings.entity.d.ts.map +1 -0
- package/dist/sponsorship/settings/settings.entity.js +65 -0
- package/dist/sponsorship/sponsors/index.d.ts +2 -0
- package/dist/sponsorship/sponsors/index.d.ts.map +1 -0
- package/dist/sponsorship/sponsors/index.js +4 -0
- package/dist/sponsorship/sponsors/sponsor.entity.d.ts +16 -0
- package/dist/sponsorship/sponsors/sponsor.entity.d.ts.map +1 -0
- package/dist/sponsorship/sponsors/sponsor.entity.js +126 -0
- package/dist/sponsorship/sponsorship-check.helper.d.ts +2 -0
- package/dist/sponsorship/sponsorship-check.helper.d.ts.map +1 -0
- package/dist/sponsorship/sponsorship-check.helper.js +8 -0
- package/dist/teams/index.d.ts +1 -0
- package/dist/teams/index.d.ts.map +1 -1
- package/dist/teams/index.js +1 -0
- package/dist/teams/team-pro/enums/team-pro-store.enum.d.ts +5 -0
- package/dist/teams/team-pro/enums/team-pro-store.enum.d.ts.map +1 -0
- package/dist/teams/team-pro/enums/team-pro-store.enum.js +8 -0
- package/dist/teams/team-pro/enums/team-pro-subscription-status.enum.d.ts +8 -0
- package/dist/teams/team-pro/enums/team-pro-subscription-status.enum.d.ts.map +1 -0
- package/dist/teams/team-pro/enums/team-pro-subscription-status.enum.js +11 -0
- package/dist/teams/team-pro/index.d.ts +5 -0
- package/dist/teams/team-pro/index.d.ts.map +1 -0
- package/dist/teams/team-pro/index.js +10 -0
- package/dist/teams/team-pro/team-pro-store-event.entity.d.ts +17 -0
- package/dist/teams/team-pro/team-pro-store-event.entity.d.ts.map +1 -0
- package/dist/teams/team-pro/team-pro-store-event.entity.js +69 -0
- package/dist/teams/team-pro/team-pro-subscription.entity.d.ts +25 -0
- package/dist/teams/team-pro/team-pro-subscription.entity.d.ts.map +1 -0
- package/dist/teams/team-pro/team-pro-subscription.entity.js +99 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings.entity.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/settings/settings.entity.ts"],"names":[],"mappings":"AAcA,qBACa,mBAAmB;IAO9B,eAAe,EAAE,MAAM,CAAC;IAOxB,cAAc,EAAE,MAAM,CAAC;IAQvB,cAAc,EAAE,OAAO,CAAC;IAQxB,OAAO,EAAE,MAAM,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
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 { Column, CreateDateColumn, Entity, PrimaryColumn, UpdateDateColumn } from "typeorm";
|
|
12
|
+
let SponsorshipSettings = class {
|
|
13
|
+
};
|
|
14
|
+
__decorateClass([
|
|
15
|
+
PrimaryColumn({
|
|
16
|
+
name: "category_group_id",
|
|
17
|
+
type: "int",
|
|
18
|
+
primaryKeyConstraintName: "PK_sponsorship_settings",
|
|
19
|
+
comment: "Campeonato (tournament_category_groups.id). Uma linha por campeonato. Sem FK."
|
|
20
|
+
})
|
|
21
|
+
], SponsorshipSettings.prototype, "categoryGroupId", 2);
|
|
22
|
+
__decorateClass([
|
|
23
|
+
Column({
|
|
24
|
+
name: "organization_id",
|
|
25
|
+
type: "int",
|
|
26
|
+
comment: "Organiza\xE7\xE3o dona do campeonato. Sem FK."
|
|
27
|
+
})
|
|
28
|
+
], SponsorshipSettings.prototype, "organizationId", 2);
|
|
29
|
+
__decorateClass([
|
|
30
|
+
Column({
|
|
31
|
+
name: "art_band_default",
|
|
32
|
+
type: "boolean",
|
|
33
|
+
default: true,
|
|
34
|
+
comment: '"Adicionar patrocinadores na arte" j\xE1 vem ligado nas artes do campeonato.'
|
|
35
|
+
})
|
|
36
|
+
], SponsorshipSettings.prototype, "artBandDefault", 2);
|
|
37
|
+
__decorateClass([
|
|
38
|
+
Column({
|
|
39
|
+
type: "integer",
|
|
40
|
+
default: 1,
|
|
41
|
+
comment: "Sobe a cada mudan\xE7a de patroc\xEDnio do campeonato. Trava otimista (If-Match) e chave de cache."
|
|
42
|
+
})
|
|
43
|
+
], SponsorshipSettings.prototype, "version", 2);
|
|
44
|
+
__decorateClass([
|
|
45
|
+
CreateDateColumn({
|
|
46
|
+
name: "created_at",
|
|
47
|
+
type: "timestamptz",
|
|
48
|
+
default: () => "now()",
|
|
49
|
+
comment: "Cria\xE7\xE3o."
|
|
50
|
+
})
|
|
51
|
+
], SponsorshipSettings.prototype, "createdAt", 2);
|
|
52
|
+
__decorateClass([
|
|
53
|
+
UpdateDateColumn({
|
|
54
|
+
name: "updated_at",
|
|
55
|
+
type: "timestamptz",
|
|
56
|
+
default: () => "now()",
|
|
57
|
+
comment: "\xDAltima altera\xE7\xE3o."
|
|
58
|
+
})
|
|
59
|
+
], SponsorshipSettings.prototype, "updatedAt", 2);
|
|
60
|
+
SponsorshipSettings = __decorateClass([
|
|
61
|
+
Entity({ schema: "sponsorship", name: "settings" })
|
|
62
|
+
], SponsorshipSettings);
|
|
63
|
+
export {
|
|
64
|
+
SponsorshipSettings
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/sponsors/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Brand } from '../brands/brand.entity';
|
|
2
|
+
export declare class Sponsor {
|
|
3
|
+
id: string;
|
|
4
|
+
categoryGroupId: number;
|
|
5
|
+
organizationId: number;
|
|
6
|
+
brandId: string;
|
|
7
|
+
isMaster: boolean;
|
|
8
|
+
position: number;
|
|
9
|
+
description: string | null;
|
|
10
|
+
createdByOrgUserId: number | null;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
deletedAt: Date | null;
|
|
14
|
+
brand?: Brand;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=sponsor.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sponsor.entity.d.ts","sourceRoot":"","sources":["../../../src/sponsorship/sponsors/sponsor.entity.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAkB/C,qBAiBa,OAAO;IAKlB,EAAE,EAAE,MAAM,CAAC;IAOX,eAAe,EAAE,MAAM,CAAC;IAOxB,cAAc,EAAE,MAAM,CAAC;IAOvB,OAAO,EAAE,MAAM,CAAC;IAQhB,QAAQ,EAAE,OAAO,CAAC;IAOlB,QAAQ,EAAE,MAAM,CAAC;IAQjB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAQlC,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAIvB,KAAK,CAAC,EAAE,KAAK,CAAC;CACf"}
|
|
@@ -0,0 +1,126 @@
|
|
|
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
|
+
Column,
|
|
13
|
+
CreateDateColumn,
|
|
14
|
+
DeleteDateColumn,
|
|
15
|
+
Entity,
|
|
16
|
+
Index,
|
|
17
|
+
JoinColumn,
|
|
18
|
+
ManyToOne,
|
|
19
|
+
PrimaryGeneratedColumn,
|
|
20
|
+
UpdateDateColumn
|
|
21
|
+
} from "typeorm";
|
|
22
|
+
import { Brand } from "../brands/brand.entity.js";
|
|
23
|
+
let Sponsor = class {
|
|
24
|
+
};
|
|
25
|
+
__decorateClass([
|
|
26
|
+
PrimaryGeneratedColumn("uuid", {
|
|
27
|
+
primaryKeyConstraintName: "PK_sponsorship_sponsors",
|
|
28
|
+
comment: "Identificador do patrocinador (uuid). Sai para o app."
|
|
29
|
+
})
|
|
30
|
+
], Sponsor.prototype, "id", 2);
|
|
31
|
+
__decorateClass([
|
|
32
|
+
Column({
|
|
33
|
+
name: "category_group_id",
|
|
34
|
+
type: "int",
|
|
35
|
+
comment: "Campeonato (tournament_category_groups.id). Sem FK (outro contexto)."
|
|
36
|
+
})
|
|
37
|
+
], Sponsor.prototype, "categoryGroupId", 2);
|
|
38
|
+
__decorateClass([
|
|
39
|
+
Column({
|
|
40
|
+
name: "organization_id",
|
|
41
|
+
type: "int",
|
|
42
|
+
comment: "Organiza\xE7\xE3o dona do campeonato. Filtro de dono sem join. Sem FK."
|
|
43
|
+
})
|
|
44
|
+
], Sponsor.prototype, "organizationId", 2);
|
|
45
|
+
__decorateClass([
|
|
46
|
+
Column({
|
|
47
|
+
name: "brand_id",
|
|
48
|
+
type: "uuid",
|
|
49
|
+
comment: "FK brands.id (RESTRICT). A marca patrocinadora."
|
|
50
|
+
})
|
|
51
|
+
], Sponsor.prototype, "brandId", 2);
|
|
52
|
+
__decorateClass([
|
|
53
|
+
Column({
|
|
54
|
+
name: "is_master",
|
|
55
|
+
type: "boolean",
|
|
56
|
+
default: false,
|
|
57
|
+
comment: "Patrocinador master do campeonato. No m\xE1ximo um por campeonato."
|
|
58
|
+
})
|
|
59
|
+
], Sponsor.prototype, "isMaster", 2);
|
|
60
|
+
__decorateClass([
|
|
61
|
+
Column({
|
|
62
|
+
type: "smallint",
|
|
63
|
+
comment: "Ordem na faixa entre os n\xE3o master, de 0 a n-1. O master fica fora da contagem (sempre primeiro)."
|
|
64
|
+
})
|
|
65
|
+
], Sponsor.prototype, "position", 2);
|
|
66
|
+
__decorateClass([
|
|
67
|
+
Column({
|
|
68
|
+
type: "varchar",
|
|
69
|
+
length: 200,
|
|
70
|
+
nullable: true,
|
|
71
|
+
comment: "Texto curto da marca, mostrado na folha da marca no app."
|
|
72
|
+
})
|
|
73
|
+
], Sponsor.prototype, "description", 2);
|
|
74
|
+
__decorateClass([
|
|
75
|
+
Column({
|
|
76
|
+
name: "created_by_org_user_id",
|
|
77
|
+
type: "int",
|
|
78
|
+
nullable: true,
|
|
79
|
+
comment: "organization_users.id de quem cadastrou. Sem FK."
|
|
80
|
+
})
|
|
81
|
+
], Sponsor.prototype, "createdByOrgUserId", 2);
|
|
82
|
+
__decorateClass([
|
|
83
|
+
CreateDateColumn({
|
|
84
|
+
name: "created_at",
|
|
85
|
+
type: "timestamptz",
|
|
86
|
+
default: () => "now()",
|
|
87
|
+
comment: "Cria\xE7\xE3o."
|
|
88
|
+
})
|
|
89
|
+
], Sponsor.prototype, "createdAt", 2);
|
|
90
|
+
__decorateClass([
|
|
91
|
+
UpdateDateColumn({
|
|
92
|
+
name: "updated_at",
|
|
93
|
+
type: "timestamptz",
|
|
94
|
+
default: () => "now()",
|
|
95
|
+
comment: "\xDAltima altera\xE7\xE3o."
|
|
96
|
+
})
|
|
97
|
+
], Sponsor.prototype, "updatedAt", 2);
|
|
98
|
+
__decorateClass([
|
|
99
|
+
DeleteDateColumn({
|
|
100
|
+
name: "deleted_at",
|
|
101
|
+
type: "timestamptz",
|
|
102
|
+
nullable: true,
|
|
103
|
+
comment: "Exclus\xE3o l\xF3gica."
|
|
104
|
+
})
|
|
105
|
+
], Sponsor.prototype, "deletedAt", 2);
|
|
106
|
+
__decorateClass([
|
|
107
|
+
ManyToOne(() => Brand, { onDelete: "RESTRICT" }),
|
|
108
|
+
JoinColumn({ name: "brand_id", foreignKeyConstraintName: "FK_sponsorship_sponsors_brand" })
|
|
109
|
+
], Sponsor.prototype, "brand", 2);
|
|
110
|
+
Sponsor = __decorateClass([
|
|
111
|
+
Entity({ schema: "sponsorship", name: "sponsors" }),
|
|
112
|
+
Index("UQ_sponsors_brand_per_championship", ["categoryGroupId", "brandId"], {
|
|
113
|
+
unique: true,
|
|
114
|
+
where: '"deleted_at" IS NULL'
|
|
115
|
+
}),
|
|
116
|
+
Index("UQ_sponsors_one_master", ["categoryGroupId"], {
|
|
117
|
+
unique: true,
|
|
118
|
+
where: '"is_master" AND "deleted_at" IS NULL'
|
|
119
|
+
}),
|
|
120
|
+
Index("IDX_sponsors_championship_order", ["categoryGroupId", "isMaster", "position"], {
|
|
121
|
+
where: '"deleted_at" IS NULL'
|
|
122
|
+
})
|
|
123
|
+
], Sponsor);
|
|
124
|
+
export {
|
|
125
|
+
Sponsor
|
|
126
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sponsorship-check.helper.d.ts","sourceRoot":"","sources":["../../src/sponsorship/sponsorship-check.helper.ts"],"names":[],"mappings":"AAYA,wBAAgB,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,UAAQ,GAAG,MAAM,CAI7F"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
function enumCheck(column, values, nullable = false) {
|
|
2
|
+
const list = values.map((value) => `'${value}'`).join(", ");
|
|
3
|
+
const constraint = `"${column}" IN (${list})`;
|
|
4
|
+
return nullable ? `"${column}" IS NULL OR ${constraint}` : constraint;
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
enumCheck
|
|
8
|
+
};
|
package/dist/teams/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/teams/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/teams/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
package/dist/teams/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./team-follows/index.js";
|
|
|
6
6
|
export * from "./team-join-requests/index.js";
|
|
7
7
|
export * from "./team-kits/index.js";
|
|
8
8
|
export * from "./team-modality/index.js";
|
|
9
|
+
export * from "./team-pro/index.js";
|
|
9
10
|
export * from "./team-sponsor/index.js";
|
|
10
11
|
export * from "./team-trophy/index.js";
|
|
11
12
|
export * from "./teams/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-pro-store.enum.d.ts","sourceRoot":"","sources":["../../../../src/teams/team-pro/enums/team-pro-store.enum.ts"],"names":[],"mappings":"AACA,oBAAY,YAAY;IACtB,SAAS,cAAc;IACvB,UAAU,eAAe;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-pro-subscription-status.enum.d.ts","sourceRoot":"","sources":["../../../../src/teams/team-pro/enums/team-pro-subscription-status.enum.ts"],"names":[],"mappings":"AAKA,oBAAY,yBAAyB;IAEnC,MAAM,WAAW;IAEjB,YAAY,iBAAiB;IAE7B,OAAO,YAAY;IAEnB,OAAO,YAAY;IAEnB,OAAO,YAAY;CACpB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var TeamProSubscriptionStatus = /* @__PURE__ */ ((TeamProSubscriptionStatus2) => {
|
|
2
|
+
TeamProSubscriptionStatus2["ACTIVE"] = "active";
|
|
3
|
+
TeamProSubscriptionStatus2["GRACE_PERIOD"] = "grace_period";
|
|
4
|
+
TeamProSubscriptionStatus2["ON_HOLD"] = "on_hold";
|
|
5
|
+
TeamProSubscriptionStatus2["EXPIRED"] = "expired";
|
|
6
|
+
TeamProSubscriptionStatus2["REVOKED"] = "revoked";
|
|
7
|
+
return TeamProSubscriptionStatus2;
|
|
8
|
+
})(TeamProSubscriptionStatus || {});
|
|
9
|
+
export {
|
|
10
|
+
TeamProSubscriptionStatus
|
|
11
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { TeamProStore } from './enums/team-pro-store.enum';
|
|
2
|
+
export { TeamProSubscriptionStatus } from './enums/team-pro-subscription-status.enum';
|
|
3
|
+
export { TeamProStoreEvent } from './team-pro-store-event.entity';
|
|
4
|
+
export { TeamProSubscription } from './team-pro-subscription.entity';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/teams/team-pro/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TeamProStore } from "./enums/team-pro-store.enum.js";
|
|
2
|
+
import { TeamProSubscriptionStatus } from "./enums/team-pro-subscription-status.enum.js";
|
|
3
|
+
import { TeamProStoreEvent } from "./team-pro-store-event.entity.js";
|
|
4
|
+
import { TeamProSubscription } from "./team-pro-subscription.entity.js";
|
|
5
|
+
export {
|
|
6
|
+
TeamProStore,
|
|
7
|
+
TeamProStoreEvent,
|
|
8
|
+
TeamProSubscription,
|
|
9
|
+
TeamProSubscriptionStatus
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TeamProStore } from './enums/team-pro-store.enum';
|
|
2
|
+
import { TeamProSubscription } from './team-pro-subscription.entity';
|
|
3
|
+
export declare class TeamProStoreEvent {
|
|
4
|
+
id: number;
|
|
5
|
+
store: TeamProStore;
|
|
6
|
+
notificationId: string;
|
|
7
|
+
notificationType: string;
|
|
8
|
+
subtype: string | null;
|
|
9
|
+
storeSubscriptionId: string | null;
|
|
10
|
+
subscriptionId: number | null;
|
|
11
|
+
payload: Record<string, unknown>;
|
|
12
|
+
processedAt: Date | null;
|
|
13
|
+
error: string | null;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
subscription: TeamProSubscription | null;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=team-pro-store-event.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-pro-store-event.entity.d.ts","sourceRoot":"","sources":["../../../src/teams/team-pro/team-pro-store-event.entity.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAUrE,qBAIa,iBAAiB;IAE5B,EAAE,EAAE,MAAM,CAAC;IAGX,KAAK,EAAE,YAAY,CAAC;IAIpB,cAAc,EAAE,MAAM,CAAC;IAIvB,gBAAgB,EAAE,MAAM,CAAC;IAGzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAIvB,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IAInC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAI9B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAGjC,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IAGzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAGrB,SAAS,EAAE,IAAI,CAAC;IAKhB,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC1C"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
Entity,
|
|
16
|
+
Index,
|
|
17
|
+
JoinColumn,
|
|
18
|
+
ManyToOne,
|
|
19
|
+
PrimaryGeneratedColumn
|
|
20
|
+
} from "typeorm";
|
|
21
|
+
import { TeamProSubscription } from "./team-pro-subscription.entity.js";
|
|
22
|
+
let TeamProStoreEvent = class {
|
|
23
|
+
};
|
|
24
|
+
__decorateClass([
|
|
25
|
+
PrimaryGeneratedColumn()
|
|
26
|
+
], TeamProStoreEvent.prototype, "id", 2);
|
|
27
|
+
__decorateClass([
|
|
28
|
+
Column({ type: "varchar", length: 16 })
|
|
29
|
+
], TeamProStoreEvent.prototype, "store", 2);
|
|
30
|
+
__decorateClass([
|
|
31
|
+
Column({ name: "notification_id", type: "varchar", length: 100 })
|
|
32
|
+
], TeamProStoreEvent.prototype, "notificationId", 2);
|
|
33
|
+
__decorateClass([
|
|
34
|
+
Column({ name: "notification_type", type: "varchar", length: 60 })
|
|
35
|
+
], TeamProStoreEvent.prototype, "notificationType", 2);
|
|
36
|
+
__decorateClass([
|
|
37
|
+
Column({ type: "varchar", length: 60, nullable: true })
|
|
38
|
+
], TeamProStoreEvent.prototype, "subtype", 2);
|
|
39
|
+
__decorateClass([
|
|
40
|
+
Column({ name: "store_subscription_id", type: "text", nullable: true })
|
|
41
|
+
], TeamProStoreEvent.prototype, "storeSubscriptionId", 2);
|
|
42
|
+
__decorateClass([
|
|
43
|
+
Column({ name: "subscription_id", type: "int", nullable: true })
|
|
44
|
+
], TeamProStoreEvent.prototype, "subscriptionId", 2);
|
|
45
|
+
__decorateClass([
|
|
46
|
+
Column({ type: "jsonb" })
|
|
47
|
+
], TeamProStoreEvent.prototype, "payload", 2);
|
|
48
|
+
__decorateClass([
|
|
49
|
+
Column({ name: "processed_at", type: "timestamptz", nullable: true })
|
|
50
|
+
], TeamProStoreEvent.prototype, "processedAt", 2);
|
|
51
|
+
__decorateClass([
|
|
52
|
+
Column({ type: "text", nullable: true })
|
|
53
|
+
], TeamProStoreEvent.prototype, "error", 2);
|
|
54
|
+
__decorateClass([
|
|
55
|
+
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
56
|
+
], TeamProStoreEvent.prototype, "createdAt", 2);
|
|
57
|
+
__decorateClass([
|
|
58
|
+
ManyToOne(() => TeamProSubscription, { onDelete: "SET NULL", nullable: true }),
|
|
59
|
+
JoinColumn({ name: "subscription_id" })
|
|
60
|
+
], TeamProStoreEvent.prototype, "subscription", 2);
|
|
61
|
+
TeamProStoreEvent = __decorateClass([
|
|
62
|
+
Entity("team_pro_store_events"),
|
|
63
|
+
Index("UQ_team_pro_store_events_notification", ["store", "notificationId"], { unique: true }),
|
|
64
|
+
Index("IDX_team_pro_store_events_subscription", ["subscriptionId"]),
|
|
65
|
+
Check("CHK_team_pro_store_events_store", `"store" IN ('app_store', 'play_store')`)
|
|
66
|
+
], TeamProStoreEvent);
|
|
67
|
+
export {
|
|
68
|
+
TeamProStoreEvent
|
|
69
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { User } from '../../app-auth';
|
|
2
|
+
import { Team } from '../teams';
|
|
3
|
+
import { TeamProStore } from './enums/team-pro-store.enum';
|
|
4
|
+
import { TeamProSubscriptionStatus } from './enums/team-pro-subscription-status.enum';
|
|
5
|
+
export declare class TeamProSubscription {
|
|
6
|
+
id: number;
|
|
7
|
+
teamId: number;
|
|
8
|
+
subscriberUserId: string | null;
|
|
9
|
+
store: TeamProStore;
|
|
10
|
+
productId: string;
|
|
11
|
+
storeSubscriptionId: string;
|
|
12
|
+
latestTransactionId: string | null;
|
|
13
|
+
status: TeamProSubscriptionStatus;
|
|
14
|
+
autoRenews: boolean;
|
|
15
|
+
expiresAt: Date;
|
|
16
|
+
entitledUntil: Date;
|
|
17
|
+
revokedAt: Date | null;
|
|
18
|
+
environment: string;
|
|
19
|
+
storeUpdatedAt: Date;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
team: Team;
|
|
23
|
+
subscriber: User | null;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=team-pro-subscription.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team-pro-subscription.entity.d.ts","sourceRoot":"","sources":["../../../src/teams/team-pro/team-pro-subscription.entity.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAatF,qBAaa,mBAAmB;IAE9B,EAAE,EAAE,MAAM,CAAC;IAIX,MAAM,EAAE,MAAM,CAAC;IAIf,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAIhC,KAAK,EAAE,YAAY,CAAC;IAIpB,SAAS,EAAE,MAAM,CAAC;IAIlB,mBAAmB,EAAE,MAAM,CAAC;IAI5B,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IAGnC,MAAM,EAAE,yBAAyB,CAAC;IAIlC,UAAU,EAAE,OAAO,CAAC;IAIpB,SAAS,EAAE,IAAI,CAAC;IAIhB,aAAa,EAAE,IAAI,CAAC;IAIpB,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAIvB,WAAW,EAAE,MAAM,CAAC;IAIpB,cAAc,EAAE,IAAI,CAAC;IAIrB,SAAS,EAAE,IAAI,CAAC;IAGhB,SAAS,EAAE,IAAI,CAAC;IAKhB,IAAI,EAAE,IAAI,CAAC;IAIX,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;CACzB"}
|
|
@@ -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 {
|
|
12
|
+
Check,
|
|
13
|
+
Column,
|
|
14
|
+
CreateDateColumn,
|
|
15
|
+
Entity,
|
|
16
|
+
Index,
|
|
17
|
+
JoinColumn,
|
|
18
|
+
ManyToOne,
|
|
19
|
+
PrimaryGeneratedColumn,
|
|
20
|
+
UpdateDateColumn
|
|
21
|
+
} from "typeorm";
|
|
22
|
+
import { User } from "../../app-auth/index.js";
|
|
23
|
+
import { Team } from "../teams/index.js";
|
|
24
|
+
let TeamProSubscription = class {
|
|
25
|
+
};
|
|
26
|
+
__decorateClass([
|
|
27
|
+
PrimaryGeneratedColumn()
|
|
28
|
+
], TeamProSubscription.prototype, "id", 2);
|
|
29
|
+
__decorateClass([
|
|
30
|
+
Column({ name: "team_id", type: "int" })
|
|
31
|
+
], TeamProSubscription.prototype, "teamId", 2);
|
|
32
|
+
__decorateClass([
|
|
33
|
+
Column({ name: "subscriber_user_id", type: "uuid", nullable: true })
|
|
34
|
+
], TeamProSubscription.prototype, "subscriberUserId", 2);
|
|
35
|
+
__decorateClass([
|
|
36
|
+
Column({ type: "varchar", length: 16 })
|
|
37
|
+
], TeamProSubscription.prototype, "store", 2);
|
|
38
|
+
__decorateClass([
|
|
39
|
+
Column({ name: "product_id", type: "varchar", length: 100 })
|
|
40
|
+
], TeamProSubscription.prototype, "productId", 2);
|
|
41
|
+
__decorateClass([
|
|
42
|
+
Column({ name: "store_subscription_id", type: "text" })
|
|
43
|
+
], TeamProSubscription.prototype, "storeSubscriptionId", 2);
|
|
44
|
+
__decorateClass([
|
|
45
|
+
Column({ name: "latest_transaction_id", type: "varchar", length: 255, nullable: true })
|
|
46
|
+
], TeamProSubscription.prototype, "latestTransactionId", 2);
|
|
47
|
+
__decorateClass([
|
|
48
|
+
Column({ type: "varchar", length: 16 })
|
|
49
|
+
], TeamProSubscription.prototype, "status", 2);
|
|
50
|
+
__decorateClass([
|
|
51
|
+
Column({ name: "auto_renews", type: "boolean", default: true })
|
|
52
|
+
], TeamProSubscription.prototype, "autoRenews", 2);
|
|
53
|
+
__decorateClass([
|
|
54
|
+
Column({ name: "expires_at", type: "timestamptz" })
|
|
55
|
+
], TeamProSubscription.prototype, "expiresAt", 2);
|
|
56
|
+
__decorateClass([
|
|
57
|
+
Column({ name: "entitled_until", type: "timestamptz" })
|
|
58
|
+
], TeamProSubscription.prototype, "entitledUntil", 2);
|
|
59
|
+
__decorateClass([
|
|
60
|
+
Column({ name: "revoked_at", type: "timestamptz", nullable: true })
|
|
61
|
+
], TeamProSubscription.prototype, "revokedAt", 2);
|
|
62
|
+
__decorateClass([
|
|
63
|
+
Column({ type: "varchar", length: 20 })
|
|
64
|
+
], TeamProSubscription.prototype, "environment", 2);
|
|
65
|
+
__decorateClass([
|
|
66
|
+
Column({ name: "store_updated_at", type: "timestamptz" })
|
|
67
|
+
], TeamProSubscription.prototype, "storeUpdatedAt", 2);
|
|
68
|
+
__decorateClass([
|
|
69
|
+
CreateDateColumn({ name: "created_at", type: "timestamptz" })
|
|
70
|
+
], TeamProSubscription.prototype, "createdAt", 2);
|
|
71
|
+
__decorateClass([
|
|
72
|
+
UpdateDateColumn({ name: "updated_at", type: "timestamptz" })
|
|
73
|
+
], TeamProSubscription.prototype, "updatedAt", 2);
|
|
74
|
+
__decorateClass([
|
|
75
|
+
ManyToOne(() => Team, { onDelete: "RESTRICT" }),
|
|
76
|
+
JoinColumn({ name: "team_id" })
|
|
77
|
+
], TeamProSubscription.prototype, "team", 2);
|
|
78
|
+
__decorateClass([
|
|
79
|
+
ManyToOne(() => User, { onDelete: "SET NULL", nullable: true }),
|
|
80
|
+
JoinColumn({ name: "subscriber_user_id" })
|
|
81
|
+
], TeamProSubscription.prototype, "subscriber", 2);
|
|
82
|
+
TeamProSubscription = __decorateClass([
|
|
83
|
+
Entity("team_pro_subscriptions"),
|
|
84
|
+
Index("UQ_team_pro_subscriptions_store_subscription", ["store", "storeSubscriptionId"], {
|
|
85
|
+
unique: true
|
|
86
|
+
}),
|
|
87
|
+
Index("IDX_team_pro_subscriptions_team_entitled", ["teamId", "entitledUntil"], {
|
|
88
|
+
where: '"revoked_at" IS NULL'
|
|
89
|
+
}),
|
|
90
|
+
Index("IDX_team_pro_subscriptions_subscriber", ["subscriberUserId"]),
|
|
91
|
+
Check("CHK_team_pro_subscriptions_store", `"store" IN ('app_store', 'play_store')`),
|
|
92
|
+
Check(
|
|
93
|
+
"CHK_team_pro_subscriptions_status",
|
|
94
|
+
`"status" IN ('active', 'grace_period', 'on_hold', 'expired', 'revoked')`
|
|
95
|
+
)
|
|
96
|
+
], TeamProSubscription);
|
|
97
|
+
export {
|
|
98
|
+
TeamProSubscription
|
|
99
|
+
};
|