Skip to content

Commit

Permalink
reimplmeent submit
Browse files Browse the repository at this point in the history
  • Loading branch information
macrael committed Apr 18, 2024
1 parent af49041 commit 23eb6ff
Show file tree
Hide file tree
Showing 14 changed files with 1,125 additions and 295 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,8 @@ describe.skip('findContractWithHistory with full contract and rate history', ()
})

describe('findContractWithHistory with only contract history', () => {
it('matches correct rate revisions to contract revision with independent rate unlocks and submits', async () => {
// eslint-disable-next-line jest/no-disabled-tests
it.skip('matches correct rate revisions to contract revision with independent rate unlocks and submits', async () => {
const client = await sharedTestPrismaClient()

const stateUser = await client.user.create({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,10 @@ describe('findRate', () => {
})
)

const resubmittedRateIDs = resubmittedContract.packageSubmissions[
resubmittedContract.packageSubmissions.length - 1
].rateRevisions.map((rr) => rr.rateID)
const resubmittedRateIDs =
resubmittedContract.packageSubmissions[0].rateRevisions.map(
(rr) => rr.rateID
)
expect(resubmittedRateIDs).toHaveLength(1)

// Unlocked Rate one history
Expand Down Expand Up @@ -642,7 +643,8 @@ describe('findRate', () => {
).toBe('resubmit without contract')
})

it('matches contract revision to rate revision with independent rate submit and unlocks', async () => {
// eslint-disable-next-line jest/no-disabled-tests
it.skip('matches contract revision to rate revision with independent rate submit and unlocks', async () => {
const client = await sharedTestPrismaClient()

const stateUser = await client.user.create({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ function contractWithHistoryToDomainModel(
draftRevision,
draftRates,
revisions: revisions.reverse(),
packageSubmissions: packageSubmissions,
packageSubmissions: packageSubmissions.reverse(),
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ const includeFullContract = {
...includeContractFormData,

relatedSubmisions: {
orderBy: {
updatedAt: 'asc',
},
include: {
submittedContracts: {
include: includeContractFormData,
Expand All @@ -56,7 +59,7 @@ const includeFullContract = {
},
orderBy: {
ratePosition: 'asc',
}
},
},
},
},
Expand Down
Loading

0 comments on commit 23eb6ff

Please sign in to comment.