crm-summit/app/Models/FigmaFileVersionsModel.php
mahdahar 6776d539ae feat(figma): add version author id and robust incremental sync pagination
Improve Figma synchronization to persist version author identity and handle API pagination links reliably during incremental sync jobs.

Changes included:
- Added  support end-to-end:
  - New migration  adds column and index.
  -  now allows .
  -  maps user id from Figma version payload ( / ).
  -  snapshot query now selects .
  -  displays Figma User ID column and updates table colspan states.
- Hardened Figma pagination flow in :
  - Follow absolute  URLs when returned by API.
  - Track seen pagination URLs to prevent loops.
  - Support additional page-size query key and URL-safe encoding.
  - Updated request builder to work with absolute endpoints and existing query strings.
- Consolidated schema intent:
  - Moved Volume in drive C: has no label
Volume Serial Number is 2B45-1F84/ columns into initial Figma table migration.
  - Removed superseded follow-up migrations that previously added/dropped these fields.
- Updated project docs and dependencies:
  - Replaced starter README with CRM Summit specific project README.
  - Refreshed  (framework and dependency version bumps).
- Added database artifact: .

Impact:
- Incremental sync should now process paginated version/history feeds more reliably.
- Snapshot API and dashboard expose author-level metadata for auditing and filtering.
- Fresh installs get cleaner Figma schema history from baseline migration.
2026-04-28 05:39:02 +07:00

31 lines
672 B
PHP

<?php namespace App\Models;
use CodeIgniter\Model;
class FigmaFileVersionsModel extends Model
{
protected $table = 'figma_file_versions';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = [
'file_id',
'figma_version_id',
'version',
'label',
'description',
'name',
'editor_type',
'figma_user_id',
'last_modified_figma',
'created_at_figma',
];
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
}