File size: 2,094 Bytes
b9c7f0e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
using System;
using System.Collections.Generic;

namespace FlowAPI.Application.DTOs.Graph
{
    public class CreateGraphDto
    {
        public Guid UserId { get; set; }
        public string Title { get; set; } = string.Empty;
        public string? Description { get; set; }
    }

    public class UpdateGraphDto
    {
        public string? Title { get; set; }
        public string? Description { get; set; }
    }

    public class GraphResponseDto
    {
        public Guid Id { get; set; }
        public Guid UserId { get; set; }
        public string Title { get; set; } = string.Empty;
        public string? Description { get; set; }
        public DateTime CreatedAt { get; set; }
        public bool IsShared { get; set; } = false;
        public string Permission { get; set; } = "Owner"; // "Owner", "Read", "Edit"
    }

    public class FullGraphResponseDto : GraphResponseDto
    {
        public List<NodeDto> Nodes { get; set; } = new();
        public List<EdgeDto> Edges { get; set; } = new();
    }

    public class ShareGraphRequestDto
    {
        public string Email { get; set; } = string.Empty;
        public string Permission { get; set; } = "Read"; // "Read" or "Edit"
    }

    public class SharedUserResponseDto
    {
        public Guid Id { get; set; }
        public Guid SharedWithUserId { get; set; }
        public string Email { get; set; } = string.Empty;
        public string DisplayName { get; set; } = string.Empty;
        public string Permission { get; set; } = "Read";
    }

    public class NodeDto
    {
        public Guid Id { get; set; }
        public string Label { get; set; } = string.Empty;
        public double PosX { get; set; }
        public double PosY { get; set; }
        public string Type { get; set; } = "sketch";
        public int State { get; set; }
        public string? Decision { get; set; }
    }

    public class EdgeDto
    {
        public Guid Id { get; set; }
        public Guid FromNodeId { get; set; }
        public Guid ToNodeId { get; set; }
        public string? Condition { get; set; }
    }
}