fix: enforce drainage uniqueness and carrier-specific reporting
This commit is contained in:
@@ -370,6 +370,7 @@ describe('ChannelsService', () => {
|
||||
updatedAt: new Date(),
|
||||
};
|
||||
const tx = {
|
||||
$executeRaw: jest.fn().mockResolvedValue(1),
|
||||
channelReportField: {
|
||||
findMany: jest
|
||||
.fn()
|
||||
@@ -519,6 +520,7 @@ describe('ChannelsService', () => {
|
||||
async (sourceEntry) => {
|
||||
const prisma = createPrismaMock();
|
||||
const tx = {
|
||||
$executeRaw: jest.fn().mockResolvedValue(1),
|
||||
smsSignature: {
|
||||
findUnique: jest.fn().mockResolvedValue({ id: 'sig-1', tenantId: 'tenant-1', applicationId: 'app-1' }),
|
||||
update: jest.fn().mockResolvedValue({ id: 'sig-1', reportStatus: 'approved' }),
|
||||
@@ -601,6 +603,7 @@ describe('ChannelsService', () => {
|
||||
it('uses the enterprise-signature save time when creating an approved carrier task', async () => {
|
||||
const prisma = createPrismaMock();
|
||||
const tx = {
|
||||
$executeRaw: jest.fn().mockResolvedValue(1),
|
||||
smsSignature: {
|
||||
findUnique: jest.fn().mockResolvedValue({ id: 'sig-1', tenantId: 'tenant-1', applicationId: 'app-1' }),
|
||||
update: jest.fn().mockResolvedValue({ id: 'sig-1', reportStatus: 'approved' }),
|
||||
@@ -655,6 +658,7 @@ describe('ChannelsService', () => {
|
||||
it('changes a drainage report task without overwriting the signature report summary', async () => {
|
||||
const prisma = createPrismaMock();
|
||||
const tx = {
|
||||
$executeRaw: jest.fn().mockResolvedValue(1),
|
||||
smsSignature: {
|
||||
findUnique: jest.fn().mockResolvedValue({ id: 'sig-1', tenantId: 'tenant-1', applicationId: 'app-1' }),
|
||||
update: jest.fn(),
|
||||
@@ -699,6 +703,7 @@ describe('ChannelsService', () => {
|
||||
reportType: 'drainage',
|
||||
drainageItemId: 'drain-1',
|
||||
channelId: 'channel-1',
|
||||
carrier: null,
|
||||
status: 'approved',
|
||||
},
|
||||
]);
|
||||
@@ -1259,6 +1264,7 @@ describe('ChannelsService', () => {
|
||||
|
||||
const transactionCallback = prisma.$transaction.mock.calls[0][0];
|
||||
const tx = {
|
||||
$executeRaw: jest.fn().mockResolvedValue(1),
|
||||
smsChannelGroupItem: { deleteMany: jest.fn(), createMany: jest.fn() },
|
||||
smsChannelGroup: {
|
||||
update: jest.fn(),
|
||||
|
||||
Reference in New Issue
Block a user