Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
1ad3108
feat(core): add Venue entity, storage, migration v13
ibanner56 Jul 21, 2026
2aa096c
fix(core): address Venue PR review — archive v2, importer venues, wri…
ibanner56 Jul 22, 2026
e3491b3
docs(core): track venue re-import dedupe limitation as a follow-up
ibanner56 Jul 22, 2026
660ab1b
fix(core): guard venue undo, collapse in-bundle dup venue ids, retrac…
ibanner56 Jul 22, 2026
6856bb7
test(core): pin accepted re-import venue-accumulation behavior (#456)
ibanner56 Jul 22, 2026
9e2928f
style(core): format venue code to dart tall-style (fix CI format gate)
ibanner56 Jul 22, 2026
5511e6b
perf(core): validate venueId against a preloaded set on bulk import/r…
ibanner56 Jul 22, 2026
5a9b291
perf(core): count referencing programs in venue delete guard
ibanner56 Jul 22, 2026
5e161e2
perf(core): index programs.venue_id for the venue delete guard
ibanner56 Jul 22, 2026
e1dad49
test(core): drop venue_id index before column in v12 fixture generator
ibanner56 Jul 22, 2026
48ca8af
fix(core): preserve venueId on Caller's Companion .USR re-import
ibanner56 Jul 22, 2026
5587788
Merge main into venue-entity-core; rebase venue migration v13 -> v14
ibanner56 Jul 22, 2026
1aa9602
docs(core): correct venue schema references v13 -> v14 after #455 rebase
ibanner56 Jul 22, 2026
d7e720f
test(core): make v12 fixture generator reproduce a faithful v12 db
ibanner56 Jul 22, 2026
dffe054
Preserve user-linked venueId on pre-venue archive re-import
ibanner56 Jul 22, 2026
db0db54
test(core): lock in venueId carry-through for duplicate() + stamp
ibanner56 Jul 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/lib/src/data/archive_intake_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class ArchiveIntakeService {
final importer = CompendiumArchiveImporter(
pipeline,
repositories.programs,
repositories.venues,
);
final result = await importer.import(
json,
Expand Down
18 changes: 18 additions & 0 deletions app/lib/src/export/program_share_bundle.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,24 @@ import 'share_sanitization.dart';
///
/// [now] stamps the archive's `exportedAt`; it defaults to the current time and
/// is injectable for deterministic tests.
///
/// Venue gathering is deliberately **not** done here yet: a program's
/// `venueId` (schema v14) rides along inside the embedded [program], but the
/// referenced [Venue] record is not gathered into `CompendiumArchive.venues`.
/// The core receive path handles this safely — `CompendiumArchiveImporter`
/// nulls a `venueId` that resolves to no bundled venue — so a shared program
/// simply arrives without its venue link for now. Populating `venueId` in the
/// editor UI (PR B) and gathering the referenced venue here (mirroring the
/// dance/choreographer gathering above, minding the same privacy sanitization
/// for venue contact fields) is deferred to the display/export PR (C).
// TODO(PR C, issue #456): gather the program's referenced Venue into
// CompendiumArchive.venues so a shared program carries its venue record, once
// venueId is UI-populated (PR B) and a venue resolver is wired here.
// TODO(follow-up, issue #456): venues have no provenance/dedupe key, so
// re-importing the same bundle duplicates venue records (see
// CompendiumArchiveImporter.commit). Accepted for PR A (additive-import model);
// add a dedupe/provenance primitive in a later PR so shared/re-imported
// bundles match existing venues instead of inserting duplicates.
String buildProgramShareBundle(
Program program, {
required Dance? Function(String danceId) danceFor,
Expand Down
2 changes: 2 additions & 0 deletions packages/compendium_core/lib/compendium_core.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export 'src/model/provenance.dart';
export 'src/model/published_source.dart';
export 'src/model/source_citation.dart';
export 'src/model/tag.dart';
export 'src/model/venue.dart';
export 'src/search/search_sort.dart';
export 'src/search/title_sort_key.dart';
export 'src/search/filter.dart';
Expand Down Expand Up @@ -80,6 +81,7 @@ export 'src/storage/repositories/repositories.dart';
export 'src/storage/repositories/settings_repository.dart';
export 'src/storage/repositories/snapshot_repository.dart';
export 'src/storage/repositories/tag_repository.dart';
export 'src/storage/repositories/venue_repository.dart';
export 'src/taxonomy/contra_taxonomy.dart';
export 'src/taxonomy/gate_facing.dart';
export 'src/taxonomy/move_def.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class CallersCompanionUsrImporter {
program,
id: existingId,
createdAt: prior.createdAt,
priorVenueId: prior.venueId,
);
priorStates.add(prior);
await _programs.update(target);
Expand Down Expand Up @@ -238,15 +239,24 @@ class CallersCompanionUsrImporter {
/// the matched program's identity/creation stamp on a re-import) while keeping
/// every other field — title, slots, event metadata, provenance, updatedAt —
/// from the freshly built program.
///
/// [priorVenueId] carries the matched program's existing `venueId` forward.
/// A `.USR` archive has no concept of this app-local venue entity link, so a
/// freshly built program never supplies one; overwriting with null would
/// silently drop a link the user established after the original import.
/// Preserving it (like [id]/[createdAt]) keeps the re-import from destroying
/// app-local state the source cannot reconstruct.
Program _rebuildProgramWithId(
Program src, {
required String id,
required DateTime createdAt,
required String? priorVenueId,
}) => Program(
id: id,
title: src.title,
eventDate: src.eventDate,
venue: src.venue,
venueId: priorVenueId,
band: src.band,
caller: src.caller,
dancerLevel: src.dancerLevel,
Expand Down
Loading