Require a verified viewer email before creating a rights request and validate the free-text fields with the same SafeText bounds the console uses, so this public portal mutation stays safe and bounded. Move myRightsRequests onto the base Query, drop the now-dead count loaders, and order the RECTIFICATION enum value before PORTABILITY so the Postgres sort order matches RightsRequestTypes(). Harden the v2 kit primitives: SegmentedControl keeps equal-width cards (auto-fill), preserves its selection when the active card is toggled, and forwards an accessible name; Field associates its label and error by id/aria instead of wrapping the control in a label. Give the type group an accessible name, require the name field for non-complaint types, use a timezone-stable reference year, drop the underreporting header count, and neutralize the response-deadline copy. Signed-off-by: Émile Ré <emile@probo.com>
72 lines
2.0 KiB
GraphQL
72 lines
2.0 KiB
GraphQL
enum RightsRequestType
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.RightsRequestType") {
|
|
ACCESS @goEnum(value: "go.probo.inc/probo/pkg/coredata.RightsRequestTypeAccess")
|
|
DELETION
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.RightsRequestTypeDeletion")
|
|
RECTIFICATION
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.RightsRequestTypeRectification"
|
|
)
|
|
PORTABILITY
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.RightsRequestTypePortability"
|
|
)
|
|
OBJECTION
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.RightsRequestTypeObjection")
|
|
COMPLAINT
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.RightsRequestTypeComplaint")
|
|
}
|
|
|
|
enum RightsRequestState
|
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.RightsRequestState") {
|
|
TODO @goEnum(value: "go.probo.inc/probo/pkg/coredata.RightsRequestStateTodo")
|
|
IN_PROGRESS
|
|
@goEnum(
|
|
value: "go.probo.inc/probo/pkg/coredata.RightsRequestStateInProgress"
|
|
)
|
|
DONE @goEnum(value: "go.probo.inc/probo/pkg/coredata.RightsRequestStateDone")
|
|
REJECTED
|
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.RightsRequestStateRejected")
|
|
}
|
|
|
|
type RightsRequest implements Node {
|
|
id: ID!
|
|
requestType: RightsRequestType!
|
|
requestState: RightsRequestState!
|
|
dataSubject: String
|
|
contact: String
|
|
details: String
|
|
deadline: Datetime
|
|
actionTaken: String
|
|
createdAt: Datetime!
|
|
updatedAt: Datetime!
|
|
}
|
|
|
|
type RightsRequestConnection {
|
|
edges: [RightsRequestEdge!]!
|
|
pageInfo: PageInfo!
|
|
}
|
|
|
|
type RightsRequestEdge {
|
|
cursor: CursorKey!
|
|
node: RightsRequest!
|
|
}
|
|
|
|
extend type Mutation {
|
|
# Submit a data subject request. Requires a verified viewer; the request is
|
|
# attributed to the viewer's email, so no NDA gate applies.
|
|
createRightsRequest(
|
|
input: CreateRightsRequestInput!
|
|
): CreateRightsRequestPayload! @authentication(required: PRESENT)
|
|
}
|
|
|
|
input CreateRightsRequestInput {
|
|
requestType: RightsRequestType!
|
|
dataSubject: String
|
|
details: String
|
|
}
|
|
|
|
type CreateRightsRequestPayload {
|
|
rightsRequestEdge: RightsRequestEdge!
|
|
}
|