@openbox/shared-types 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.eslintrc.js ADDED
@@ -0,0 +1,28 @@
1
+ module.exports = {
2
+ parser: '@typescript-eslint/parser',
3
+ parserOptions: {
4
+ project: 'tsconfig.json',
5
+ sourceType: 'module',
6
+ },
7
+ plugins: ['@typescript-eslint/eslint-plugin'],
8
+ extends: [
9
+ 'plugin:@typescript-eslint/recommended',
10
+ 'plugin:prettier/recommended',
11
+ ],
12
+ root: true,
13
+ env: {
14
+ node: true,
15
+ jest: true,
16
+ },
17
+ ignorePatterns: ['.eslintrc.js'],
18
+ rules: {
19
+ "prettier/prettier": [
20
+ "error",
21
+ { "printWidth": 120 }
22
+ ],
23
+ '@typescript-eslint/interface-name-prefix': 'off',
24
+ '@typescript-eslint/explicit-function-return-type': 'off',
25
+ '@typescript-eslint/explicit-module-boundary-types': 'off',
26
+ '@typescript-eslint/no-explicit-any': 'off',
27
+ },
28
+ };
package/.prettierrc ADDED
@@ -0,0 +1,5 @@
1
+ {
2
+ "singleQuote": true,
3
+ "trailingComma": "all",
4
+ "printWidth": 120
5
+ }
@@ -7,24 +7,33 @@ export type CompanyForReports = {
7
7
  nrc: string;
8
8
  };
9
9
 
10
- // /**
11
- // * Definición de structura de campos de country
12
- // */
13
- // export class Country {
14
- // id: number;
15
- // name: string;
16
- // }
17
- // /**
18
- // * Definición de structura de campos de state
19
- // */
20
- // export class State {
21
- // id: number;
22
- // name: string;
23
- // }
24
- // /**
25
- // * Definición de structura de campos de city
26
- // */
27
- // export class City {
28
- // id: number;
29
- // name: string;
30
- // }
10
+ /**
11
+ * Definición de structura de campos de country
12
+ */
13
+ export type Country = {
14
+ id: number;
15
+ name: string;
16
+ }
17
+ /**
18
+ * Definición de structura de campos de state
19
+ */
20
+ export type State = {
21
+ id: number;
22
+ name: string;
23
+ }
24
+ /**
25
+ * Definición de structura de campos de city
26
+ */
27
+ export type City = {
28
+ id: number;
29
+ name: string;
30
+ }
31
+
32
+ /**
33
+ * Campos para el objeto Sellingtypes
34
+ */
35
+ export type SellingTypes = {
36
+ id: string
37
+ name: string
38
+ isGravada: boolean
39
+ }
@@ -1,131 +1,131 @@
1
- // import { City, CompanyForReports, Country, State } from "../AuxiliarTypes";
2
- // import { SellingTypes } from "../Services";
1
+ import { City, CompanyForReports, Country, State } from "../AuxiliarTypes";
2
+ import { SellingTypes } from "../AuxiliarTypes";
3
3
 
4
- // /**
5
- // * Definición de estructura de respuesta de GET/
6
- // */
7
- // export class Customers{
8
- // id:string;
9
- // name:string;
10
- // shortName:string
11
- // isProvider:boolean;
12
- // isCustomer:boolean;
13
- // dui:string | null;
14
- // nrc:string | null;
15
- // nit:string | null;
16
- // giro:string | null;
17
- // isActiveCustomer:boolean;
18
- // isActiveProvider:boolean;
19
- // isUsedCustomer:boolean;
20
- // isUsedProvider:boolean;
21
- // createdAt:string;
22
- // personType:PersonType;
23
- // customerTypeNatural:CustomerTypeNatural | null;
24
- // }
4
+ /**
5
+ * Definición de estructura de respuesta de GET/
6
+ */
7
+ export type CustomersGET = {
8
+ id:string;
9
+ name:string;
10
+ shortName:string
11
+ isProvider:boolean;
12
+ isCustomer:boolean;
13
+ dui:string | null;
14
+ nrc:string | null;
15
+ nit:string | null;
16
+ giro:string | null;
17
+ isActiveCustomer:boolean;
18
+ isActiveProvider:boolean;
19
+ isUsedCustomer:boolean;
20
+ isUsedProvider:boolean;
21
+ createdAt:string;
22
+ personType:PersonType;
23
+ customerTypeNatural:CustomerTypeNatural | null;
24
+ }
25
25
 
26
- // /**
27
- // * Definición de estructura de respuesta de GET/ GET/:id de customer
28
- // */
29
- // export class Customer{
30
- // id:string;
31
- // name:string;
32
- // shortName:string
33
- // isProvider:boolean;
34
- // isCustomer:boolean;
35
- // dui:string | null;
36
- // nrc:string | null;
37
- // nit:string | null;
38
- // giro:string | null;
39
- // isActiveCustomer:boolean;
40
- // isActiveProvider:boolean;
41
- // isUsedCustomer:boolean;
42
- // isUsedProvider:boolean;
43
- // createdAt:string;
44
- // personType:PersonType;
45
- // customerTypeNatural:CustomerTypeNatural | null;
46
- // customerType: SellingTypes;
47
- // customerTaxerType:CustomerTaxerType;
48
- // customerBranches: CustomerBranches;
49
- // }
26
+ /**
27
+ * Definición de estructura de respuesta de GET/ GET/:id de customer
28
+ */
29
+ export type CustomerGID = {
30
+ id:string;
31
+ name:string;
32
+ shortName:string
33
+ isProvider:boolean;
34
+ isCustomer:boolean;
35
+ dui:string | null;
36
+ nrc:string | null;
37
+ nit:string | null;
38
+ giro:string | null;
39
+ isActiveCustomer:boolean;
40
+ isActiveProvider:boolean;
41
+ isUsedCustomer:boolean;
42
+ isUsedProvider:boolean;
43
+ createdAt:string;
44
+ personType:PersonType;
45
+ customerTypeNatural:CustomerTypeNatural | null;
46
+ customerType: SellingTypes;
47
+ customerTaxerType:CustomerTaxerType;
48
+ customerBranches: CustomerBranches;
49
+ }
50
50
 
51
- // export class CustomerBranches{
52
- // id:string;
53
- // name:string;
54
- // contactName:string;
55
- // contactInfo:ContactInfo;
56
- // address1:string;
57
- // address2:string | null;
58
- // createdAt:string;
59
- // default:boolean;
60
- // country:Country;
61
- // state:State;
62
- // city:City;
63
- // }
51
+ type CustomerBranches = {
52
+ id:string;
53
+ name:string;
54
+ contactName:string;
55
+ contactInfo:ContactInfo;
56
+ address1:string;
57
+ address2:string | null;
58
+ createdAt:string;
59
+ default:boolean;
60
+ country:Country;
61
+ state:State;
62
+ city:City;
63
+ }
64
64
 
65
- // /**
66
- // * Definición de estructura de campos de customerTributary
67
- // */
68
- // export class CustomerTributary{
69
- // dui:string;
70
- // nit:string;
71
- // nrc:string;
72
- // giro:string;
73
- // personType:PersonType;
74
- // customerTaxerType:CustomerTaxerType;
75
- // customerTypeNatural:CustomerTypeNatural | null;
76
- // }
65
+ /**
66
+ * Definición de estructura de campos de customerTributary
67
+ */
68
+ type CustomerTributary = {
69
+ dui:string;
70
+ nit:string;
71
+ nrc:string;
72
+ giro:string;
73
+ personType:PersonType;
74
+ customerTaxerType:CustomerTaxerType;
75
+ customerTypeNatural:CustomerTypeNatural | null;
76
+ }
77
77
 
78
- // /**
79
- // * Definición de estrructura de campos para reporte general de clientes
80
- // */
81
- // export class CustomersReportGeneral{
82
- // company:CompanyForReports;
83
- // name:string;
84
- // customers: Customers
85
- // }
78
+ /**
79
+ * Definición de estrructura de campos para reporte general de clientes
80
+ */
81
+ type CustomersReportGeneral = {
82
+ company:CompanyForReports;
83
+ name:string;
84
+ customers: CustomersGET
85
+ }
86
86
 
87
- // /**
88
- // * Definición de estrructura de campos para reporte general de clientes
89
- // */
90
- // export class CustomersReport{
91
- // company:CompanyForReports;
92
- // name:string;
93
- // customer: Customer
94
- // }
87
+ /**
88
+ * Definición de estrructura de campos para reporte general de clientes
89
+ */
90
+ type CustomersReport = {
91
+ company:CompanyForReports;
92
+ name:string;
93
+ customer: CustomerGID
94
+ }
95
95
 
96
- // export class AccountingCustomerIntegration{
97
- // accountingCatalogSales:string;
98
- // accountingCatalogCXC:string;
99
- // }
96
+ type AccountingCustomerIntegration = {
97
+ accountingCatalogSales:string;
98
+ accountingCatalogCXC:string;
99
+ }
100
100
 
101
- // /**
102
- // * Definición de estructura de personType
103
- // */
104
- // export class PersonType{
105
- // id:number;
106
- // name:string
107
- // }
101
+ /**
102
+ * Definición de estructura de personType
103
+ */
104
+ type PersonType = {
105
+ id:number;
106
+ name:string
107
+ }
108
108
 
109
- // /**
110
- // * Definición de estructura de customerTypeNatural
111
- // */
112
- // export class CustomerTypeNatural{
113
- // id:number;
114
- // name:string
115
- // }
109
+ /**
110
+ * Definición de estructura de customerTypeNatural
111
+ */
112
+ type CustomerTypeNatural = {
113
+ id:number;
114
+ name:string
115
+ }
116
116
 
117
- // /**
118
- // * Definición de estructura de customerTaxerType
119
- // */
120
- // export class CustomerTaxerType{
121
- // id:number;
122
- // name:string
123
- // }
117
+ /**
118
+ * Definición de estructura de customerTaxerType
119
+ */
120
+ type CustomerTaxerType = {
121
+ id:number;
122
+ name:string
123
+ }
124
124
 
125
- // /**
126
- // * Definición de campos de contacInfo
127
- // */
128
- // export class ContactInfo{
129
- // emails:string[];
130
- // phones:string[];
131
- // }
125
+ /**
126
+ * Definición de campos de contacInfo
127
+ */
128
+ type ContactInfo = {
129
+ emails:string[];
130
+ phones:string[];
131
+ }
package/Invoices/index.ts CHANGED
@@ -1,14 +1,14 @@
1
- // import { CompanyForReports } from "../AuxiliarTypes";
2
- // import { CustomerTypeNatural, PersonType } from "../Customers";
1
+ import { CompanyForReports } from "../AuxiliarTypes";
2
+ import { CustomerTypeNatural, PersonType } from "../Customers";
3
3
 
4
- // /**
5
- // * Definición de campos de invoicesZone
6
- // */
7
- // export class InvoicesZone{
8
- // id:string;
9
- // name:string;
10
- // active:boolean;
11
- // }
4
+ /**
5
+ * Definición de campos de invoicesZone
6
+ */
7
+ export class InvoicesZone{
8
+ id:string;
9
+ name:string;
10
+ active:boolean;
11
+ }
12
12
 
13
13
  // /**
14
14
  // * Definición de campos para invoicesDocuments
@@ -41,44 +41,44 @@
41
41
  // documentType:DocumentTypes;
42
42
  // }
43
43
 
44
- // /**
45
- // * Definición de los campos de docuemntTypes
46
- // */
47
- // export class DocumentTypes{
48
- // id:number;
49
- // name:string;
50
- // code:string;
51
- // includeInTaxes:boolean;
52
- // showForNonTaxers:boolean | null;
53
- // }
44
+ /**
45
+ * Definición de los campos de docuemntTypes
46
+ */
47
+ export class DocumentTypes{
48
+ id:number;
49
+ name:string;
50
+ code:string;
51
+ includeInTaxes:boolean;
52
+ showForNonTaxers:boolean | null;
53
+ }
54
54
 
55
- // /**
56
- // * Definición de campos y tipo de dato para paymentCondition
57
- // */
58
- // export class InvoicesPaymentConditions{
59
- // id:string;
60
- // name:string;
61
- // active:boolean
62
- // cashPayment:boolean
63
- // }
55
+ /**
56
+ * Definición de campos y tipo de dato para paymentCondition
57
+ */
58
+ export class InvoicesPaymentConditions{
59
+ id:string;
60
+ name:string;
61
+ active:boolean
62
+ cashPayment:boolean
63
+ }
64
64
 
65
- // /**
66
- // * Definición de campos para invoicesSeller
67
- // */
68
- // export class InvoicesSellers{
69
- // id:string;
70
- // name:string;
71
- // active:boolean
72
- // invoicesZone:InvoicesZone
73
- // }
65
+ /**
66
+ * Definición de campos para invoicesSeller
67
+ */
68
+ export class InvoicesSellers{
69
+ id:string;
70
+ name:string;
71
+ active:boolean
72
+ invoicesZone:InvoicesZone
73
+ }
74
74
 
75
- // /**
76
- // * Definición de campos y tipos para estados de ventas
77
- // */
78
- // export class InvoicesStatuses{
79
- // id:string;
80
- // name:string;
81
- // }
75
+ /**
76
+ * Definición de campos y tipos para estados de ventas
77
+ */
78
+ export class InvoicesStatuses{
79
+ id:string;
80
+ name:string;
81
+ }
82
82
 
83
83
  // /**
84
84
  // * Definición de campos y tipos para recurrencias
@@ -100,103 +100,103 @@
100
100
  // cashPaymentAccountingCatalog:string;
101
101
  // }
102
102
 
103
- // /**
104
- // * Definicion de campos y tipos recibidos en la respuesta GET / de ventas
105
- // */
106
- // export class Invoices{
107
- // id:string;
108
- // authorization:string;
109
- // sequence:string;
110
- // invoiceDate:string;
111
- // customerName:string;
112
- // ventaTotal:string;
113
- // documentType:DocumentTypes;
114
- // status:InvoicesStatuses;
115
- // invoiceRawDate:string;
116
- // }
103
+ /**
104
+ * Definicion de campos y tipos recibidos en la respuesta GET / de ventas
105
+ */
106
+ export class InvoicesGET{
107
+ id:string;
108
+ authorization:string;
109
+ sequence:string;
110
+ invoiceDate:string;
111
+ customerName:string;
112
+ ventaTotal:string;
113
+ documentType:DocumentTypes;
114
+ status:InvoicesStatuses;
115
+ invoiceRawDate:string;
116
+ }
117
117
 
118
- // /**
119
- // * Definicion de campos de invoice para GET/:id
120
- // */
121
- // export class Invoice{
122
- // id:string;
123
- // authorization:string;
124
- // sequence:string;
125
- // customerName:string;
126
- // customerAddress1:string;
127
- // customerAddress2:string;
128
- // customerCountry:string;
129
- // customerState:string;
130
- // customerCity:string;
131
- // customerDui:string;
132
- // customerNit:string;
133
- // customerNrc:string;
134
- // customerGiro:string;
135
- // sum:string;
136
- // iva:string;
137
- // ivaPercibido:string;
138
- // renta5:string;
139
- // renta10:string;
140
- // subtotal:string;
141
- // ivaRetenido:string;
142
- // ventasExentas:string;
143
- // ventasNoSujetas:string;
144
- // ventaTotal:string;
145
- // ventaTotalText:string;
146
- // origin:string;
147
- // createdAt:string;
148
- // invoiceDate:string;
149
- // paymentConditionName:string;
150
- // sellerName:string;
151
- // zoneName:string;
152
- // createEntry:boolean;
153
- // customer:InvoicesStatuses
154
- // customerBranch:InvoicesStatuses;
155
- // personType:PersonType;
156
- // customerTypeNatural:CustomerTypeNatural
157
- // documentType:DocumentTypes;
158
- // invoicesPaymentsCondition:InvoicesPaymentConditions;
159
- // invoicesSeller:InvoicesSellers;
160
- // invoicesZone:InvoicesZone;
161
- // status:InvoicesStatuses
162
- // accountingEntry:string | null;
163
- // invoiceRawDate:string | null;
164
- // details:InvoiceDetails[];
165
- // totals:InvoicesTotals[];
166
- // }
118
+ /**
119
+ * Definicion de campos de invoice para GET/:id
120
+ */
121
+ export class InvoiceGID{
122
+ id:string;
123
+ authorization:string;
124
+ sequence:string;
125
+ customerName:string;
126
+ customerAddress1:string;
127
+ customerAddress2:string;
128
+ customerCountry:string;
129
+ customerState:string;
130
+ customerCity:string;
131
+ customerDui:string;
132
+ customerNit:string;
133
+ customerNrc:string;
134
+ customerGiro:string;
135
+ sum:string;
136
+ iva:string;
137
+ ivaPercibido:string;
138
+ renta5:string;
139
+ renta10:string;
140
+ subtotal:string;
141
+ ivaRetenido:string;
142
+ ventasExentas:string;
143
+ ventasNoSujetas:string;
144
+ ventaTotal:string;
145
+ ventaTotalText:string;
146
+ origin:string;
147
+ createdAt:string;
148
+ invoiceDate:string;
149
+ paymentConditionName:string;
150
+ sellerName:string;
151
+ zoneName:string;
152
+ createEntry:boolean;
153
+ customer:InvoicesStatuses
154
+ customerBranch:InvoicesStatuses;
155
+ personType:PersonType;
156
+ customerTypeNatural:CustomerTypeNatural
157
+ documentType:DocumentTypes;
158
+ invoicesPaymentsCondition:InvoicesPaymentConditions;
159
+ invoicesSeller:InvoicesSellers;
160
+ invoicesZone:InvoicesZone;
161
+ status:InvoicesStatuses
162
+ accountingEntry:string | null;
163
+ invoiceRawDate:string | null;
164
+ details:InvoiceDetails[];
165
+ totals:InvoicesTotals[];
166
+ }
167
167
 
168
- // /**
169
- // * Definicion de campos y tipos para detaisl
170
- // */
171
- // export class InvoiceDetails{
172
- // service:string;
173
- // quantity:number;
174
- // unitPrice:number;
175
- // totalIvaPrice:number;
176
- // ivaPrice:number;
177
- // incIva:boolean
178
- // incRenta5:boolean
179
- // incRenta10:boolean
180
- // chargeDescription:string
181
- // ventaPrice:number
182
- // vNoSujeta:number
183
- // vExenta:number
184
- // vGravada:number
185
- // sellingType:number
186
- // renta10Price:number
187
- // renta5Price:number
188
- // price:number
189
- // }
168
+ /**
169
+ * Definicion de campos y tipos para detaisl
170
+ */
171
+ export class InvoiceDetails{
172
+ service:string;
173
+ quantity:number;
174
+ unitPrice:number;
175
+ totalIvaPrice:number;
176
+ ivaPrice:number;
177
+ incIva:boolean
178
+ incRenta5:boolean
179
+ incRenta10:boolean
180
+ chargeDescription:string
181
+ ventaPrice:number
182
+ vNoSujeta:number
183
+ vExenta:number
184
+ vGravada:number
185
+ sellingType:number
186
+ renta10Price:number
187
+ renta5Price:number
188
+ price:number
189
+ }
190
190
 
191
- // /**
192
- // * Definición de campos y tipos para invoicesTotals
193
- // */
194
- // export class InvoicesTotals{
195
- // name:string;
196
- // amount:number;
197
- // show:boolean;
198
- // style:string[]
199
- // }
191
+ /**
192
+ * Definición de campos y tipos para invoicesTotals
193
+ */
194
+ export class InvoicesTotals{
195
+ name:string;
196
+ amount:number;
197
+ show:boolean;
198
+ style:string[]
199
+ }
200
200
 
201
201
  // /**
202
202
  // * Definición de estructura de campos y tipos para reporte general de ventas
package/Services/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { CompanyForReports } from "../AuxiliarTypes";
1
+ import { CompanyForReports, SellingTypes } from "../AuxiliarTypes";
2
2
 
3
3
  /**
4
4
  * Definicion de tipo para la respuesta de services GET /
@@ -34,13 +34,10 @@ export type ServicesGeneralReport = {
34
34
  /**
35
35
  * Definición de estructura de campos del obejeto sellynTypes
36
36
  */
37
- export type ServicesSellingTypes = {
38
- id: string;
39
- name: string;
40
- includeInServices?: boolean;
41
- includeInCustomers?: boolean;
42
- isGravada: boolean;
43
- };
37
+ export interface ServicesSellingTypes extends SellingTypes {
38
+ includeInServices: boolean;
39
+ includeInCustomers: boolean;
40
+ };
44
41
 
45
42
  /**
46
43
  * Definición de estrucutra para la respuesta de GET/:id/integrations/:shortName y GET/integration para services
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // import * as Accounting from "./Accounting";
2
2
  // import * as AuxiliarTypes from "./AuxiliarTypes";
3
- // import * as Customers from "./Customers";
3
+ import * as Customers from "./Customers";
4
4
  // import * as Invoices from "./Invoices";
5
5
  // import * as Providers from "./Providers";
6
6
  import * as Services from "./Services";
@@ -8,7 +8,7 @@ import * as Services from "./Services";
8
8
  export {
9
9
  // Accounting,
10
10
  // AuxiliarTypes,
11
- // Customers,
11
+ Customers,
12
12
  // Invoices,
13
13
  // Providers,
14
14
  Services,
package/package.json CHANGED
@@ -1,9 +1,18 @@
1
1
  {
2
2
  "name": "@openbox/shared-types",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "Shared Types for Openbox Cloud. ",
5
5
  "types": "index.d.ts",
6
6
  "main": "index.d.ts",
7
7
  "author": "Openbox Developer Team",
8
- "license": "ISC"
8
+ "license": "ISC",
9
+ "dependencies": {},
10
+ "devDependencies": {
11
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
12
+ "@typescript-eslint/parser": "^5.4.0",
13
+ "eslint": "^8.2.0",
14
+ "eslint-config-prettier": "^8.3.0",
15
+ "eslint-plugin-prettier": "^4.0.0",
16
+ "prettier": "^2.4.1"
17
+ }
9
18
  }