static getCreate()

in testUtilities/GenerateStagingRequestsFactory.ts [24:79]


    static getCreate(): RequestResult {
        const createResource = {
            resourceType: 'Patient',
            name: [
                {
                    family: 'Jameson',
                    given: ['Matt'],
                },
            ],
            gender: 'male',
        };
        const request = {
            operation: 'create',
            resourceType: 'Patient',
            id: '',
            resource: createResource,
            fullUrl: '',
        };

        const expectedCreateItem: any = { ...createResource };
        expectedCreateItem[DOCUMENT_STATUS_FIELD] = DOCUMENT_STATUS.PENDING;

        const expectedRequest = {
            Put: {
                TableName: '',
                Item: DynamoDBConverter.marshall(expectedCreateItem),
            },
        };

        const expectedLock = {
            id: expect.stringMatching(uuidRegExp),
            vid: 1,
            resourceType: 'Patient',
            operation: 'create',
        };

        const expectedStagingResponse: BatchReadWriteResponse = {
            id: expect.stringMatching(uuidRegExp),
            vid: '1',
            operation: 'create',
            resourceType: 'Patient',
            resource: {
                ...createResource,
                id: expect.stringMatching(uuidRegExp),
                meta: { versionId: '1', lastUpdated: expect.stringMatching(utcTimeRegExp) },
            },
            lastModified: expect.stringMatching(utcTimeRegExp),
        };
        return {
            request,
            expectedRequest,
            expectedLock,
            expectedStagingResponse,
            idToVersionId: {},
        };
    }