- Implemented API for updating company Verifactu profile. - Created entities for company Verifactu profile and defaults. - Developed hooks for querying and updating the company Verifactu profile. - Added UI components for displaying and editing company Verifactu settings. - Introduced validation and error handling for profile updates. - Created utility functions for building form data and handling feedback states. - Added tests for utility functions and error handling.
40 lines
1.6 KiB
SQL
40 lines
1.6 KiB
SQL
-- DDL vigente para CompanyVerifactuProfile.
|
|
-- Crea la tabla fisica del perfil VeriFactu empresarial con un unico registro por company.
|
|
-- Ejecutar solo en una BD de desarrollo segura o mediante procedimiento controlado.
|
|
-- No ejecutar automaticamente en produccion.
|
|
|
|
CREATE TABLE IF NOT EXISTS company_verifactu_profiles (
|
|
id CHAR(36) NOT NULL,
|
|
company_id CHAR(36) NOT NULL,
|
|
profile_status VARCHAR(64) NOT NULL,
|
|
exemption_reason_code VARCHAR(64) NULL,
|
|
exemption_reason_detail VARCHAR(1024) NULL,
|
|
verifactu_effective_at DATETIME NULL,
|
|
auto_renew_mode VARCHAR(32) NULL,
|
|
default_tax_regime_code VARCHAR(64) NULL,
|
|
default_operation_qualification_code VARCHAR(64) NULL,
|
|
default_exemption_reason_code VARCHAR(64) NULL,
|
|
created_at DATETIME NOT NULL,
|
|
updated_at DATETIME NOT NULL,
|
|
PRIMARY KEY (id),
|
|
UNIQUE KEY uq_company_verifactu_profiles_company_id (company_id),
|
|
KEY idx_company_verifactu_profiles_status (profile_status)
|
|
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
|
|
|
|
-- Validacion minima posterior a la DDL.
|
|
-- SELECT column_name
|
|
-- FROM information_schema.columns
|
|
-- WHERE table_schema = DATABASE()
|
|
-- AND table_name = 'company_verifactu_profiles';
|
|
--
|
|
-- SELECT index_name, GROUP_CONCAT(column_name ORDER BY seq_in_index) AS indexed_columns
|
|
-- FROM information_schema.statistics
|
|
-- WHERE table_schema = DATABASE()
|
|
-- AND table_name = 'company_verifactu_profiles'
|
|
-- AND index_name IN (
|
|
-- 'PRIMARY',
|
|
-- 'uq_company_verifactu_profiles_company_id',
|
|
-- 'idx_company_verifactu_profiles_status'
|
|
-- )
|
|
-- GROUP BY index_name;
|