@tagsamurai/fats-api-services 1.0.0-alpha.251 → 1.0.0-alpha.252

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tagsamurai/fats-api-services",
3
- "version": "1.0.0-alpha.251",
3
+ "version": "1.0.0-alpha.252",
4
4
  "author": "developer.tagsamurai",
5
5
  "description": "Fixed Asset Tag Samurai Services Library",
6
6
  "module": "./api-services.es.js",
@@ -0,0 +1,85 @@
1
+ import { QueryParams } from '../types/fetchResponse.type';
2
+ export interface BaseFilterQueryParams extends QueryParams {
3
+ page: number;
4
+ limit: number;
5
+ sortOrder: number;
6
+ sortBy: string;
7
+ search: string;
8
+ }
9
+ export interface GetAssetNameListQueryParams extends BaseFilterQueryParams {
10
+ name: string[];
11
+ aliasCode: string[];
12
+ category: number[];
13
+ measurement: string[];
14
+ brands: number[];
15
+ models: number[];
16
+ depreciationGroup: number[];
17
+ accountCode: string[];
18
+ accountName: string[];
19
+ tagType: string[];
20
+ group: number[];
21
+ status: string[];
22
+ updatedAt: number[];
23
+ isActive: boolean[];
24
+ viewBy: string[];
25
+ maintenanceAuditStatus: string[];
26
+ rfidExist: string[];
27
+ qrExist: string[];
28
+ }
29
+ export interface GetAssetNameListOptionsQueryParams extends QueryParams {
30
+ nameOptions: boolean;
31
+ measurementOptions: boolean;
32
+ brandsOptions: boolean;
33
+ modelOptions: boolean;
34
+ depreciationGroupOptions: boolean;
35
+ accountCodeOptions: boolean;
36
+ accountNameOptions: boolean;
37
+ aliasCodeOptions: boolean;
38
+ }
39
+ export type GetAssetNameDropdownQueryParams = GetAssetNameListQueryParams;
40
+ export interface GetUnpairedAssetNameListQueryParams extends BaseFilterQueryParams {
41
+ name: string[];
42
+ excludeKey: number[];
43
+ tagType: string[];
44
+ group: number[];
45
+ }
46
+ export type GetUnpairedAssetNameListOptionsQueryParams = GetAssetNameListOptionsQueryParams;
47
+ export type GetAssetNameBrands = {
48
+ viewBy: 'models' | 'brands';
49
+ };
50
+ export type GetAssetNameAssetsQueryParams = GetAssetNameListQueryParams;
51
+ export type GetAssetNameAssetsOptionsQueryParams = GetAssetNameListOptionsQueryParams;
52
+ export type GetAssetNameBrandsOptionsQueryParams = GetAssetNameListOptionsQueryParams;
53
+ export interface CreateAssetNameBody {
54
+ name: string;
55
+ aliasCode?: string;
56
+ addOn: string[];
57
+ measurement: string;
58
+ category: string;
59
+ tagType: string;
60
+ code?: string;
61
+ }
62
+ export type UpdateAssetNameBody = CreateAssetNameBody;
63
+ export interface UpdateDepreciationSettingBody {
64
+ assetNameIds: string[];
65
+ depreciationGroup: {
66
+ _id: string;
67
+ name: string;
68
+ key: number;
69
+ usefulLife: number;
70
+ };
71
+ accountCode: {
72
+ _id: string;
73
+ name: string;
74
+ code: string;
75
+ };
76
+ }
77
+ export interface SetTagTypeBody {
78
+ body: {
79
+ assetNameId: string;
80
+ tagType: string;
81
+ }[];
82
+ }
83
+ export interface DeleteAssetNameBody {
84
+ assetNameIds: string[];
85
+ }
@@ -0,0 +1,58 @@
1
+ import { QueryParams } from '../types/fetchResponse.type';
2
+ export interface GetBrandListQueryParameter extends QueryParams {
3
+ page?: number;
4
+ limit?: number;
5
+ sortOrder?: number;
6
+ sortBy?: string;
7
+ search?: string;
8
+ brand?: number[];
9
+ updatedAt?: number[];
10
+ category?: number[];
11
+ group?: number[];
12
+ assetName?: number[];
13
+ models?: number[];
14
+ }
15
+ export interface GetBrandListOptionsFAQueryParameter extends GetBrandListQueryParameter {
16
+ brandOptions: boolean;
17
+ modelOptions: boolean;
18
+ assetNameOptions: boolean;
19
+ categoryOptions: boolean;
20
+ }
21
+ export type GetBrandDropdownQueryParameter = GetBrandListQueryParameter;
22
+ export type GetBrandListCategoryQueryParameter = GetBrandListQueryParameter;
23
+ export type GetBrandListCategoryOptionsQueryParameter = GetBrandListOptionsFAQueryParameter;
24
+ export type GetBrandListAssetQueryParameter = GetBrandListQueryParameter;
25
+ export type GetBrandListAssetOptionsQueryParameter = GetBrandListOptionsFAQueryParameter;
26
+ export interface CreateBrandBody {
27
+ name: string;
28
+ category: [
29
+ {
30
+ _id: string;
31
+ name: string;
32
+ key: number;
33
+ }
34
+ ];
35
+ models: [
36
+ {
37
+ categoryId: string;
38
+ modelName: string[];
39
+ modelUpdate: [
40
+ {
41
+ _id: string;
42
+ objectId: any;
43
+ name: string;
44
+ key: number;
45
+ }
46
+ ];
47
+ }
48
+ ];
49
+ }
50
+ export interface BrandAssignCategoryBody {
51
+ brands: string[];
52
+ category: string[];
53
+ }
54
+ export type BrandUnassignCategoryBody = BrandAssignCategoryBody;
55
+ export type EditBrandBody = Omit<CreateBrandBody, 'category'> & {
56
+ category: number[];
57
+ };
58
+ export type DeleteBrandBody = Omit<BrandAssignCategoryBody, 'category'>;
@@ -0,0 +1,17 @@
1
+ import { QueryParams } from '../types/fetchResponse.type';
2
+ export interface GetMeasurementListQueryParams extends QueryParams {
3
+ page?: number;
4
+ limit?: number;
5
+ sortOrder?: number;
6
+ sortBy?: string;
7
+ search?: string;
8
+ brands?: number[];
9
+ models?: number[];
10
+ }
11
+ export interface CreateMeasurementBody {
12
+ name?: string;
13
+ }
14
+ export type UpdateMeasurementBody = CreateMeasurementBody;
15
+ export interface DeleteMeasurementBody {
16
+ measurementIds: string[];
17
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,20 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { BrandAssignCategoryBody, BrandUnassignCategoryBody, CreateBrandBody, DeleteBrandBody, EditBrandBody, GetBrandDropdownQueryParameter, GetBrandListAssetOptionsQueryParameter, GetBrandListAssetQueryParameter, GetBrandListCategoryOptionsQueryParameter, GetBrandListCategoryQueryParameter, GetBrandListOptionsFAQueryParameter, GetBrandListQueryParameter } from '../dto/settingsBrand.dto';
3
+ import { FetchDetailResponse, FetchListResponse, FetchResponse, ShortFetchListResponse } from '../types/fetchResponse.type';
4
+ import { BrandDetail, BrandDropdown, BrandList, BrandListAsset, BrandListCategory, BrandListCategoryOptions, BrandListOptionsFA } from '../types/settingsBrand.type';
5
+ declare const SettingBrandServiceGo: {
6
+ getBrandList: (params?: GetBrandListQueryParameter) => Promise<AxiosResponse<FetchListResponse<BrandList>>>;
7
+ getBrandListOptionsFA: (params?: GetBrandListOptionsFAQueryParameter) => Promise<AxiosResponse<FetchDetailResponse<BrandListOptionsFA>>>;
8
+ getBrandDropdown: (params?: GetBrandDropdownQueryParameter) => Promise<AxiosResponse<ShortFetchListResponse<BrandDropdown>>>;
9
+ getBrandDetail: (id: string) => Promise<FetchDetailResponse<BrandDetail>>;
10
+ getBrandListCategory: (id: string, params?: GetBrandListCategoryQueryParameter) => Promise<FetchListResponse<BrandListCategory>>;
11
+ getBrandListCategoryOptions: (id: string, params?: GetBrandListCategoryOptionsQueryParameter) => Promise<FetchDetailResponse<BrandListCategoryOptions>>;
12
+ getBrandListAsset: (id: string, params?: GetBrandListAssetQueryParameter) => Promise<AxiosResponse<FetchListResponse<BrandListAsset>>>;
13
+ getBrandListAssetOptions: (id: string, params?: GetBrandListAssetOptionsQueryParameter) => Promise<AxiosResponse<FetchDetailResponse<BrandListAsset>>>;
14
+ createBrand: (body: CreateBrandBody) => Promise<AxiosResponse<FetchResponse>>;
15
+ brandAssignCategory: (body: BrandAssignCategoryBody) => Promise<AxiosResponse<FetchResponse>>;
16
+ brandUnassignCategory: (body: BrandUnassignCategoryBody) => Promise<AxiosResponse<FetchResponse>>;
17
+ updateBrand: (body: EditBrandBody, id: string) => Promise<AxiosResponse<FetchResponse>>;
18
+ deleteBrand: (body: DeleteBrandBody) => Promise<AxiosResponse<FetchResponse>>;
19
+ };
20
+ export default SettingBrandServiceGo;
@@ -0,0 +1,12 @@
1
+ import { AxiosResponse } from 'axios';
2
+ import { CreateMeasurementBody, DeleteMeasurementBody, GetMeasurementListQueryParams, UpdateMeasurementBody } from '../dto/settingsMeasurement.dto';
3
+ import { FetchListResponse, FetchResponse, ShortFetchListResponse } from '../types/fetchResponse.type';
4
+ import { Measurement, MeasurementDropdown } from '../types/settingMeasurement.type';
5
+ declare const SettingMeasurementServiceGo: {
6
+ getMeasurementList: (params?: GetMeasurementListQueryParams) => Promise<AxiosResponse<FetchListResponse<Measurement>>>;
7
+ getMeasurementDropdown: () => Promise<AxiosResponse<ShortFetchListResponse<MeasurementDropdown>>>;
8
+ createMeasurement: (body: CreateMeasurementBody) => Promise<AxiosResponse<FetchResponse>>;
9
+ updateMeasurement: (body: UpdateMeasurementBody, id: string) => Promise<AxiosResponse<FetchResponse>>;
10
+ deleteMeasurement: (body: DeleteMeasurementBody) => Promise<AxiosResponse<FetchResponse>>;
11
+ };
12
+ export default SettingMeasurementServiceGo;
@@ -0,0 +1,5 @@
1
+ export interface Measurement {
2
+ _id: string;
3
+ name: string;
4
+ }
5
+ export type MeasurementDropdown = Measurement;
@@ -0,0 +1,221 @@
1
+ import { Option } from './options.type';
2
+ export interface AssetNameList {
3
+ _id: string;
4
+ key: number;
5
+ name: string;
6
+ category: {
7
+ _id: string;
8
+ name: string;
9
+ key: number;
10
+ };
11
+ addOn: {
12
+ maintenance: boolean;
13
+ repairTicketing: boolean;
14
+ tracking: boolean;
15
+ audit: boolean;
16
+ assetControl: boolean;
17
+ };
18
+ tagType: string;
19
+ updatedAt: string | Date;
20
+ aliasCode: string;
21
+ brands: {
22
+ _id: string;
23
+ key: number;
24
+ name: string;
25
+ }[];
26
+ models: {
27
+ _id: string;
28
+ name: string;
29
+ key: number;
30
+ brand: string;
31
+ category: string;
32
+ }[];
33
+ measurement: string;
34
+ totalAssets: number;
35
+ hasPairedAsset: boolean;
36
+ brandsLength: number;
37
+ modelsLength: number;
38
+ accountCode: string | null;
39
+ code: string;
40
+ }
41
+ export interface AssetNameListOptions {
42
+ nameOptions: Option[];
43
+ aliasCodeOptions: Option[];
44
+ measurementOptions: Option[];
45
+ depreciationGroupOptions: Option[];
46
+ accountCodeOptions: Option[];
47
+ accountNameOptions: Option[];
48
+ brandsOptions: Option[];
49
+ modelOptions: Option[];
50
+ }
51
+ export type AssetNameAssetsOptions = Pick<AssetNameListOptions, 'brandsOptions' | 'modelOptions'>;
52
+ export type AssetNameBrandsOptions = AssetNameAssetsOptions;
53
+ export interface AssetNameDropdown {
54
+ _id: string;
55
+ key: number;
56
+ name: string;
57
+ category: {
58
+ _id: string;
59
+ name: string;
60
+ key: number;
61
+ };
62
+ addOn: {
63
+ maintenance: boolean;
64
+ repairTicketing: boolean;
65
+ tracking: boolean;
66
+ audit: boolean;
67
+ assetControl: boolean;
68
+ };
69
+ tagType: string;
70
+ }
71
+ export interface UnpairedAssetNameList {
72
+ _id: string;
73
+ key: number;
74
+ name: string;
75
+ tagType: string;
76
+ totalAssets: number;
77
+ }
78
+ export type UnpairedAssetNameListOptions = Pick<AssetNameListOptions, 'nameOptions'>;
79
+ type DateType = string | Date | null;
80
+ export interface AssetNameDetail {
81
+ transactions: {
82
+ borrow: boolean;
83
+ assign: boolean;
84
+ transfer: boolean;
85
+ selfService: boolean;
86
+ };
87
+ addOn: {
88
+ maintenance: boolean;
89
+ repairTicketing: boolean;
90
+ tracking: boolean;
91
+ audit: boolean;
92
+ assetControl: boolean;
93
+ };
94
+ license: {
95
+ fixedAsset: {
96
+ status: string;
97
+ addedAt: DateType;
98
+ };
99
+ maintenance: {
100
+ status: string;
101
+ addedAt: DateType;
102
+ };
103
+ tracking: {
104
+ status: string;
105
+ addedAt: DateType;
106
+ };
107
+ audit: {
108
+ status: string;
109
+ addedAt: DateType;
110
+ };
111
+ repairTicketing: {
112
+ status: string;
113
+ addedAt: DateType;
114
+ };
115
+ };
116
+ _id: string;
117
+ schemaVersion: number;
118
+ key: number;
119
+ name: string;
120
+ category: {
121
+ _id: string;
122
+ name: string;
123
+ key: number;
124
+ };
125
+ measurement: {
126
+ _id: string;
127
+ name: string;
128
+ };
129
+ depreciationGroup: any;
130
+ accountCode: string | null;
131
+ totalAssets: number;
132
+ isDeleted: boolean;
133
+ tagType: string;
134
+ deleteFromDatabaseAt: string | Date | null;
135
+ createdAt: string | Date;
136
+ updatedAt: string | Date;
137
+ __v: number;
138
+ aliasCode: string;
139
+ code: string;
140
+ }
141
+ export interface AssetNameBrands {
142
+ brands: {
143
+ _id: string;
144
+ key: number;
145
+ name: string;
146
+ models: {
147
+ _id: string;
148
+ name: string;
149
+ key: number;
150
+ category: string;
151
+ }[];
152
+ };
153
+ }
154
+ export interface AssetNameAssets {
155
+ assets: {
156
+ _id: string;
157
+ name: {
158
+ _id: string;
159
+ nameWithSequence: string;
160
+ name: string;
161
+ key: number;
162
+ aliasCode: string;
163
+ nameCode: string;
164
+ };
165
+ aliasName: string;
166
+ qr: {
167
+ shortCode: string | null;
168
+ code: string | null;
169
+ };
170
+ rfid: {
171
+ shortCode: string | null;
172
+ code: string | null;
173
+ };
174
+ status: string;
175
+ group: {
176
+ _id: string;
177
+ name: string;
178
+ key: number;
179
+ fullPath?: string;
180
+ code?: string;
181
+ totalAssets?: number;
182
+ totalUsers?: number;
183
+ quota?: any;
184
+ parentQuota?: any;
185
+ license?: any;
186
+ isDisposable?: boolean;
187
+ parent?: string;
188
+ borrowingRole?: any;
189
+ transferRole?: any;
190
+ disposalRole?: any;
191
+ maintenanceRole?: any;
192
+ repairRole?: any;
193
+ auditRole?: any;
194
+ trackingRole?: any;
195
+ damagedRole?: any;
196
+ missingRole?: any;
197
+ isDeleted?: boolean;
198
+ createdAt?: string | Date;
199
+ updatedAt?: string | Date;
200
+ };
201
+ brand: {
202
+ _id: string;
203
+ name: string;
204
+ key: number;
205
+ };
206
+ model: {
207
+ _id: string;
208
+ name: string;
209
+ key: number;
210
+ };
211
+ updatedAt: string | Date;
212
+ tagType: string;
213
+ assetImageSmall: string | null;
214
+ assetImageMedium: string | null;
215
+ assetImageBig: string | null;
216
+ sequence: number;
217
+ maintenanceStatus: any;
218
+ auditStatus: any;
219
+ };
220
+ }
221
+ export {};
@@ -0,0 +1,82 @@
1
+ import { Option } from './options.type';
2
+ interface DataObject {
3
+ _id: string;
4
+ name: string;
5
+ key: number;
6
+ }
7
+ export interface BrandList extends DataObject {
8
+ updatedAt: Date | string;
9
+ models: DataObject[];
10
+ totalAssets: number;
11
+ category: DataObject[];
12
+ }
13
+ export interface BrandListOptionsFA {
14
+ BrandOptions: Option[];
15
+ modelOptions: Option[];
16
+ }
17
+ export type BrandDropdown = DataObject;
18
+ export interface BrandDetail extends DataObject {
19
+ category: DataObject[];
20
+ totalAssets: number;
21
+ isDeleted: boolean;
22
+ deletedFromDatabaseAt: Date | string | null;
23
+ createdAt: Date | string;
24
+ updatedAt: Date | string;
25
+ __v: number;
26
+ categories: {
27
+ _id: string;
28
+ name: string;
29
+ key: number;
30
+ models: DataObject[];
31
+ };
32
+ }
33
+ export interface BrandListCategory {
34
+ _id: string;
35
+ name: string;
36
+ category: DataObject;
37
+ models: {
38
+ _id: string;
39
+ name: string;
40
+ key: number;
41
+ brand: string;
42
+ category: string;
43
+ createdAt: Date | string;
44
+ updatedAt: Date | string;
45
+ __v: number;
46
+ }[];
47
+ }
48
+ export type BrandListCategoryOptions = Omit<BrandListOptionsFA, 'modelOptions'>;
49
+ export interface BrandListAsset {
50
+ name: string;
51
+ assets: {
52
+ name: {
53
+ _id: string;
54
+ nameWithSequence: string;
55
+ name: string;
56
+ key: number;
57
+ aliasCode: string;
58
+ nameCode: string;
59
+ };
60
+ group: {
61
+ _id: string;
62
+ name: string;
63
+ key: number;
64
+ };
65
+ model: {
66
+ _id: string;
67
+ name: string;
68
+ key: number;
69
+ };
70
+ updatedAt: string | Date;
71
+ assetImageSmall: string | null;
72
+ assetImageMedium: string | null;
73
+ assetImageBig: string | null;
74
+ };
75
+ sequence: number;
76
+ }
77
+ export interface BrandListAssetOptions {
78
+ categoryOptions: Option[];
79
+ modelOptions: Option[];
80
+ assetNameOptions: Option[];
81
+ }
82
+ export {};