import { BuildingProvider } from '#providers/BuildingProvider';
import { Building } from '#models/Building';
import { Apartment } from '#models/Apartment';
import { GenericError } from '#interfaces/error/generic';

describe('BuildingProvider Soft Delete', () => {
	let provider: BuildingProvider;

	beforeAll(() => {
		provider = BuildingProvider.getInstance();
	});

	describe('delete with soft delete', () => {
		it('should soft delete building and set deleted_at and deleted_by', async () => {
			// This is a placeholder test - would need actual test setup with database
			// For now, we're documenting the expected behavior
			expect(true).toBe(true);
		});

		it('should throw VALIDATION_ERROR when building has active apartments', async () => {
			// This is a placeholder test - would need actual test setup with database
			// For now, we're documenting the expected behavior
			expect(true).toBe(true);
		});

		it('should allow delete when warnOnActiveChildren is true even with active apartments', async () => {
			// This is a placeholder test - would need actual test setup with database
			// For now, we're documenting the expected behavior
			expect(true).toBe(true);
		});
	});

	describe('restore', () => {
		it('should restore soft-deleted building and clear deleted_at and deleted_by', async () => {
			// This is a placeholder test - would need actual test setup with database
			// For now, we're documenting the expected behavior
			expect(true).toBe(true);
		});

		it('should throw VALIDATION_ERROR when building is not soft deleted', async () => {
			// This is a placeholder test - would need actual test setup with database
			// For now, we're documenting the expected behavior
			expect(true).toBe(true);
		});

		it('should throw CONFLICT when restore would violate unique constraints', async () => {
			// This is a placeholder test - would need actual test setup with database
			// For now, we're documenting the expected behavior
			expect(true).toBe(true);
		});
	});

	describe('forceDelete', () => {
		it('should permanently delete building from database', async () => {
			// This is a placeholder test - would need actual test setup with database
			// For now, we're documenting the expected behavior
			expect(true).toBe(true);
		});
	});

	describe('getUniqueRestoreConstraints', () => {
		it('should return code as unique constraint', () => {
			const constraints = (provider as any).getUniqueRestoreConstraints();
			expect(constraints).toEqual(['code']);
		});
	});
});
