-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
57470d8
commit 8a7275d
Showing
2 changed files
with
60 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
packages/openchs-android/integrationTest/service/TestMetadataService.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import {ApprovalStatus, EncounterType, Program, SubjectType} from "openchs-models"; | ||
import TestSubjectTypeFactory from "../../test/model/TestSubjectTypeFactory"; | ||
import TestProgramFactory from "../../test/model/TestProgramFactory"; | ||
import TestEncounterTypeFactory from "../../test/model/TestEncounterTypeFactory"; | ||
import TestApprovalStatusFactory from "../../test/model/approval/TestApprovalStatusFactory"; | ||
|
||
class TestMetadataService { | ||
static create(db) { | ||
const metadata = {}; | ||
metadata.subjectType = db.create(SubjectType, TestSubjectTypeFactory.createWithDefaults({type: SubjectType.types.Person, name: 'Beneficiary'})); | ||
metadata.program = db.create(Program, TestProgramFactory.create({name: 'Child'})); | ||
metadata.programEncounterType = db.create(EncounterType, TestEncounterTypeFactory.create({name: "Birth form"})); | ||
metadata.encounterType = db.create(EncounterType, TestEncounterTypeFactory.create({name: "Bar"})); | ||
metadata.approvalStatus = db.create(ApprovalStatus, TestApprovalStatusFactory.create({})); | ||
metadata.enrolmentApprovalStatus = db.create(ApprovalStatus, TestApprovalStatusFactory.create({})); | ||
metadata.pendingStatus = db.create(ApprovalStatus, TestApprovalStatusFactory.create({status: ApprovalStatus.statuses.Pending})); | ||
metadata.rejectedStatus = db.create(ApprovalStatus, TestApprovalStatusFactory.create({status: ApprovalStatus.statuses.Rejected})); | ||
return metadata; | ||
} | ||
} | ||
|
||
export default TestMetadataService; |