Skip to content

Feature/db sprint1 - #1

Merged
J3rmed merged 15 commits into
mainfrom
feature/db-sprint1
Sep 22, 2026
Merged

J3rmed merged 15 commits into
mainfrom
feature/db-sprint1

Conversation

@J3rmed

@J3rmed J3rmed commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

No description provided.

ConfirmEmailUseCase moves a client to ACTIVE and no use case writes to
account_status_changes yet, so the trigger rejected email confirmation
and broke HU-001. It now applies only to organizations, where no code
updates the status. Seed also covers Sunday, which left query 6 empty
every Friday.
psql -f prefixes every error with file:line, so the anchored pattern
never matched and the check passed with zero rejections. grep -c with no
match also aborts the step under bash -e. The row counter accepted
(0 rows) as a result; it now requires at least one row.
Explains what each file is, in which order it runs, and how to bring up
the schema with the db service of the existing docker-compose. Commands
verified against that compose.
The single-canvas version was not readable: all 27 relationships had an
empty label, none had explicit waypoints, the old and new entities used
different crow's foot conventions, and the entities added later sat far
below the rest so their edges crossed the whole canvas and the user
story blocks.

Rebuilt as four pages (identity and organization, catalogue and
resources, bookings, user stories). Every relationship now carries a
verb phrase read from source to target, both ends use the same notation,
and routing uses explicit waypoints: the corridor between columns for
adjacent entities and a dedicated lane below the diagram for the few
edges that span more than one column.

Checked with a script over the XML: 27 relationships, 0 without a label,
0 segments crossing a box, one cardinality convention. Rendered to PNG
and reviewed page by page.
The previous commit split the diagram into themed pages only, which
dropped the single-sheet view the team had: opening the file showed ten
entities and none of the user story blocks, because the rest lived in
other tabs.

The first page is now Modelo completo, with the nineteen entities, the
six design notes, the five user stories and the legend on one sheet, as
before. The themed pages stay after it as per-domain views.

Table widths are normalised so column edges line up; that is what lets
every edge leave into a clear corridor. Checked: 54 relationships across
the five pages, 0 without a label, 0 segments crossing a box.
A cross-check of the diagram against the schema loaded in PostgreSQL
found four gaps:

- eleven entities were missing columns that exist in schema.sql
  (created_at/updated_at in ten of them, Currency.active and
  ServiceResourceRequirement.organization_id)
- the foreign key from bookings to service_locations was not drawn
- Organization -> Booking was drawn as a direct foreign key, which it is
  not: bookings.organization_id is enforced through the composite keys.
  The label now says so
- User was not marked as external, so auth.users read as one more table

Fixing it also surfaced two older defects: Organization had nit and
contact_email drawn on top of each other, and Service had the wrong
height. Row geometry is now computed instead of hand-placed, and so is
the vertical position of every entity, so boxes cannot end up touching
when one of them grows.

Checked: 56 relationships across five pages, 0 without a label, 0
segments crossing a box, 0 overlapping boxes, every column matching the
real schema.
… stories

The diagram drew Organization -> Booking.organization_id, but no such foreign
key exists: the column is a denormalised copy already guarded by the composite
keys against services, locations and organization_policies. It now matches
ServiceResourceRequirement, which has the same shape and carries no line, so
the diagram maps one to one onto the 26 declared foreign keys.

The five user story columns declared 560 px of width on a 600 px pitch while
the text renders at roughly 610, so each column ran into the next one. They are
now 700 wide on a 760 pitch, and the legend on that sheet moves from a thousand
pixels below the content to its right-hand side.

The fifth page was missing from the export; it ships as
der-4-historias-de-usuario.png and the docs that list the pages now say five.
@sonarqubecloud

Copy link
Copy Markdown

@J3rmed
J3rmed merged commit df7f7b1 into main Sep 22, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants