Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dashboard page (Uploads table), create a reusable TableBuilder #51

Merged
merged 15 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/db/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ model Agency {
name String
abbreviation String?
code String
tenant Organization? @relation(fields: [organizationId], references: [id])
organization Organization? @relation(fields: [organizationId], references: [id])
organizationId Int?
users User[]
uploads Upload[]
Expand Down Expand Up @@ -119,7 +119,7 @@ model Upload {
agencyId Int
agency Agency @relation(fields: [agencyId], references: [id])
organizationId Int
organizaiton Organization @relation(fields: [organizationId], references: [id])
organization Organization @relation(fields: [organizationId], references: [id])
reportingPeriodId Int
reportingPeriod ReportingPeriod @relation(fields: [reportingPeriodId], references: [id])
expenditureCategoryId Int
Expand All @@ -137,7 +137,7 @@ model UploadValidation {
agencyId Int
agency Agency @relation(fields: [agencyId], references: [id])
organizationId Int
organizaiton Organization @relation(fields: [organizationId], references: [id])
organization Organization @relation(fields: [organizationId], references: [id])
inputTemplateId Int
inputTemplate InputTemplate @relation(fields: [inputTemplateId], references: [id])
validationResults Json? @db.JsonB
Expand Down
134 changes: 0 additions & 134 deletions api/src/services/uploadValidations/uploadValidations.scenarios.ts

This file was deleted.

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
@@ -1,4 +1,4 @@
import type { Prisma, Upload } from '@prisma/client'

Check failure on line 1 in api/src/services/uploads/uploads.scenarios.ts

View workflow job for this annotation

GitHub Actions / qa / Lint JavaScript

There should be at least one empty line between import groups
import type { ScenarioData } from '@redwoodjs/testing/api'

export const standard = defineScenario<Prisma.UploadCreateArgs>({
Expand All @@ -6,11 +6,11 @@
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 @@ -19,23 +19,23 @@
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 @@ -44,19 +44,19 @@
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 @@ -65,23 +65,23 @@
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 @@ -90,7 +90,7 @@
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
Loading
Loading