import { ApartmentProvider } from '#providers/ApartmentProvider';
import { Apartment } from '#models/Apartment';
import { Room } from '#models/Room';
import { GenericError } from '#interfaces/error/generic';

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

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

	describe('delete with soft delete', () => {
		it('should soft delete apartment and set deleted_at and deleted_by', async () => {
			// This is a placeholder test - would need actual test setup with database
			expect(true).toBe(true);
		});

		it('should throw VALIDATION_ERROR when apartment has active rooms', async () => {
			// This is a placeholder test - would need actual test setup with database
			expect(true).toBe(true);
		});

		it('should allow delete when warnOnActiveChildren is true even with active rooms', async () => {
			// This is a placeholder test - would need actual test setup with database
			expect(true).toBe(true);
		});
	});

	describe('restore', () => {
		it('should restore soft-deleted apartment and clear deleted_at and deleted_by', async () => {
			// This is a placeholder test - would need actual test setup with database
			expect(true).toBe(true);
		});

		it('should throw VALIDATION_ERROR when apartment is not soft deleted', async () => {
			// This is a placeholder test - would need actual test setup with database
			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
			expect(true).toBe(true);
		});
	});

	describe('forceDelete', () => {
		it('should permanently delete apartment from database', async () => {
			// This is a placeholder test - would need actual test setup with database
			expect(true).toBe(true);
		});
	});

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