feat: companies API, company on user lookups, company filters for users and login security
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
This commit is contained in:
1 parent
840b5a3bae
commit
c9c0745955
23 files changed
+1181
-13
No files matched your search
+20
@@ -0,0 +1,20 @@
|
||||
package com.solvway.services.system.model;
|
||||
|
||||
import org.hibernate.annotations.Formula;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
class UserCompanyMappingTest {
|
||||
|
||||
@Test
|
||||
void companyCodeAndStatusAreReadOnlyFormulasOverTheCompanyTable() throws Exception {
|
||||
for (String field : new String[]{"companyCode", "companyStatus"}) {
|
||||
Formula f = User.class.getDeclaredField(field).getAnnotation(Formula.class);
|
||||
assertThat(f).as(field).isNotNull();
|
||||
assertThat(f.value()).contains("from company c where c.id = company_id");
|
||||
}
|
||||
assertThat(User.class.getDeclaredField("companyCode").getAnnotation(Formula.class).value()).contains("c.code");
|
||||
assertThat(User.class.getDeclaredField("companyStatus").getAnnotation(Formula.class).value()).contains("c.status");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user