@propriety/court-calendar 1.0.192 → 1.0.194

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/README.md CHANGED
@@ -301,9 +301,9 @@ If a `cdId` or `ci` value in the URL doesn't match any loaded data, a brief erro
301
301
 
302
302
  | Type | `isAdjourned` | `isExtraDay` | Description |
303
303
  |------|---------------|--------------|-------------|
304
- | Main | `false` | `false` | The primary entry on the original court date. Holds all non-adjourned cases. |
304
+ | Main | `false` | `false` | The primary entry on the court date. Holds the session's cases, including cases moved onto it, except those in an adjournment entry. |
305
305
  | Extra-day | `false` | `true` | Additional days from `CourtDate.MultipleDates`. Same cases as the main event. |
306
- | Adjournment | `true` | `false` | One entry per unique adjourned date, holding the cases adjourned to that date. |
306
+ | Adjournment | `true` | `false` | One entry per unique adjourned date, holding cases still on this session whose `AdjournedDate` is another day (rows adjourned before the backend moved cases). |
307
307
 
308
308
  URL routing always targets the main `CalEvent` when restoring a modal — adjournment and extra-day entries are never used as the bootstrap target.
309
309
 
@@ -350,6 +350,7 @@ interface CourtDate {
350
350
  Address: string | null;
351
351
  Room: string | null;
352
352
  SkipMotion: boolean | null;
353
+ MovedOut?: number; // moves off this session to another one (AVE-2332 backend)
353
354
  }
354
355
 
355
356
  interface Case {
@@ -360,6 +361,7 @@ interface Case {
360
361
  property_data: { Address: string; PropertyOwnerFull: string };
361
362
  evidence: Evidence | null;
362
363
  AdjournedDate: Date | null;
364
+ MovedFrom?: { CourtDateID: number; CourtDate: Date } | null; // AVE-2332 backend
363
365
  // ... plus Village SCAR fields and negotiation/stip tracking
364
366
  }
365
367
  ```
@@ -1,6 +1,6 @@
1
- import { AdjournmentEntry, Case, CourtDate, DateEditItem } from '../../../types';
1
+ import { AdjournmentEntry, Case, CaseMove, CourtDate, DateEditItem } from '../../../types';
2
2
  import { CalEvent } from '../../../helpers/CalEvent';
3
- export default function DateDetails({ selectedCourtDate, cases, isVillage, isFetchingCases, onUpdateChair, onToggleComplete, adjournments, courtDateHistory, canFileMotion, calEvent, }: {
3
+ export default function DateDetails({ selectedCourtDate, cases, isVillage, isFetchingCases, onUpdateChair, onToggleComplete, adjournments, courtDateHistory, moves, canFileMotion, calEvent, }: {
4
4
  selectedCourtDate: CourtDate | null;
5
5
  cases: Case[];
6
6
  isVillage: boolean;
@@ -10,6 +10,7 @@ export default function DateDetails({ selectedCourtDate, cases, isVillage, isFet
10
10
  onToggleComplete?: (complete: boolean) => void;
11
11
  adjournments?: AdjournmentEntry[];
12
12
  courtDateHistory?: DateEditItem[];
13
+ moves?: CaseMove[];
13
14
  /** Passed straight to MotionToPreclude — see the note on its own prop. */
14
15
  canFileMotion: boolean;
15
16
  /** The occurrence that was clicked. Null only where no event opened this panel. */
@@ -4,8 +4,8 @@ import { HistoryEntry } from '../../../helpers/dateHistory';
4
4
  *
5
5
  * Reschedules render as one left-to-right path — `Feb 23 → Mar 23 → Aug 5` — rather than
6
6
  * one chip per log row, so the order reads the way the arrows point and a date shared by
7
- * two consecutive moves is only printed once. Bulk case adjournments are a different kind
8
- * of event (they move cases off this date, not the date itself) and keep their own row.
7
+ * two consecutive moves is only printed once. Bulk case adjournments and case moves are a
8
+ * different kind of event (they move cases, not the date itself) and keep their own row.
9
9
  *
10
10
  * Renders nothing when there is no history, so unchanged court dates keep their header
11
11
  * exactly as it was.
@@ -21,6 +21,7 @@ export interface CalEvent {
21
21
  isMultiDay: boolean;
22
22
  hasAdjournedNoDate: boolean;
23
23
  hasAllCasesAdjourned: boolean;
24
+ allCasesMovedIn: boolean;
24
25
  casesLoaded: boolean;
25
26
  source: CourtDate;
26
27
  }
@@ -1,4 +1,4 @@
1
- import { DateType, Case } from '../../types';
1
+ import { DateType, CourtDate, Case } from '../../types';
2
2
  export declare function searchByCaseTerm(term: string, apiKey: string): AsyncGenerator<any, void, unknown>;
3
3
  export declare function fetchCasesByCourtDate(id: string, apiKey: string, type?: DateType): Promise<Case[]>;
4
4
  export declare function fetchAllCasesPaginated(apiKey: string, pageSize?: number, dateFrom?: string): AsyncGenerator<Record<string, Case[]>, void, unknown>;
@@ -11,6 +11,8 @@ export interface SkippedAdjournment {
11
11
  export interface AdjournResult {
12
12
  ok: boolean;
13
13
  skipped: SkippedAdjournment[];
14
+ /** The sessions the cases left and landed on, as the date list returns them. Absent before AVE-2332's backend. */
15
+ sessions?: CourtDate[];
14
16
  }
15
17
  export declare function adjournCases(cases: {
16
18
  indexNumber: string;
@@ -1,4 +1,14 @@
1
1
  import { DateType, CourtDate, CourtDateDetail, DateEditLog, Notes } from '../../types';
2
+ export declare function normalizeDateFromApi(raw: CourtDate & {
3
+ NegDateID?: number | string;
4
+ CollectionID?: number | string;
5
+ court_date_id?: number | string;
6
+ Date?: string;
7
+ HearingDate?: string;
8
+ Time?: string;
9
+ skip_motion?: boolean | null;
10
+ motion_date?: string | null;
11
+ }, type: DateType): CourtDate;
2
12
  export declare function getAllDates(apiKey: string, type?: DateType, dateFrom?: string, dateTo?: string): Promise<Array<CourtDate>>;
3
13
  export declare function updateCourtDate(courtDateId: number, updatedData: Partial<CourtDate>, apiKey: string, courtCases?: string[], user?: number, type?: DateType, skipMotion?: boolean, noticeFiles?: File[], onUploadDeadlineNotice?: (notice: string) => void): Promise<boolean>;
4
14
  /**
@@ -57,9 +57,8 @@ export declare function canMarkComplete(date: Pick<CourtDate, 'DateType'>): bool
57
57
  /**
58
58
  * A negotiation or collections date marked finished by hand.
59
59
  *
60
- * Neither carries linked cases, so nothing about one can be *derived* as done. A negotiation
61
- * shares the `showPastNegotiations` filter with its date passing; a collection shares
62
- * `showCompletedUploads`.
60
+ * Neither carries linked cases, so only this or its date passing can retire one. A negotiation
61
+ * comes back with `showPastNegotiations`, a collection with `showCompletedUploads`.
63
62
  *
64
63
  * SCAR dates are excluded because Court.HearingDates.Status holds unrelated values. The column
65
64
  * is free text shared with other writers, so this compares case-insensitively.
@@ -1,15 +1,16 @@
1
- import { AdjournmentEntry, Case, DateEditItem, User } from '../types';
1
+ import { AdjournmentEntry, Case, CaseMove, DateEditItem, User } from '../types';
2
2
  export interface HistoryEntry {
3
3
  /** Stable React key. */
4
4
  key: string;
5
- kind: 'reschedule' | 'adjournment';
5
+ /** `moveOut`/`moveIn` group a session's case moves. */
6
+ kind: 'reschedule' | 'adjournment' | 'moveOut' | 'moveIn';
6
7
  /** When the change was recorded. Used for ordering. */
7
8
  at: Date | null;
8
- /** Reschedule only — the date it moved off of. */
9
+ /** The date it moved off of. Null on adjournments, and on a move from no date. */
9
10
  from: Date | null;
10
- /** The date it moved to (reschedule) or was adjourned to (adjournment). */
11
+ /** The date it moved to or was adjourned to. Null on a move to no date. */
11
12
  to: Date | null;
12
- /** Adjournment only — how many cases share this adjourned-to date. */
13
+ /** Adjournments and move groups — how many cases share the entry. */
13
14
  caseCount: number;
14
15
  /** Resolved user name, or '—' when unattributable. Adjournment rows are never attributed. */
15
16
  by: string;
@@ -67,6 +68,11 @@ export interface TrailNode {
67
68
  * that never happened.
68
69
  */
69
70
  export declare function buildRescheduleTrail(entries: HistoryEntry[]): TrailNode[];
71
+ /**
72
+ * A session's case moves for its header: those leaving grouped by destination day ("3 → Oct 7"),
73
+ * those arriving by origin day ("3 ← Jun 8"). A group is credited only when one person made all of it.
74
+ */
75
+ export declare function buildMoveGroups(moves: CaseMove[], courtDateId: number, allUsers: Record<number, User>): HistoryEntry[];
70
76
  /**
71
77
  * The adjournment rows belonging to a single case.
72
78
  *
@@ -1,7 +1,7 @@
1
- import { AdjournmentEntry, CourtDate, DateEditItem } from '../types';
1
+ import { AdjournmentEntry, CaseMove, CourtDate, DateEditItem } from '../types';
2
2
  /**
3
- * Fetches the history side of `GET /court-dates/{id}` — the case adjournment rows and the
4
- * trail of CourtDate reschedules.
3
+ * Fetches the history side of `GET /court-dates/{id}` — the case adjournment rows, the case
4
+ * moves and the trail of CourtDate reschedules.
5
5
  *
6
6
  * Lives at the modal level rather than inside a panel because every `ModalPanel` stays
7
7
  * mounted (they cross-fade rather than unmount), so fetching per-panel would fire the same
@@ -13,5 +13,7 @@ import { AdjournmentEntry, CourtDate, DateEditItem } from '../types';
13
13
  export declare function useDateHistory(selectedCourtDate: CourtDate | null, modalIsOpen: boolean): {
14
14
  adjournments: AdjournmentEntry[];
15
15
  courtDateHistory: DateEditItem[];
16
+ moves: CaseMove[];
16
17
  isLoading: boolean;
18
+ reload: () => void;
17
19
  };