-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
342 lines (329 loc) · 11.7 KB
/
Copy pathtypes.ts
File metadata and controls
342 lines (329 loc) · 11.7 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
export type DateRange = {
startDate: Date;
endDate: Date;
};
export type SpreadsheetRow = {
row: number;
date: string | number; // Column 0: date
client: string; // Column 1: client
project: string; // Column 2: project
description: string; // Column 3: description
hours: number; // Column 4: hours
pricePerHour: number; // Column 5: price per hour
total: number; // Column 6: total (ignored)
billed: boolean; // Column 7: billed
};
export type SpreadsheetTable = SpreadsheetRow[];
export type CashCtrlAnswer<T> = {
total: number;
data: T;
};
export type CashCtrlWriteResponse = {
success: boolean;
message?: string;
insertId?: number;
errors?: Record<string, string[]>;
};
export type CashCtrlPerson = {
id: number; // Unique identifier for the person
created: string; // Creation date and time
createdBy: string; // Email of the creator
lastUpdated: string; // Last updated date and time
lastUpdatedBy: string; // Email of the last updater
categoryId: number; // ID of the category
thumbnailFileId: null; // Thumbnail file ID or null
categoryDisplay: string; // Display name for the category
title: string; // Title of the person
titleId: number; // ID of the title
titleSentence: string; // Formal address
gender: string; // Gender of the person
nr: string; // Unique number for the person
name: string; // Full name of the person
firstName: string; // First name
lastName: string; // Last name
company: string; // Company name
position: string | null; // Position in the company or null
industry: string; // Industry of the company
department: string | null; // Department or null
language: string | null; // Preferred language or null
bankData: string | null; // Bank data or null
iban: string | null; // IBAN or null
bic: string | null; // BIC or null
vatUid: string | null; // VAT UID or null
dateBirth: string | null; // Date of birth or null
discountPercentage: number | null; // Discount percentage or null
discountInherited: number | null; // Inherited discount or null
discountEffective: number | null; // Effective discount or null
notes: string | null; // Additional notes or null
emailWork: string; // Work email
emailPrivate: string | null; // Private email or null
phoneWork: string | null; // Work phone or null
phonePrivate: string | null; // Private phone or null
mobileWork: string | null; // Work mobile or null
mobilePrivate: string | null; // Private mobile or null
url: string; // Website URL
address: string; // Address
zip: string; // ZIP code
city: string; // City
country: string; // Country code
superiorId: number | null; // ID of the superior or null
superiorName: string | null; // Name of the superior or null
color: string | null; // Color or null
altName: string | null; // Alternative name or null
custom: string; // Custom field
attachmentCount: number; // Number of attachments
isInactive: boolean; // Indicates if the person is inactive
};
export type CashCtrlStatus = {
id: number;
created: string | null;
createdBy: string;
lastUpdated: string;
lastUpdatedBy: string;
categoryId: number;
actionId: string;
name: string; // Assuming this is a string representation of a localized value
icon: string;
pos: number;
text: string | null;
value: string | null;
iconCls: string | null;
isBook: boolean;
isRemoveStock: boolean;
isAddStock: boolean;
isClosed: boolean;
};
export type CashCtrlBookTemplate = {
id: number;
created: string;
createdBy: string;
lastUpdated: string;
lastUpdatedBy: string;
categoryId: number;
accountId: number;
taxId: number | null;
name: string; // Assuming this is a string representation of a localized value
pos: number;
text: string | null;
value: string | null;
isAllowTax: boolean;
};
export type CashCtrlCategory = {
id: number;
created: string;
createdBy: string;
lastUpdated: string;
lastUpdatedBy: string;
accountId: number;
currencyId: number | null;
status: CashCtrlStatus[];
bookTemplates: CashCtrlBookTemplate[];
sequenceNrId: number;
templateId: number | null;
sentStatusId: number | null;
responsiblePersonId: number | null;
roundingId: number | null;
fileId: number | null;
attachments: { file: string }[]; // Adjust export type as necessary
nameSingular: string; // Assuming this is a string representation of a localized value
namePlural: string; // Assuming this is a string representation of a localized value
type: string;
bookType: string;
addressType: string;
dueDays: number | null;
header: string | null;
footer: string | null;
mail: string | null;
pos: number;
text: string | null;
typeName: string | null;
defaultStatusId: number;
responsiblePersonName: string | null;
value: string;
sequenceNrIdInherited: number;
isFree: boolean;
isInactive: boolean;
hasDueDays: boolean;
isDisplayPrices: boolean;
isDisplayItemGross: boolean;
isSwitchRecipient: boolean;
};
// types.ts
export type CashCtrlOrder = {
id: number; // Unique identifier for the invoice
created: string; // Creation date and time
createdBy: string; // Email of the creator
lastUpdated: string; // Last updated date and time
lastUpdatedBy: string; // Email of the last updater
associateId: number; // ID of the associated person
items: string|Partial<CashCtrlItem>[]; // JSON encoded Partial<CashCtrlItem>[]
associateName: string; // Name of the associated person
responsiblePersonId: number | null; // ID of the responsible person or null
responsiblePersonName: string | null; // Name of the responsible person or null
accountId: number; // ID of the account
account: string; // Account details in multiple languages
categoryId: number; // ID of the category
actionId: string; // Action ID (if applicable)
groupId: number; // Group ID
previousId: number | null; // ID of the previous invoice or null
statusId: number; // Status ID
type: string; // export type of the invoice (e.g., SALES)
bookType: string; // export type of booking (e.g., DEBIT)
statusName: string; // Status name in multiple languages
sentStatusId: number; // Sent status ID
roundingId: number | null; // Rounding ID or null
icon: string; // Icon representation
nameSingular: string; // Singular name in multiple languages
namePlural: string; // Plural name in multiple languages
date: string; // Invoice date
dateDue: string; // Due date
nr: string; // Invoice number
description: string; // Description of the invoice
notes: string | null; // Additional notes or null
dueDays: number; // Number of days until due
currencyId: number | null; // Currency ID or null
currencyRate: number; // Currency exchange rate
discountPercentage: number | null; // Discount percentage or null
currencyCode: string; // Currency code (e.g., CHF)
subTotal: number; // Subtotal amount
tax: number; // Tax amount
total: number; // Total amount
open: boolean | null; // Open status or null
groupOpen: boolean | null; // Group open status or null
dateDeliveryStart: string | null; // Delivery start date or null
dateDeliveryEnd: string | null; // Delivery end date or null
dateLastBooked: string; // Last booked date
language: "DE" | "EN" | "FR" | "IT" | null; // Language preference or null
recurrence: string | null; // Recurrence information or null
startDate: string | null; // Start date or null
endDate: string | null; // End date or null
daysBefore: number | null; // Days before notification or null
notifyType: string | null; // Notification export type or null
notifyPersonId: number | null; // ID of the notified person or null
notifyUserId: number | null; // ID of the notified user or null
notifyEmail: string | null; // Email for notifications or null
attachmentCount: number; // Number of attachments
allocationCount: number | null; // Allocation count or null
costCenterIds: number[] | null; // Array of cost center IDs or null
custom: string; // Custom field
sent: boolean | null; // Sent status or null
sentBy: string | null; // Email of the sender or null
downloaded: boolean | null; // Downloaded status or null
downloadedBy: string | null; // Email of the downloader or null
costCenterNumbers: string | null; // Cost center numbers or null
isBook: boolean; // Indicates if it is booked
isRemoveStock: boolean; // Indicates if stock is removed
isAddStock: boolean; // Indicates if stock is added
isClosed: boolean; // Indicates if the invoice is closed
hasDueDays: boolean; // Indicates if there are due days
isDisplayItemGross: boolean; // Indicates if gross items are displayed
isRecurring: boolean; // Indicates if it is a recurring invoice
isCreditNote: boolean; // Indicates if it is a credit note
};
export type CashCtrlItem = {
id: number;
created: string; // ISO 8601 date string
createdBy: string;
lastUpdated: string; // ISO 8601 date string
lastUpdatedBy: string;
orderId: number;
inventoryId: number;
accountId: number;
taxId: number;
unitId: number;
unitName: string; // XML-like string
attachments: { file: string }[]; // Adjust export type as necessary
allocations: { id: number }[]; // Adjust export type as necessary
type: "ARTICLE" | "TEXT" | "PAGEBREAK" | "SUBTOTAL" | "TITLE" | "OPTIONTOTAL";
articleNr: string;
quantity: number;
name: string;
description: string;
unitPrice: number;
discountPercentage: number | null; // Can be null
pos: number;
taxName: string; // XML-like string
taxAmount: number;
defaultCurrencyUnitPrice: number;
netUnitPrice: number;
defaultCurrencyNetUnitPrice: number;
taxRate: number;
taxCalcType: "NET" | "GROSS"; // Fixed string type
grossTotal: number;
taxTotal: number;
netTotal: number;
defaultCurrencyNetTotal: number;
defaultCurrencyGrossTotal: number;
discountEffective: number | null; // Can be null
discountInherited: number | null; // Can be null
isOptional: boolean;
isInventoryArticle: boolean;
};
export type CashCtrlAccount = {
id: number;
created: string; // ISO 8601 date string
createdBy: string;
lastUpdated: string; // ISO 8601 date string
lastUpdatedBy: string;
categoryId: number;
categoryDisplay: string; // XML-like string
accountClass: string;
taxId: number | null;
taxName: string | null;
currencyId: number | null;
currencyCode: string;
number: string;
name: string; // XML-like string
custom: string | null; // Adjust export type as necessary
notes: string | null;
attachmentCount: number;
allocationCount: number;
costCenterIds: number[] | null;
costCenterNumbers: string[] | null;
openingAmount: number;
endAmount: number;
targetMin: number | null;
targetMax: number | null;
targetDisplay: string | null;
defaultCurrencyOpeningAmount: number;
defaultCurrencyEndAmount: number;
isInactive: boolean;
};
export type CashCtrlAccountCategory = {
id: number;
created: string; // ISO 8601 date string
createdBy: string;
lastUpdated: string; // ISO 8601 date string
lastUpdatedBy: string;
parentId: number;
accountClass: string;
number: string;
name: string; // XML-like string
fullName: string; // XML-like string
isSystem: boolean;
};
export type CashCtrlUnit = {
id: number;
name: string; // XML-like string
};
export type CashCtrlTax = {
id: number;
created: string; // ISO 8601 date string
createdBy: string;
lastUpdated: string; // ISO 8601 date string
lastUpdatedBy: string;
accountId: number;
name: string; // XML-like string
documentName: string; // XML-like string
calcType: "NET" | "GROSS"; // Assuming these are the only possible values
percentage: number;
percentageFlat: number | null;
text: string;
accountDisplay: string; // XML-like string
listCls: string;
value: string;
isInactive: boolean;
isPreTax: boolean;
isFlat: boolean;
isGrossCalcType: boolean;
};