HSLG Media

WordPressCustomerRecordRepository.php

WordPressCustomerRecordRepository.php

Source file: wordpress/hslg-app-api/src/database/WordPressCustomerRecordRepository.php

Module: wordpress-hslg-app-api

Size: 102 lines

SHA-256: 0c0816d9dca10d951adee9308e323cd3f1f171c616fe369a7b31c168d84ba026

Responsibility

Hosts independently deployable HSLG-owned API endpoints and schema operations on WordPress/MariaDB.

Declared entry points

  • WordPressCustomerRecordRepository — source line 17.
  • FIELDS — source line 21.
  • __construct — source line 23.
  • uuid — source line 25.
  • field — source line 33.
  • append — source line 44.
  • latestField — source line 71.
  • latestFields — source line 89.

Imports and dependencies

  • Line 4: use Hslg\Backend\Database\TableNames;
  • Line 5: use Hslg\Backend\Contracts\CustomerFieldRepository;

Behaviour and audit locations

  • Line 11: * using DEFAULT CURRENT_TIMESTAMP(6), based on its SQL session clock.
  • Line 15: * Do not store passwords, tokens, verification secrets or payment credentials.

Append-only write and latest-field read

append() validates approved fields and UUIDs, generates a new record UUID and writes to the HSLG customer-record table without providing written_at; MariaDB assigns the original local timestamp. latestField() orders by written_at DESC, record_id DESC, while latestFields() uses ROW_NUMBER() per field for the same deterministic selection. Imports from other nodes must not call the local append method because they must preserve source identifiers and timestamps. This repository does not decide order or payment state.

Relationship to the system

This page is the file-level source reference, not the architecture rationale. Read the module explanation, the corresponding architecture decision and user guide before changing behaviour. Names and line locations above are extracted from this exact source version; they are reference points, not proof that an external service or a phone feature works.

Change verification

Review the entry points and errors in this file, then run the module’s associated tests, source dependency gate, history gate and documentation coverage check. If the file changes an API response, user interaction, data model, deployment or third-party dependency, revise those human explanations and disaster recovery/licensing when relevant. Do not infer actual native or external API operation from source presence.