@zdn3517/act-api 0.1.4 → 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/build/index.d.ts CHANGED
@@ -13,6 +13,7 @@ import type { GetUnitsResponse } from './types/components-schemas-unit';
13
13
  import type { Act, CreateActRequest, GetActsResponse, UpdateActRequest } from './types/components-schemas-act';
14
14
  import type { GetActsParams, GetEstimatesParams } from './types';
15
15
  import type { GetObjectsResponse } from './types/components-schemas-objects';
16
+ import type { GetContractsResponse } from './types/components-schemas-contracts';
16
17
  import type { Estimate, GetEstimatesResponse } from './types/components-schemas-estimates';
17
18
  export declare const getActAPI: () => {
18
19
  getHealth: <TData = axios.AxiosResponse<HealthResponse, any, {}>>(options?: AxiosRequestConfig) => Promise<TData>;
@@ -25,6 +26,7 @@ export declare const getActAPI: () => {
25
26
  updateAct: <TData = axios.AxiosResponse<Act, any, {}>>(actId: string, updateActRequest: UpdateActRequest, options?: AxiosRequestConfig) => Promise<TData>;
26
27
  deleteAct: <TData = axios.AxiosResponse<void, any, {}>>(actId: string, options?: AxiosRequestConfig) => Promise<TData>;
27
28
  getObjects: <TData = axios.AxiosResponse<GetObjectsResponse, any, {}>>(options?: AxiosRequestConfig) => Promise<TData>;
29
+ getContracts: <TData = axios.AxiosResponse<GetContractsResponse, any, {}>>(objectId: string, options?: AxiosRequestConfig) => Promise<TData>;
28
30
  getEstimates: <TData = axios.AxiosResponse<GetEstimatesResponse, any, {}>>(params: GetEstimatesParams, options?: AxiosRequestConfig) => Promise<TData>;
29
31
  getEstimateById: <TData = axios.AxiosResponse<Estimate, any, {}>>(estimateId: string, options?: AxiosRequestConfig) => Promise<TData>;
30
32
  };
@@ -38,5 +40,6 @@ export type GetActByIdResult = AxiosResponse<Act>;
38
40
  export type UpdateActResult = AxiosResponse<Act>;
39
41
  export type DeleteActResult = AxiosResponse<void>;
40
42
  export type GetObjectsResult = AxiosResponse<GetObjectsResponse>;
43
+ export type GetContractsResult = AxiosResponse<GetContractsResponse>;
41
44
  export type GetEstimatesResult = AxiosResponse<GetEstimatesResponse>;
42
45
  export type GetEstimateByIdResult = AxiosResponse<Estimate>;
@@ -10,7 +10,7 @@ export interface Act {
10
10
  uuid: string;
11
11
  contract_id: string;
12
12
  object_id?: string;
13
- estimate_id?: string;
13
+ estimate_id: string;
14
14
  title: string;
15
15
  description?: string;
16
16
  period_start: string;
@@ -8,7 +8,12 @@
8
8
  export interface ActItem {
9
9
  uuid: string;
10
10
  act_id: string;
11
- service_id: string;
11
+ /** @minLength 3 */
12
+ room_title?: string;
13
+ work_type: string;
12
14
  quantity: number;
13
- price: number;
15
+ unit: string;
16
+ unit_price: number;
17
+ note?: string;
18
+ total: number;
14
19
  }
@@ -9,7 +9,7 @@ export interface ActListItem {
9
9
  uuid: string;
10
10
  contract_id: string;
11
11
  object_id?: string;
12
- estimate_id?: string;
12
+ estimate_id: string;
13
13
  title: string;
14
14
  description?: string;
15
15
  period_start: string;
@@ -6,7 +6,16 @@
6
6
  * OpenAPI spec version: 0.1.0
7
7
  */
8
8
  export interface CreateActItem {
9
- service_id: string;
10
- quantity: number;
11
- price: number;
9
+ /** section or item */
10
+ kind: string;
11
+ /** Section title (for kind=section) */
12
+ title?: string;
13
+ /** @minLength 3 */
14
+ room_title?: string;
15
+ work_type?: string;
16
+ quantity?: number;
17
+ unit?: string;
18
+ unit_price?: number;
19
+ note?: string;
20
+ total?: number;
12
21
  }
@@ -8,7 +8,7 @@
8
8
  import type { CreateActItem } from './createActItem';
9
9
  export interface CreateActRequest {
10
10
  contract_id: string;
11
- estimate_id?: string;
11
+ estimate_id: string;
12
12
  title: string;
13
13
  description?: string;
14
14
  period_start: string;
@@ -8,7 +8,7 @@
8
8
  import type { CreateActItem } from './createActItem';
9
9
  export interface UpdateActRequest {
10
10
  contract_id: string;
11
- estimate_id?: string;
11
+ estimate_id: string;
12
12
  title: string;
13
13
  description?: string;
14
14
  period_start: string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export interface Contract {
9
+ uuid: string;
10
+ object_id: string;
11
+ customer_id: string;
12
+ contractor_id: string;
13
+ title?: string;
14
+ description?: string;
15
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { Contract } from './contract';
9
+ export interface GetContractsResponse {
10
+ contracts: Contract[];
11
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export * from './contract';
9
+ export * from './getContractsResponse';
@@ -7,8 +7,9 @@
7
7
  */
8
8
  export interface Estimate {
9
9
  uuid: string;
10
- object_id: string;
10
+ contract_id: string;
11
+ object_id?: string;
11
12
  title: string;
12
- description: string;
13
+ description?: string;
13
14
  is_confirmed: boolean;
14
15
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -10,12 +10,14 @@ export * from './actItem';
10
10
  export * from './actListItem';
11
11
  export * from './authRequest';
12
12
  export * from './authResponse';
13
+ export * from './contract';
13
14
  export * from './createActItem';
14
15
  export * from './createActRequest';
15
16
  export * from './errorResponse';
16
17
  export * from './estimate';
17
18
  export * from './getActsParams';
18
19
  export * from './getActsResponse';
20
+ export * from './getContractsResponse';
19
21
  export * from './getEstimatesParams';
20
22
  export * from './getEstimatesResponse';
21
23
  export * from './getObjectsResponse';
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ export * from './schema';
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Generated by orval v7.17.2 🍺
3
+ * Do not edit manually.
4
+ * Act API
5
+ * API specification for the Act service.
6
+ * OpenAPI spec version: 0.1.0
7
+ */
8
+ import type { ErrorResponse } from '../components-schemas-common/errorResponse';
9
+ export type Schema = ErrorResponse;
@@ -2,7 +2,7 @@ export type Act = {
2
2
  uuid: string;
3
3
  contract_id: string;
4
4
  object_id?: string;
5
- estimate_id?: string;
5
+ estimate_id: string;
6
6
  title: string;
7
7
  description?: string;
8
8
  period_start: string;
@@ -12,15 +12,19 @@ export type Act = {
12
12
  export type ActItem = {
13
13
  uuid: string;
14
14
  act_id: string;
15
- service_id: string;
15
+ room_title?: string;
16
+ work_type: string;
16
17
  quantity: number;
17
- price: number;
18
+ unit: string;
19
+ unit_price: number;
20
+ note?: string;
21
+ total: number;
18
22
  };
19
23
  export type ActListItem = {
20
24
  uuid: string;
21
25
  contract_id: string;
22
26
  object_id?: string;
23
- estimate_id?: string;
27
+ estimate_id: string;
24
28
  title: string;
25
29
  description?: string;
26
30
  period_start: string;
@@ -35,14 +39,34 @@ export type AuthRequest = {
35
39
  export type AuthResponse = {
36
40
  token: string;
37
41
  };
42
+ export type Contract = {
43
+ uuid: string;
44
+ object_id: string;
45
+ customer_id: string;
46
+ contractor_id: string;
47
+ title?: string;
48
+ description?: string;
49
+ };
38
50
  export type CreateActItem = {
39
- service_id: string;
40
- quantity: number;
41
- price: number;
51
+ /**
52
+ * section or item
53
+ */
54
+ kind: string;
55
+ /**
56
+ * Section title (for kind=section)
57
+ */
58
+ title?: string;
59
+ room_title?: string;
60
+ work_type?: string;
61
+ quantity?: number;
62
+ unit?: string;
63
+ unit_price?: number;
64
+ note?: string;
65
+ total?: number;
42
66
  };
43
67
  export type CreateActRequest = {
44
68
  contract_id: string;
45
- estimate_id?: string;
69
+ estimate_id: string;
46
70
  title: string;
47
71
  description?: string;
48
72
  period_start: string;
@@ -54,14 +78,18 @@ export type ErrorResponse = {
54
78
  };
55
79
  export type Estimate = {
56
80
  uuid: string;
57
- object_id: string;
81
+ contract_id: string;
82
+ object_id?: string;
58
83
  title: string;
59
- description: string;
84
+ description?: string;
60
85
  is_confirmed: boolean;
61
86
  };
62
87
  export type GetActsResponse = {
63
88
  acts: Array<ActListItem>;
64
89
  };
90
+ export type GetContractsResponse = {
91
+ contracts: Array<Contract>;
92
+ };
65
93
  export type GetEstimatesResponse = {
66
94
  estimates: Array<Estimate>;
67
95
  };
@@ -86,10 +114,18 @@ export type Unit = {
86
114
  };
87
115
  export type UpdateActRequest = {
88
116
  contract_id: string;
89
- estimate_id?: string;
117
+ estimate_id: string;
90
118
  title: string;
91
119
  description?: string;
92
120
  period_start: string;
93
121
  period_end: string;
94
122
  items: Array<CreateActItem>;
95
123
  };
124
+ export type WorkTypeSuggestion = {
125
+ work_type: string;
126
+ unit: string;
127
+ unit_price: number;
128
+ };
129
+ export type WorkTypeSuggestionsResponse = {
130
+ items: Array<WorkTypeSuggestion>;
131
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zdn3517/act-api",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "main": "build/index.js",
5
5
  "types": "build/index.d.ts",
6
6
  "scripts": {