Skip to content

Commit b905a4b

Browse files
committed
refactor(artifact,app,agent,db): rename dml_operation to dmlOperation across artifact schema, UI, agent transform, tests, and seed
- Artifact TestCase: dmlOperation (camelCase) - App UI/tests: use dmlOperation - Agent transform: output dmlOperation - Seed: use dmlOperation
1 parent d223b19 commit b905a4b

File tree

5 files changed

+31
-31
lines changed

5 files changed

+31
-31
lines changed

frontend/apps/app/components/SessionDetailPage/components/Output/components/Artifact/utils/__tests__/formatArtifactToMarkdown.test.ts

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe('formatArtifactToMarkdown', () => {
2121
title: 'Aircraft Registration and Update',
2222
description:
2323
'The operations manager opens the aircraft management screen, selects "New Registration", and enters the aircraft number, model, and seating capacity. Upon clicking the register button, the system verifies required field entry, confirms aircraft number uniqueness, checks that seating capacity is a positive number, then records it in the aircraft registry.',
24-
dml_operation: {
24+
dmlOperation: {
2525
testCaseId: 'dbeab333-1119-4392-8f9c-f8f0a21c1dc2',
2626
operation_type: 'INSERT',
2727
sql: `BEGIN;
@@ -45,7 +45,7 @@ COMMIT;`,
4545
title: 'View Flights by Aircraft',
4646
description:
4747
'The operations manager specifies an aircraft number on the search screen and searches with period and route conditions. The system extracts flights associated with the specified aircraft within the period and displays a list of flight names, departure times, arrival times, segments, assigned captain and first officer.',
48-
dml_operation: {
48+
dmlOperation: {
4949
testCaseId: 'd698dd19-82ea-48a7-bafe-b84ed1b3743d',
5050
operation_type: 'SELECT',
5151
sql: `SELECT f.flight_name, f.scheduled_departure, f.scheduled_arrival, f.origin, f.destination
@@ -78,7 +78,7 @@ ORDER BY f.scheduled_departure;`,
7878
title: 'Flight Schedule Creation',
7979
description:
8080
'The schedule coordinator enters flight name, departure time, arrival time, origin, and destination on the flight creation screen, then selects aircraft number and pilot IDs. The system validates the input values before saving.',
81-
dml_operation: {
81+
dmlOperation: {
8282
testCaseId: 'ca0dd9b5-f923-4f08-afb8-c441ad57fd0a',
8383
operation_type: 'INSERT',
8484
sql: `INSERT INTO flights (id, flight_name, origin, destination, scheduled_departure, scheduled_arrival, airplane_number, captain_id, first_officer_id)
@@ -98,7 +98,7 @@ VALUES ('fc70279f-04d3-41ea-97e9-3a1bb7ee358f', 'JAL101', 'Tokyo', 'Osaka', '202
9898
title: 'Recording Actual Flight Times',
9999
description:
100100
'After operation, the operations coordinator opens the target flight details screen and enters the start time (actual departure) and end time (actual arrival) then saves.',
101-
dml_operation: {
101+
dmlOperation: {
102102
testCaseId: '469fe899-d91e-4a2e-8ad4-756d5192185f',
103103
operation_type: 'UPDATE',
104104
sql: `UPDATE flights SET actual_start = '2024-06-01 08:05:00+09', actual_end = '2024-06-01 09:12:00+09'
@@ -127,7 +127,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
127127
title: 'Pilot (Captain/First Officer) Registration',
128128
description:
129129
'HR or operations manager selects "New Registration" from the pilot roster screen and enters pilot ID, name, and phone number then saves.',
130-
dml_operation: {
130+
dmlOperation: {
131131
testCaseId: 'aad974e0-de84-4e49-b1c3-998a3d7a9905',
132132
operation_type: 'INSERT',
133133
sql: `INSERT INTO pilots (pilot_id, name, phone) VALUES
@@ -163,7 +163,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
163163
title: 'Referential Integrity Verification',
164164
description:
165165
'Verify that the system properly returns errors when attempting to delete aircraft with existing flights or pilots assigned to flights.',
166-
dml_operation: {
166+
dmlOperation: {
167167
testCaseId: 'dbeab333-1119-4392-8f9c-f8f0a21c1dc2',
168168
operation_type: 'DELETE',
169169
sql: `DELETE FROM airplanes WHERE airplane_number = 'JA330C';`,
@@ -536,7 +536,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
536536
{
537537
title: 'Test Use Case',
538538
description: 'Use case description',
539-
dml_operation: {
539+
dmlOperation: {
540540
testCaseId: 'uc-1',
541541
operation_type: 'UPDATE',
542542
sql: 'UPDATE users SET status = $1',
@@ -569,7 +569,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
569569
{
570570
title: 'Test Use Case',
571571
description: 'Use case description',
572-
dml_operation: {
572+
dmlOperation: {
573573
testCaseId: 'uc-1',
574574
operation_type: 'DELETE',
575575
sql: 'DELETE FROM users WHERE id = $1',
@@ -601,7 +601,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
601601
{
602602
title: 'Test Use Case',
603603
description: 'Use case description',
604-
dml_operation: {
604+
dmlOperation: {
605605
testCaseId: 'uc-1',
606606
operation_type: 'SELECT',
607607
sql: 'SELECT * FROM users',
@@ -640,7 +640,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
640640
{
641641
title: 'Test Use Case',
642642
description: 'Use case description',
643-
dml_operation: {
643+
dmlOperation: {
644644
testCaseId: 'uc-1',
645645
operation_type: 'INSERT',
646646
sql: 'INSERT INTO users (email) VALUES ($1)',
@@ -678,7 +678,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
678678
{
679679
title: 'Test Use Case',
680680
description: 'Use case description',
681-
dml_operation: {
681+
dmlOperation: {
682682
testCaseId: 'uc-1',
683683
operation_type: 'INSERT',
684684
sql: 'INSERT INTO orders (user_id, total) VALUES ($1, $2)',
@@ -723,7 +723,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
723723
{
724724
title: 'Test Use Case',
725725
description: 'Use case description',
726-
dml_operation: {
726+
dmlOperation: {
727727
testCaseId: 'uc-1',
728728
operation_type: 'SELECT',
729729
sql: 'SELECT * FROM products',
@@ -754,7 +754,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
754754
{
755755
title: 'Test Use Case',
756756
description: 'Use case description',
757-
dml_operation: {
757+
dmlOperation: {
758758
testCaseId: 'uc-1',
759759
operation_type: 'SELECT',
760760
sql: ' \n SELECT * FROM users \n ',
@@ -788,7 +788,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
788788
{
789789
title: 'Single Operation Use Case',
790790
description: 'This use case has one operation',
791-
dml_operation: {
791+
dmlOperation: {
792792
testCaseId: 'uc-1',
793793
operation_type: 'INSERT',
794794
sql: 'INSERT INTO logs (message) VALUES ($1)',
@@ -822,7 +822,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
822822
{
823823
title: 'No Operations Use Case',
824824
description: 'This use case has no operations yet',
825-
dml_operation: {
825+
dmlOperation: {
826826
testCaseId: 'dummy',
827827
operation_type: 'SELECT',
828828
sql: 'SELECT 1',
@@ -855,7 +855,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
855855
{
856856
title: 'User Registration',
857857
description: 'Register new users',
858-
dml_operation: {
858+
dmlOperation: {
859859
testCaseId: 'dummy',
860860
operation_type: 'SELECT',
861861
sql: 'SELECT 1',
@@ -865,7 +865,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
865865
{
866866
title: 'User Login',
867867
description: 'Authenticate users',
868-
dml_operation: {
868+
dmlOperation: {
869869
testCaseId: 'dummy',
870870
operation_type: 'SELECT',
871871
sql: 'SELECT 1',
@@ -875,7 +875,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
875875
{
876876
title: 'Password Reset',
877877
description: 'Reset user password',
878-
dml_operation: {
878+
dmlOperation: {
879879
testCaseId: 'dummy',
880880
operation_type: 'SELECT',
881881
sql: 'SELECT 1',
@@ -908,7 +908,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
908908
{
909909
title: 'UC 1.1',
910910
description: 'First use case',
911-
dml_operation: {
911+
dmlOperation: {
912912
testCaseId: 'dummy',
913913
operation_type: 'SELECT',
914914
sql: 'SELECT 1',
@@ -918,7 +918,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
918918
{
919919
title: 'UC 1.2',
920920
description: 'Second use case',
921-
dml_operation: {
921+
dmlOperation: {
922922
testCaseId: 'dummy',
923923
operation_type: 'SELECT',
924924
sql: 'SELECT 1',
@@ -935,7 +935,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
935935
{
936936
title: 'UC 2.1',
937937
description: 'Third use case',
938-
dml_operation: {
938+
dmlOperation: {
939939
testCaseId: 'dummy',
940940
operation_type: 'SELECT',
941941
sql: 'SELECT 1',
@@ -999,7 +999,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
999999
{
10001000
title: 'All Operations',
10011001
description: 'Test all DML operation types',
1002-
dml_operation: operations[0]!,
1002+
dmlOperation: operations[0]!,
10031003
},
10041004
],
10051005
},
@@ -1031,7 +1031,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
10311031
{
10321032
title: 'Long Use Case',
10331033
description: longDescription,
1034-
dml_operation: {
1034+
dmlOperation: {
10351035
testCaseId: 'uc-1',
10361036
operation_type: 'SELECT',
10371037
sql: longSQL,
@@ -1070,7 +1070,7 @@ WHERE id = 'fc70279f-04d3-41ea-97e9-3a1bb7ee358f';`,
10701070
{
10711071
title: 'Use Case [with brackets]',
10721072
description: 'Description with `code` and <tags>',
1073-
dml_operation: {
1073+
dmlOperation: {
10741074
testCaseId: 'uc-1',
10751075
operation_type: 'SELECT',
10761076
sql: 'SELECT * FROM users WHERE name = "John\'s"',

frontend/apps/app/components/SessionDetailPage/components/Output/components/Artifact/utils/formatArtifactToMarkdown.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function formatTestCase(
1212
sections.push('')
1313
sections.push(testCase.description)
1414

15-
const operation = testCase.dml_operation
15+
const operation = testCase.dmlOperation
1616
sections.push('')
1717

1818
// Format as heading with operation type and description

frontend/internal-packages/agent/src/chat/workflow/utils/transformWorkflowStateToArtifact.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ const mapTestCasesToRequirements = (
6060
): {
6161
title: string
6262
description: string
63-
dml_operation: DmlOperation
63+
dmlOperation: DmlOperation
6464
} => ({
6565
title: testcase.title,
6666
description: testcase.description,
67-
dml_operation: testcase.dmlOperation,
67+
dmlOperation: testcase.dmlOperation,
6868
})
6969

7070
/**

frontend/internal-packages/artifact/src/schemas/artifact.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const dmlOperationSchema = v.object({
2020
export const testCaseSchema = v.object({
2121
title: v.string(),
2222
description: v.string(),
23-
dml_operation: dmlOperationSchema,
23+
dmlOperation: dmlOperationSchema,
2424
})
2525

2626
// Base requirement schema properties

frontend/internal-packages/db/supabase/seed.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ begin
553553
{
554554
"title": "User Registration",
555555
"description": "New users can create an account",
556-
"dml_operation": {
556+
"dmlOperation": {
557557
"testCaseId": "UC001",
558558
"operation_type": "INSERT",
559559
"sql": "INSERT INTO users (email, name) VALUES (''john@example.com'', ''John Doe'')",
@@ -575,7 +575,7 @@ begin
575575
{
576576
"title": "Create Blog Post",
577577
"description": "Users can create new blog posts",
578-
"dml_operation": {
578+
"dmlOperation": {
579579
"testCaseId": "UC002",
580580
"operation_type": "INSERT",
581581
"sql": "INSERT INTO posts (user_id, title, content, published) VALUES (''user-uuid'', ''My First Post'', ''Content here...'', false)",
@@ -586,7 +586,7 @@ begin
586586
{
587587
"title": "Publish Blog Post",
588588
"description": "Users can publish their draft posts",
589-
"dml_operation": {
589+
"dmlOperation": {
590590
"testCaseId": "UC003",
591591
"operation_type": "UPDATE",
592592
"sql": "UPDATE posts SET published = true WHERE id = ''post-uuid''",

0 commit comments

Comments
 (0)