-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsheets.model.ts
70 lines (59 loc) · 1.76 KB
/
sheets.model.ts
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
// Models based on the headers of each sheet tab
export enum ProductKeys {
id = "Product Id",
description = "Product Description DE",
unit = "Product Unit",
}
export enum OrderKeys {
run = "Run",
invoiceId = "Invoice ID",
invoiceDate = "Invoice Date",
executionDate = "Execution Date",
customerId = "Customer",
}
// Prefixes of the item keys, the suffix is an increasing number (1,2,3 ...)
export enum ItemPrefixKeys {
productId = "Product ",
amount = "Amount ",
price = "Price ",
}
export enum CustomerKeys {
id = "Customer Id",
customerName = "Customer Name",
businessName = "Business Name",
address = "Address",
cp = "CP",
country = "Country",
city = "City",
vatId = "Vat ID",
vatProcedure = "Vat Procedure",
}
export enum CompanyKeys {
name = "Name",
address = "Address",
cp = "CP",
city = "City",
country = "Country",
vatId = "Vat ID",
telephone = "Telephone",
mail = "Mail",
bank = "Bank",
iban = "IBAN",
bic = "BIC",
}
export enum VatProcedure {
reverseCharge = "Reverse Charge",
kleinunternehmer = "Kleinunternehmerregelung",
}
type ProductKeysP = keyof typeof ProductKeys;
export type Product = { [key in ProductKeysP]?: string }; // Single product details
type ItemPrefixKeysP = keyof typeof ItemPrefixKeys;
export type Item = { [key in ItemPrefixKeysP]?: string }; // Item price and amount related to a product
type OrderKeysP = keyof typeof OrderKeys;
export type Order = {
[key in OrderKeysP]?: string;
} & { items: Item[]; total?: string }; // Order details with list of items and total value
type CustomerKeysP = keyof typeof CustomerKeys;
export type Customer = { [key in CustomerKeysP]?: string };
type CompanyKeysP = keyof typeof CompanyKeys;
export type Company = { [key in CompanyKeysP]?: string };