@ttt-productions/ttt-core 0.78.10 → 0.78.11

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.
@@ -7,4 +7,37 @@ export declare const VoteForAuditionEntryInputSchema: z.ZodObject<{
7
7
  currentVoteId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
8
8
  }, z.core.$strict>;
9
9
  export type VoteForAuditionEntryInput = z.infer<typeof VoteForAuditionEntryInputSchema>;
10
+ /**
11
+ * Authoritative result of voteForAuditionEntry — the committed final vote state the
12
+ * transaction already knows (it READS both entry docs: the new entry for the
13
+ * existence/hidden checks, and on a vote switch the old entry for the clamped
14
+ * decrement — so both committed counts cost no extra read; the like/unlike precedent).
15
+ *
16
+ * This callable only CASTS or MOVES a vote — there is no unvote path (the input
17
+ * requires `newVote.auditionEntryId`; `currentVoteId` is ignored server-side), so
18
+ * `isVoted` is always true.
19
+ *
20
+ * Path semantics:
21
+ * - First vote: `alreadyVoted: false`, `voteCount` = read count + 1,
22
+ * `previousAuditionEntryId: null`, no `previousVoteCount`.
23
+ * - Vote switch: `alreadyVoted: false`, `voteCount` = read count + 1,
24
+ * `previousAuditionEntryId` = the entry the vote moved off; `previousVoteCount` =
25
+ * its clamped post-decrement count — ABSENT when that entry no longer exists
26
+ * (deleted entries skip the decrement).
27
+ * - Idempotent no-op (already voting for this entry): `alreadyVoted: true`,
28
+ * `voteCount` = the UNCHANGED read count, `previousAuditionEntryId: null`.
29
+ *
30
+ * Non-strict (server → client result posture).
31
+ */
32
+ export declare const VoteForAuditionEntryResultSchema: z.ZodObject<{
33
+ success: z.ZodLiteral<true>;
34
+ auditionId: z.ZodString;
35
+ auditionEntryId: z.ZodString;
36
+ isVoted: z.ZodLiteral<true>;
37
+ alreadyVoted: z.ZodBoolean;
38
+ voteCount: z.ZodNumber;
39
+ previousAuditionEntryId: z.ZodNullable<z.ZodString>;
40
+ previousVoteCount: z.ZodOptional<z.ZodNumber>;
41
+ }, z.core.$strip>;
42
+ export type VoteForAuditionEntryResult = z.infer<typeof VoteForAuditionEntryResultSchema>;
10
43
  //# sourceMappingURL=voting.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"voting.d.ts","sourceRoot":"","sources":["../../src/schemas/voting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,+BAA+B;;;;;;kBAOjC,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
1
+ {"version":3,"file":"voting.d.ts","sourceRoot":"","sources":["../../src/schemas/voting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,+BAA+B;;;;;;kBAOjC,CAAC;AACZ,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;iBAgB3C,CAAC;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAC"}
@@ -8,4 +8,43 @@ export const VoteForAuditionEntryInputSchema = z.object({
8
8
  // Accepted for backwards compatibility but ignored server-side; see runtime comment below.
9
9
  currentVoteId: z.string().nullable().optional(),
10
10
  }).strict();
11
+ /**
12
+ * Authoritative result of voteForAuditionEntry — the committed final vote state the
13
+ * transaction already knows (it READS both entry docs: the new entry for the
14
+ * existence/hidden checks, and on a vote switch the old entry for the clamped
15
+ * decrement — so both committed counts cost no extra read; the like/unlike precedent).
16
+ *
17
+ * This callable only CASTS or MOVES a vote — there is no unvote path (the input
18
+ * requires `newVote.auditionEntryId`; `currentVoteId` is ignored server-side), so
19
+ * `isVoted` is always true.
20
+ *
21
+ * Path semantics:
22
+ * - First vote: `alreadyVoted: false`, `voteCount` = read count + 1,
23
+ * `previousAuditionEntryId: null`, no `previousVoteCount`.
24
+ * - Vote switch: `alreadyVoted: false`, `voteCount` = read count + 1,
25
+ * `previousAuditionEntryId` = the entry the vote moved off; `previousVoteCount` =
26
+ * its clamped post-decrement count — ABSENT when that entry no longer exists
27
+ * (deleted entries skip the decrement).
28
+ * - Idempotent no-op (already voting for this entry): `alreadyVoted: true`,
29
+ * `voteCount` = the UNCHANGED read count, `previousAuditionEntryId: null`.
30
+ *
31
+ * Non-strict (server → client result posture).
32
+ */
33
+ export const VoteForAuditionEntryResultSchema = z.object({
34
+ success: z.literal(true),
35
+ auditionId: auditionIdSchema,
36
+ /** The entry the caller's vote now rests on. */
37
+ auditionEntryId: auditionEntryIdSchema,
38
+ /** Final caller vote-state — always true; this callable never removes a vote. */
39
+ isVoted: z.literal(true),
40
+ /** True when the caller was already voting for this entry (idempotent no-op). */
41
+ alreadyVoted: z.boolean(),
42
+ /** Committed vote count of the voted entry. */
43
+ voteCount: z.number().int().nonnegative(),
44
+ /** Entry the vote moved OFF on a switch; null on a first vote or idempotent no-op. */
45
+ previousAuditionEntryId: auditionEntryIdSchema.nullable(),
46
+ /** Committed post-decrement count of the previous entry — absent when
47
+ * previousAuditionEntryId is null or that entry was deleted (no decrement applied). */
48
+ previousVoteCount: z.number().int().nonnegative().optional(),
49
+ });
11
50
  //# sourceMappingURL=voting.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"voting.js","sourceRoot":"","sources":["../../src/schemas/voting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAErE,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,MAAM,CAAC;IACtD,UAAU,EAAE,gBAAgB;IAC5B,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC;QAChB,eAAe,EAAE,qBAAqB;KAC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GAAG,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE;CAC7D,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ttt-productions/ttt-core",
3
- "version": "0.78.10",
3
+ "version": "0.78.11",
4
4
  "description": "Core types, Firestore path constants, and shared constants for TTT Productions",
5
5
  "repository": {
6
6
  "type": "git",