| 321 | * Creates a mock batch-move-blocks operation entry for a single block. |
| 322 | */ |
| 323 | export function createMoveBlockEntry(blockId: string, options: MoveBlockOptions = {}): any { |
| 324 | const { |
| 325 | id = shortId(8), |
| 326 | workflowId = 'wf-1', |
| 327 | userId = 'user-1', |
| 328 | createdAt = Date.now(), |
| 329 | before = { x: 0, y: 0 }, |
| 330 | after = { x: 100, y: 100 }, |
| 331 | } = options |
| 332 | const timestamp = Date.now() |
| 333 | |
| 334 | return { |
| 335 | id, |
| 336 | createdAt, |
| 337 | operation: { |
| 338 | id: shortId(8), |
| 339 | type: 'batch-move-blocks', |
| 340 | timestamp, |
| 341 | workflowId, |
| 342 | userId, |
| 343 | data: { moves: [{ blockId, before, after }] }, |
| 344 | }, |
| 345 | inverse: { |
| 346 | id: shortId(8), |
| 347 | type: 'batch-move-blocks', |
| 348 | timestamp, |
| 349 | workflowId, |
| 350 | userId, |
| 351 | data: { moves: [{ blockId, before: after, after: before }] }, |
| 352 | }, |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | /** |
| 357 | * Creates a mock update-parent operation entry. |