Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
as1729 committed Dec 15, 2023
2 parents 27edbf8 + 5a2dde3 commit a63c97c
Show file tree
Hide file tree
Showing 39 changed files with 51,491 additions and 2,222 deletions.
1 change: 1 addition & 0 deletions api/src/services/agencies/agencies.scenarios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Prisma, agency } from '@prisma/client'

import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.agencyCreateArgs>({
Expand Down
25 changes: 12 additions & 13 deletions api/src/services/agencies/agencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,16 @@ export const deleteAgency: MutationResolvers['deleteAgency'] = ({ id }) => {
})
}

export const agenciesByOrganization: QueryResolvers['agenciesByOrganization'] = async ({
organizationId,
}) => {
try {
const agencies = await db.agency.findMany({
where: { organizationId },
})
return agencies || [] // Return an empty array if null is received
} catch (error) {
console.error(error)
// Handle the error appropriately; maybe log it and return an empty array
return []
export const agenciesByOrganization: QueryResolvers['agenciesByOrganization'] =
async ({ organizationId }) => {
try {
const agencies = await db.agency.findMany({
where: { organizationId },
})
return agencies || [] // Return an empty array if null is received
} catch (error) {
console.error(error)
// Handle the error appropriately; maybe log it and return an empty array
return []
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Prisma, ExpenditureCategory } from '@prisma/client'

import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.ExpenditureCategoryCreateArgs>({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Prisma, InputTemplate } from '@prisma/client'

import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.InputTemplateCreateArgs>({
Expand Down
1 change: 1 addition & 0 deletions api/src/services/organizations/organizations.scenarios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Prisma, Organization } from '@prisma/client'

import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.OrganizationCreateArgs>({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Prisma, OutputTemplate } from '@prisma/client'

import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.OutputTemplateCreateArgs>({
Expand Down
1 change: 1 addition & 0 deletions api/src/services/projects/projects.scenarios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Prisma, Project } from '@prisma/client'

import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.ProjectCreateArgs>({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Prisma, ReportingPeriod } from '@prisma/client'

import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.ReportingPeriodCreateArgs>({
Expand Down
1 change: 1 addition & 0 deletions api/src/services/roles/roles.scenarios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Prisma, Role } from '@prisma/client'

import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.RoleCreateArgs>({
Expand Down
83 changes: 0 additions & 83 deletions api/src/services/uploadValidations/uploadValidations.test.ts

This file was deleted.

40 changes: 20 additions & 20 deletions api/src/services/uploads/uploads.scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export const standard = defineScenario<Prisma.UploadCreateArgs>({
one: {
data: {
filename: 'String',
updatedAt: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-10T04:48:04.896Z',
uploadedBy: {
create: {
email: 'String',
updatedAt: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-10T04:48:04.896Z',
organization: { create: { name: 'String' } },
},
},
Expand All @@ -20,23 +20,23 @@ export const standard = defineScenario<Prisma.UploadCreateArgs>({
reportingPeriod: {
create: {
name: 'String',
startDate: '2023-12-08T21:03:09.638Z',
endDate: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-08T21:03:09.638Z',
startDate: '2023-12-10T04:48:04.896Z',
endDate: '2023-12-10T04:48:04.896Z',
updatedAt: '2023-12-10T04:48:04.896Z',
inputTemplate: {
create: {
name: 'String',
version: 'String',
effectiveDate: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-08T21:03:09.638Z',
effectiveDate: '2023-12-10T04:48:04.896Z',
updatedAt: '2023-12-10T04:48:04.896Z',
},
},
outputTemplate: {
create: {
name: 'String',
version: 'String',
effectiveDate: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-08T21:03:09.638Z',
effectiveDate: '2023-12-10T04:48:04.896Z',
updatedAt: '2023-12-10T04:48:04.896Z',
},
},
},
Expand All @@ -45,19 +45,19 @@ export const standard = defineScenario<Prisma.UploadCreateArgs>({
create: {
name: 'String',
code: 'String',
updatedAt: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-10T04:48:04.896Z',
},
},
},
},
two: {
data: {
filename: 'String',
updatedAt: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-10T04:48:04.896Z',
uploadedBy: {
create: {
email: 'String',
updatedAt: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-10T04:48:04.896Z',
organization: { create: { name: 'String' } },
},
},
Expand All @@ -66,23 +66,23 @@ export const standard = defineScenario<Prisma.UploadCreateArgs>({
reportingPeriod: {
create: {
name: 'String',
startDate: '2023-12-08T21:03:09.638Z',
endDate: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-08T21:03:09.638Z',
startDate: '2023-12-10T04:48:04.896Z',
endDate: '2023-12-10T04:48:04.896Z',
updatedAt: '2023-12-10T04:48:04.896Z',
inputTemplate: {
create: {
name: 'String',
version: 'String',
effectiveDate: '2023-12-08T21:03:09.638Z',
updatedAt: '2023-12-08T21:03:09.638Z',
effectiveDate: '2023-12-10T04:48:04.896Z',
updatedAt: '2023-12-10T04:48:04.896Z',
},
},
outputTemplate: {
create: {
name: 'String',
version: 'String',
effectiveDate: '2023-12-08T21:03:09.639Z',
updatedAt: '2023-12-08T21:03:09.639Z',
effectiveDate: '2023-12-10T04:48:04.896Z',
updatedAt: '2023-12-10T04:48:04.896Z',
},
},
},
Expand All @@ -91,7 +91,7 @@ export const standard = defineScenario<Prisma.UploadCreateArgs>({
create: {
name: 'String',
code: 'String',
updatedAt: '2023-12-08T21:03:09.639Z',
updatedAt: '2023-12-10T04:48:04.896Z',
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions api/src/services/uploads/uploads.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('uploads', () => {
organizationId: scenario.upload.two.organizationId,
reportingPeriodId: scenario.upload.two.reportingPeriodId,
expenditureCategoryId: scenario.upload.two.expenditureCategoryId,
updatedAt: '2023-12-08T21:03:09.551Z',
updatedAt: '2023-12-10T04:48:04.888Z',
},
})

Expand All @@ -51,7 +51,7 @@ describe('uploads', () => {
expect(result.expenditureCategoryId).toEqual(
scenario.upload.two.expenditureCategoryId
)
expect(result.updatedAt).toEqual(new Date('2023-12-08T21:03:09.551Z'))
expect(result.updatedAt).toEqual(new Date('2023-12-10T04:48:04.888Z'))
})

scenario('updates a upload', async (scenario: StandardScenario) => {
Expand Down
1 change: 1 addition & 0 deletions api/src/services/users/users.scenarios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Prisma, User } from '@prisma/client'

import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.UserCreateArgs>({
Expand Down
Loading

0 comments on commit a63c97c

Please sign in to comment.