@natrave/shared-entities 1.6.13 → 1.6.14
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 +2 -2
- package/dist/database-entities/index.d.ts.map +1 -1
- package/dist/database-entities/index.js +2 -0
- package/dist/tournaments/index.d.ts +1 -0
- package/dist/tournaments/index.d.ts.map +1 -1
- package/dist/tournaments/index.js +1 -0
- package/dist/tournaments/regulation-extractions/index.d.ts +2 -0
- package/dist/tournaments/regulation-extractions/index.d.ts.map +1 -0
- package/dist/tournaments/regulation-extractions/index.js +4 -0
- package/dist/tournaments/regulation-extractions/regulation-extraction.entity.d.ts +33 -0
- package/dist/tournaments/regulation-extractions/regulation-extraction.entity.d.ts.map +1 -0
- package/dist/tournaments/regulation-extractions/regulation-extraction.entity.js +268 -0
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ import { Notification, NotificationDelivery, NotificationDispatchLog, PushDevice
|
|
|
8
8
|
import { Payment, PaymentProvider, UserPaymentProvider } from '../payments';
|
|
9
9
|
import { Player, PlayerPersonalData, PlayerPosition } from '../players';
|
|
10
10
|
import { PlayerTeam, Team, TeamAccessCode, TeamJoinRequest, TeamModality, TeamTrophy } from '../teams';
|
|
11
|
-
import { Tournament, TournamentAllowedPhone, TournamentBracket, TournamentBracketSlot, TournamentContact, TournamentCoupon, TournamentFacility, TournamentFollow, TournamentFormatConfig, TournamentGroup, TournamentMatch, TournamentMatchAvailability, TournamentMatchCard, TournamentMatchGoal, TournamentMatchRule, TournamentMatchSchema, TournamentPayment, TournamentPenaltyShootout, TournamentPlayer, TournamentPlayerRule, TournamentPrizeRule, TournamentPublicationChargeRule, TournamentRegistrationRequest, TournamentRegistrationRequirement, TournamentRegulationField, TournamentTeam, TournamentTeamContactAttempt } from '../tournaments';
|
|
11
|
+
import { RegulationExtraction, Tournament, TournamentAllowedPhone, TournamentBracket, TournamentBracketSlot, TournamentContact, TournamentCoupon, TournamentFacility, TournamentFollow, TournamentFormatConfig, TournamentGroup, TournamentMatch, TournamentMatchAvailability, TournamentMatchCard, TournamentMatchGoal, TournamentMatchRule, TournamentMatchSchema, TournamentPayment, TournamentPenaltyShootout, TournamentPlayer, TournamentPlayerRule, TournamentPrizeRule, TournamentPublicationChargeRule, TournamentRegistrationRequest, TournamentRegistrationRequirement, TournamentRegulationField, TournamentTeam, TournamentTeamContactAttempt } from '../tournaments';
|
|
12
12
|
import { UserDomainEvent, UserEventView } from '../user-events';
|
|
13
|
-
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 TournamentPenaltyShootout | typeof
|
|
13
|
+
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 TournamentPenaltyShootout | typeof RegulationExtraction | typeof Tournament | typeof TournamentAllowedPhone | typeof PhoneNumber | typeof TournamentContact | typeof Coupon | typeof CouponUsage | typeof TournamentCoupon | typeof FacilityImage | typeof Facility | typeof FacilityOwner | typeof Field | typeof FieldImage | typeof TournamentFacility | typeof TournamentFollow | typeof TournamentFormatConfig | typeof TournamentMatchRule | typeof TournamentMatchSchema | typeof TournamentMatchAvailability | typeof UserPaymentProvider | typeof PaymentProvider | typeof Payment | typeof TournamentPayment | typeof OrganizationUser | typeof TournamentPlayerRule | typeof TournamentPrizeRule | typeof TournamentPublicationChargeRule | typeof TournamentRegistrationRequest | typeof TournamentRegistrationRequirement | typeof TournamentRegulationField | typeof TournamentTeamContactAttempt | typeof Address | typeof OrganizationUserBillingInfo | typeof Organization | typeof TournamentGroup | typeof TournamentBracket | typeof TournamentBracketSlot | typeof TeamTrophy | typeof TournamentMatchCard | typeof TeamAccessCode | typeof TeamJoinRequest | typeof TeamModality | typeof PlayerPosition | typeof PlayerPersonalData | typeof UserAuthProvider | typeof RefreshToken | typeof UserVerification | typeof FeedActivitySubject | typeof FeedActivity | typeof FeedOutbox | typeof UserDomainEvent | typeof UserEventView)[];
|
|
14
14
|
//# 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,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpG,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,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EACL,UAAU,EACV,IAAI,EACJ,cAAc,EACd,eAAe,EACf,YAAY,EACZ,UAAU,EACX,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EAEzB,cAAc,EACd,4BAA4B,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/database-entities/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,IAAI,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpG,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,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,aAAa,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EACL,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EACL,UAAU,EACV,IAAI,EACJ,cAAc,EACd,eAAe,EACf,YAAY,EACZ,UAAU,EACX,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,2BAA2B,EAC3B,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,+BAA+B,EAC/B,6BAA6B,EAC7B,iCAAiC,EACjC,yBAAyB,EAEzB,cAAc,EACd,4BAA4B,EAC7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEhE,eAAO,MAAM,iBAAiB,yvDAsE7B,CAAC"}
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
TeamTrophy
|
|
28
28
|
} from "../teams/index.js";
|
|
29
29
|
import {
|
|
30
|
+
RegulationExtraction,
|
|
30
31
|
Tournament,
|
|
31
32
|
TournamentAllowedPhone,
|
|
32
33
|
TournamentBracket,
|
|
@@ -76,6 +77,7 @@ const DATABASE_ENTITIES = [
|
|
|
76
77
|
Payment,
|
|
77
78
|
PaymentProvider,
|
|
78
79
|
RefreshToken,
|
|
80
|
+
RegulationExtraction,
|
|
79
81
|
Tournament,
|
|
80
82
|
TournamentBracket,
|
|
81
83
|
TournamentCoupon,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tournaments/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tournaments/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,wCAAwC,CAAC;AACvD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oBAAoB,CAAC;AACnC,cAAc,oCAAoC,CAAC;AACnD,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tournaments/regulation-extractions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Tournament } from '../tournaments';
|
|
2
|
+
export declare class RegulationExtraction {
|
|
3
|
+
id: string;
|
|
4
|
+
regulationUploadId: string;
|
|
5
|
+
tournamentId: number;
|
|
6
|
+
status: 'queued' | 'running' | 'completed' | 'failed';
|
|
7
|
+
currentStep: string | null;
|
|
8
|
+
progressPercent: number;
|
|
9
|
+
tournamentContextSnapshot: Record<string, unknown> | null;
|
|
10
|
+
rawAiResponse: unknown | null;
|
|
11
|
+
structuredData: unknown | null;
|
|
12
|
+
unsupportedRules: unknown | null;
|
|
13
|
+
contradictions: unknown | null;
|
|
14
|
+
extractionMethod: 'text' | 'multimodal' | null;
|
|
15
|
+
textLength: number | null;
|
|
16
|
+
aiModel: string | null;
|
|
17
|
+
aiRequestId: string | null;
|
|
18
|
+
aiInputTokens: number | null;
|
|
19
|
+
aiOutputTokens: number | null;
|
|
20
|
+
promptCacheHitTokens: number | null;
|
|
21
|
+
aiCostUsd: string | null;
|
|
22
|
+
errorCode: string | null;
|
|
23
|
+
errorMessage: string | null;
|
|
24
|
+
retryCount: number;
|
|
25
|
+
queuedAt: Date;
|
|
26
|
+
startedAt: Date | null;
|
|
27
|
+
completedAt: Date | null;
|
|
28
|
+
reviewedAt: Date | null;
|
|
29
|
+
createdAt: Date;
|
|
30
|
+
updatedAt: Date;
|
|
31
|
+
tournament: Tournament;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=regulation-extraction.entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regulation-extraction.entity.d.ts","sourceRoot":"","sources":["../../../src/tournaments/regulation-extractions/regulation-extraction.entity.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAgB5C,qBAUa,oBAAoB;IAM/B,EAAE,EAAE,MAAM,CAAC;IAQX,kBAAkB,EAAE,MAAM,CAAC;IAO3B,YAAY,EAAE,MAAM,CAAC;IAQrB,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAC;IAStD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,eAAe,EAAE,MAAM,CAAC;IAQxB,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAQ1D,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAS9B,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAQ/B,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IAOjC,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAS/B,gBAAgB,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAAC;IAQ/C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAS1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IASvB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ7B,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ9B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IAWpC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IASzB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAQzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAQ5B,UAAU,EAAE,MAAM,CAAC;IAQnB,QAAQ,EAAE,IAAI,CAAC;IAQf,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IAQvB,WAAW,EAAE,IAAI,GAAG,IAAI,CAAC;IASzB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IAOxB,SAAS,EAAE,IAAI,CAAC;IAOhB,SAAS,EAAE,IAAI,CAAC;IAKhB,UAAU,EAAE,UAAU,CAAC;CACxB"}
|
|
@@ -0,0 +1,268 @@
|
|
|
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
|
+
JoinColumn,
|
|
17
|
+
ManyToOne,
|
|
18
|
+
PrimaryColumn,
|
|
19
|
+
UpdateDateColumn
|
|
20
|
+
} from "typeorm";
|
|
21
|
+
import { Tournament } from "../tournaments/index.js";
|
|
22
|
+
let RegulationExtraction = class {
|
|
23
|
+
};
|
|
24
|
+
__decorateClass([
|
|
25
|
+
PrimaryColumn({
|
|
26
|
+
type: "varchar",
|
|
27
|
+
length: 26,
|
|
28
|
+
comment: "Identificador \xFAnico da extra\xE7\xE3o (ULID gerado pela aplica\xE7\xE3o)."
|
|
29
|
+
})
|
|
30
|
+
], RegulationExtraction.prototype, "id", 2);
|
|
31
|
+
__decorateClass([
|
|
32
|
+
Column({
|
|
33
|
+
name: "regulation_upload_id",
|
|
34
|
+
type: "varchar",
|
|
35
|
+
length: 26,
|
|
36
|
+
comment: "ID do upload de regulamento que originou esta extra\xE7\xE3o (FK regulation_uploads.id)."
|
|
37
|
+
})
|
|
38
|
+
], RegulationExtraction.prototype, "regulationUploadId", 2);
|
|
39
|
+
__decorateClass([
|
|
40
|
+
Column({
|
|
41
|
+
name: "tournament_id",
|
|
42
|
+
type: "int",
|
|
43
|
+
comment: "ID do torneio ao qual a extra\xE7\xE3o pertence."
|
|
44
|
+
})
|
|
45
|
+
], RegulationExtraction.prototype, "tournamentId", 2);
|
|
46
|
+
__decorateClass([
|
|
47
|
+
Column({
|
|
48
|
+
type: "varchar",
|
|
49
|
+
length: 20,
|
|
50
|
+
default: "queued",
|
|
51
|
+
comment: "Estado do processamento (queued, running, completed, failed)."
|
|
52
|
+
})
|
|
53
|
+
], RegulationExtraction.prototype, "status", 2);
|
|
54
|
+
__decorateClass([
|
|
55
|
+
Column({
|
|
56
|
+
name: "current_step",
|
|
57
|
+
type: "varchar",
|
|
58
|
+
length: 50,
|
|
59
|
+
nullable: true,
|
|
60
|
+
comment: "Passo atual do pipeline (livre, usado para telemetria/UX)."
|
|
61
|
+
})
|
|
62
|
+
], RegulationExtraction.prototype, "currentStep", 2);
|
|
63
|
+
__decorateClass([
|
|
64
|
+
Column({
|
|
65
|
+
name: "progress_percent",
|
|
66
|
+
type: "int",
|
|
67
|
+
default: 0,
|
|
68
|
+
comment: "Progresso do processamento (0-100)."
|
|
69
|
+
})
|
|
70
|
+
], RegulationExtraction.prototype, "progressPercent", 2);
|
|
71
|
+
__decorateClass([
|
|
72
|
+
Column({
|
|
73
|
+
name: "tournament_context_snapshot",
|
|
74
|
+
type: "jsonb",
|
|
75
|
+
nullable: true,
|
|
76
|
+
comment: "Snapshot do contexto do torneio no momento da extra\xE7\xE3o."
|
|
77
|
+
})
|
|
78
|
+
], RegulationExtraction.prototype, "tournamentContextSnapshot", 2);
|
|
79
|
+
__decorateClass([
|
|
80
|
+
Column({
|
|
81
|
+
name: "raw_ai_response",
|
|
82
|
+
type: "jsonb",
|
|
83
|
+
nullable: true,
|
|
84
|
+
comment: "Resposta crua do modelo de IA (formato varia por modelo)."
|
|
85
|
+
})
|
|
86
|
+
], RegulationExtraction.prototype, "rawAiResponse", 2);
|
|
87
|
+
__decorateClass([
|
|
88
|
+
Column({
|
|
89
|
+
name: "structured_data",
|
|
90
|
+
type: "jsonb",
|
|
91
|
+
nullable: true,
|
|
92
|
+
comment: "Regulamento estruturado extra\xEDdo. Tipagem rica \xE9 responsabilidade do tournaments-service."
|
|
93
|
+
})
|
|
94
|
+
], RegulationExtraction.prototype, "structuredData", 2);
|
|
95
|
+
__decorateClass([
|
|
96
|
+
Column({
|
|
97
|
+
name: "unsupported_rules",
|
|
98
|
+
type: "jsonb",
|
|
99
|
+
nullable: true,
|
|
100
|
+
comment: "Regras detectadas pela IA que n\xE3o s\xE3o suportadas pelo dom\xEDnio."
|
|
101
|
+
})
|
|
102
|
+
], RegulationExtraction.prototype, "unsupportedRules", 2);
|
|
103
|
+
__decorateClass([
|
|
104
|
+
Column({
|
|
105
|
+
type: "jsonb",
|
|
106
|
+
nullable: true,
|
|
107
|
+
comment: "Contradi\xE7\xF5es detectadas no regulamento."
|
|
108
|
+
})
|
|
109
|
+
], RegulationExtraction.prototype, "contradictions", 2);
|
|
110
|
+
__decorateClass([
|
|
111
|
+
Column({
|
|
112
|
+
name: "extraction_method",
|
|
113
|
+
type: "varchar",
|
|
114
|
+
length: 20,
|
|
115
|
+
nullable: true,
|
|
116
|
+
comment: "M\xE9todo de extra\xE7\xE3o utilizado (text ou multimodal)."
|
|
117
|
+
})
|
|
118
|
+
], RegulationExtraction.prototype, "extractionMethod", 2);
|
|
119
|
+
__decorateClass([
|
|
120
|
+
Column({
|
|
121
|
+
name: "text_length",
|
|
122
|
+
type: "int",
|
|
123
|
+
nullable: true,
|
|
124
|
+
comment: "Tamanho (em caracteres) do texto extra\xEDdo do PDF."
|
|
125
|
+
})
|
|
126
|
+
], RegulationExtraction.prototype, "textLength", 2);
|
|
127
|
+
__decorateClass([
|
|
128
|
+
Column({
|
|
129
|
+
name: "ai_model",
|
|
130
|
+
type: "varchar",
|
|
131
|
+
length: 100,
|
|
132
|
+
nullable: true,
|
|
133
|
+
comment: "Identificador do modelo de IA utilizado."
|
|
134
|
+
})
|
|
135
|
+
], RegulationExtraction.prototype, "aiModel", 2);
|
|
136
|
+
__decorateClass([
|
|
137
|
+
Column({
|
|
138
|
+
name: "ai_request_id",
|
|
139
|
+
type: "varchar",
|
|
140
|
+
length: 100,
|
|
141
|
+
nullable: true,
|
|
142
|
+
comment: "ID da request no provider de IA (para correla\xE7\xE3o/debug)."
|
|
143
|
+
})
|
|
144
|
+
], RegulationExtraction.prototype, "aiRequestId", 2);
|
|
145
|
+
__decorateClass([
|
|
146
|
+
Column({
|
|
147
|
+
name: "ai_input_tokens",
|
|
148
|
+
type: "int",
|
|
149
|
+
nullable: true,
|
|
150
|
+
comment: "Tokens de input consumidos na chamada de IA."
|
|
151
|
+
})
|
|
152
|
+
], RegulationExtraction.prototype, "aiInputTokens", 2);
|
|
153
|
+
__decorateClass([
|
|
154
|
+
Column({
|
|
155
|
+
name: "ai_output_tokens",
|
|
156
|
+
type: "int",
|
|
157
|
+
nullable: true,
|
|
158
|
+
comment: "Tokens de output gerados pela chamada de IA."
|
|
159
|
+
})
|
|
160
|
+
], RegulationExtraction.prototype, "aiOutputTokens", 2);
|
|
161
|
+
__decorateClass([
|
|
162
|
+
Column({
|
|
163
|
+
name: "prompt_cache_hit_tokens",
|
|
164
|
+
type: "int",
|
|
165
|
+
nullable: true,
|
|
166
|
+
comment: "Tokens atendidos por cache de prompt."
|
|
167
|
+
})
|
|
168
|
+
], RegulationExtraction.prototype, "promptCacheHitTokens", 2);
|
|
169
|
+
__decorateClass([
|
|
170
|
+
Column({
|
|
171
|
+
name: "ai_cost_usd",
|
|
172
|
+
type: "decimal",
|
|
173
|
+
precision: 10,
|
|
174
|
+
scale: 6,
|
|
175
|
+
nullable: true,
|
|
176
|
+
comment: "Custo estimado da chamada de IA em USD. TypeORM retorna decimal como string para preservar precis\xE3o."
|
|
177
|
+
})
|
|
178
|
+
], RegulationExtraction.prototype, "aiCostUsd", 2);
|
|
179
|
+
__decorateClass([
|
|
180
|
+
Column({
|
|
181
|
+
name: "error_code",
|
|
182
|
+
type: "varchar",
|
|
183
|
+
length: 50,
|
|
184
|
+
nullable: true,
|
|
185
|
+
comment: "C\xF3digo do erro quando o processamento falha."
|
|
186
|
+
})
|
|
187
|
+
], RegulationExtraction.prototype, "errorCode", 2);
|
|
188
|
+
__decorateClass([
|
|
189
|
+
Column({
|
|
190
|
+
name: "error_message",
|
|
191
|
+
type: "text",
|
|
192
|
+
nullable: true,
|
|
193
|
+
comment: "Mensagem detalhada do erro quando o processamento falha."
|
|
194
|
+
})
|
|
195
|
+
], RegulationExtraction.prototype, "errorMessage", 2);
|
|
196
|
+
__decorateClass([
|
|
197
|
+
Column({
|
|
198
|
+
name: "retry_count",
|
|
199
|
+
type: "int",
|
|
200
|
+
default: 0,
|
|
201
|
+
comment: "Quantidade de retentativas executadas pelo worker."
|
|
202
|
+
})
|
|
203
|
+
], RegulationExtraction.prototype, "retryCount", 2);
|
|
204
|
+
__decorateClass([
|
|
205
|
+
Column({
|
|
206
|
+
name: "queued_at",
|
|
207
|
+
type: "timestamptz",
|
|
208
|
+
default: () => "NOW()",
|
|
209
|
+
comment: "Quando a extra\xE7\xE3o foi enfileirada no worker."
|
|
210
|
+
})
|
|
211
|
+
], RegulationExtraction.prototype, "queuedAt", 2);
|
|
212
|
+
__decorateClass([
|
|
213
|
+
Column({
|
|
214
|
+
name: "started_at",
|
|
215
|
+
type: "timestamptz",
|
|
216
|
+
nullable: true,
|
|
217
|
+
comment: "Quando o worker iniciou o processamento."
|
|
218
|
+
})
|
|
219
|
+
], RegulationExtraction.prototype, "startedAt", 2);
|
|
220
|
+
__decorateClass([
|
|
221
|
+
Column({
|
|
222
|
+
name: "completed_at",
|
|
223
|
+
type: "timestamptz",
|
|
224
|
+
nullable: true,
|
|
225
|
+
comment: "Quando o processamento foi finalizado (com sucesso ou falha)."
|
|
226
|
+
})
|
|
227
|
+
], RegulationExtraction.prototype, "completedAt", 2);
|
|
228
|
+
__decorateClass([
|
|
229
|
+
Column({
|
|
230
|
+
name: "reviewed_at",
|
|
231
|
+
type: "timestamptz",
|
|
232
|
+
nullable: true,
|
|
233
|
+
comment: 'Quando o usu\xE1rio confirmou a review da extra\xE7\xE3o (clicou "Continuar" na Tela A). One-way: setada uma vez, n\xE3o reseta. NULL = ainda n\xE3o revisada.'
|
|
234
|
+
})
|
|
235
|
+
], RegulationExtraction.prototype, "reviewedAt", 2);
|
|
236
|
+
__decorateClass([
|
|
237
|
+
CreateDateColumn({
|
|
238
|
+
name: "created_at",
|
|
239
|
+
type: "timestamptz",
|
|
240
|
+
comment: "Data de cria\xE7\xE3o do registro."
|
|
241
|
+
})
|
|
242
|
+
], RegulationExtraction.prototype, "createdAt", 2);
|
|
243
|
+
__decorateClass([
|
|
244
|
+
UpdateDateColumn({
|
|
245
|
+
name: "updated_at",
|
|
246
|
+
type: "timestamptz",
|
|
247
|
+
comment: "Data da \xFAltima atualiza\xE7\xE3o do registro."
|
|
248
|
+
})
|
|
249
|
+
], RegulationExtraction.prototype, "updatedAt", 2);
|
|
250
|
+
__decorateClass([
|
|
251
|
+
ManyToOne(() => Tournament, { onDelete: "NO ACTION" }),
|
|
252
|
+
JoinColumn({ name: "tournament_id" })
|
|
253
|
+
], RegulationExtraction.prototype, "tournament", 2);
|
|
254
|
+
RegulationExtraction = __decorateClass([
|
|
255
|
+
Entity("regulation_extractions"),
|
|
256
|
+
Check(
|
|
257
|
+
"regulation_extractions_status_check",
|
|
258
|
+
"status IN ('queued', 'running', 'completed', 'failed')"
|
|
259
|
+
),
|
|
260
|
+
Check("regulation_extractions_progress_check", "progress_percent BETWEEN 0 AND 100"),
|
|
261
|
+
Check(
|
|
262
|
+
"regulation_extractions_method_check",
|
|
263
|
+
"extraction_method IS NULL OR extraction_method IN ('text', 'multimodal')"
|
|
264
|
+
)
|
|
265
|
+
], RegulationExtraction);
|
|
266
|
+
export {
|
|
267
|
+
RegulationExtraction
|
|
268
|
+
};
|