-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathschema.cds
73 lines (65 loc) · 2.5 KB
/
schema.cds
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
71
72
73
using { cuid, managed, sap.common.CodeList } from '@sap/cds/common';
namespace acme.incmgt;
/**
* Incidents created by Customers.
*/
entity Incidents : cuid, managed {
title : String @title : 'Title';
urgency : String @title: 'Urgency' enum {
high @title: 'High';
medium @title: 'Medium';
low @title: 'Low';
};
status : String @title: 'Status' enum {
new @title: 'New' @description: 'An incident that has been logged but not yet worked on.';
assigned @title: 'Assigned' @description: 'Incident has been asssigned to a technician';
![in process] @title: 'In Process' @description: 'Case is being actively worked on';
![on hold] @title: 'On Hold' @description: 'Incident has been put on hold';
resolved @title: 'Resolved' @description: 'Resolution has been found';
closed @title: 'Closed' @description: 'Incident was acknowleged closed by end user';
};
conversation : Composition of many {
key timestamp : DateTime @title: 'Time';
author : String(77) @title: 'Author' @cds.on.create: $user;
message : String(300) @title: 'Message';
};
service : Association to Appointments;
}
/**
* Service Workers to assign to fix the causes for Incidents
*/
entity ServiceWorkers {
key ID : String; // human-readable ID, like SAP's D/C/I numbers
name : String;
role : String;
appointments : Association to many Appointments on appointments.worker = $self;
}
/**
* All the Appointments of Service Workers.
* Used to find availabilities in a worker's calendar to block
* for fixing the causes for an Incident, which in turn would
* be entered as a new Appointment.
*/
entity Appointments {
key ID : String;
start_date : Date @title : 'Start Date';
start_time : Time @title : 'Start Time';
end_date : Date @title : 'End Date';
end_time : Time @title : 'End Time';
title : String @title : 'Title';
project : String @title : 'Project';
type : String @title : 'Type';
calendar : Association to TeamCalendar;
worker : Association to ServiceWorkers;
}
/**
* Team Calendars of service units aggregating all Appointments of
* all Service Workes in that unit per year.
*/
entity TeamCalendar {
key year : Integer;
entries : Composition of many Appointments on entries.calendar = $self;
}
type EMailAddress : String;
type PhoneNumber : String;
type City : String;