Commit graph

7 commits

Author SHA1 Message Date
Vitor Mattos
dd0ac0a007
feat: add NONE mode to SignatureFlow enum
Allow admin to not enforce signing flow, letting users choose
per document. Updates enum, File entity, and migration defaults.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-17 02:03:20 -03:00
Vitor Mattos
1d62e46b5c
refactor: move signature flow constants to enum
Move database value constants from File entity to SignatureFlow enum
where they belong as the single source of truth.

- Add SignatureFlow::NUMERIC_PARALLEL and NUMERIC_ORDERED_NUMERIC
- Remove circular dependency between File and SignatureFlow
- Update all references to use enum constants
- Use descriptive names instead of abbreviations

This follows single responsibility principle: the enum owns its
database representation.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 17:14:12 -03:00
Vitor Mattos
0f89027464
feat: add signature_flow column to libresign_file table
Add signature_flow column to store signature flow mode at file level.

- Column type: SMALLINT NOT NULL DEFAULT 1
- 1 = parallel (default)
- 2 = ordered_numeric

This enables per-file configuration of signature flow, overriding the
global application setting when specified.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 16:58:18 -03:00
Vitor Mattos
6f83a9c04d
fix: set default value for signer_order column in migration
Set default value of 0 for signer_order column to prevent NULL values
that would cause issues with sequential signing feature.

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-12 16:30:59 -03:00
Vitor Mattos
24542f28d5
fix: Update migration to properly set SignRequest status
- Add postSchemaChange method to migrate existing data
- Set status = 2 (SIGNED) when signed IS NOT NULL
- Set status = 1 (ABLE_TO_SIGN) when signed IS NULL and file.status = 1
- Status 0 (DRAFT) remains as default
- Only update records with status = 0 to avoid overwriting

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-10 19:07:55 -03:00
Vitor Mattos
69feb74e2b
refactor: change status from string to integer type
- Change SignRequestStatus enum from string-backed to int-backed (0, 1, 2)
- Update database migration to use SMALLINT instead of VARCHAR(20)
- Update SignRequest entity to use int type for status property
- Reduces storage overhead and improves performance
- Integer values: 0=draft, 1=able_to_sign, 2=signed

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00
Vitor Mattos
b946adee80
feat: add database migration for sequential signing
- Add signing_order column (INT, DEFAULT 1) to libresign_sign_request
- Add status column (VARCHAR 20, DEFAULT 'draft') to libresign_sign_request
- Migration supports both PostgreSQL and MySQL/MariaDB

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
2025-12-09 21:56:51 -03:00