@esb-market-contracts/admin-backend 1.8.22 → 1.8.23

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.
Files changed (3) hide show
  1. package/api.d.ts +114 -0
  2. package/package.json +1 -1
  3. package/types.d.ts +217 -0
package/api.d.ts CHANGED
@@ -177,5 +177,119 @@ declare const managementRouter: import("hono/hono-base").HonoBase<{
177
177
  };
178
178
  }, "/iam/management", "/iam/management/employees/update-grants">;
179
179
  export type ManagementRouter = typeof managementRouter;
180
+ declare const assetsRouter: import("hono/hono-base").HonoBase<{
181
+ Variables: VariablesWithActor;
182
+ }, {
183
+ "/backoffice/assets/one": {
184
+ $get: {
185
+ input: {
186
+ query: {
187
+ assetId: string | string[];
188
+ };
189
+ };
190
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
191
+ asset: {
192
+ id: string;
193
+ name: string;
194
+ assetCode: string;
195
+ serialNumber: string | null;
196
+ notes: string | null;
197
+ status: string;
198
+ writeOffReason: string | null;
199
+ writtenOffAt: string | null;
200
+ updatedAt: string | null;
201
+ createdAt: string;
202
+ };
203
+ }>;
204
+ outputFormat: "json";
205
+ status: 200;
206
+ };
207
+ };
208
+ } & {
209
+ "/backoffice/assets/search": {
210
+ $post: {
211
+ input: {
212
+ json: {
213
+ pagination: {
214
+ offset?: unknown;
215
+ limit?: unknown;
216
+ };
217
+ where?: {
218
+ status?: "active" | "written_off" | undefined;
219
+ } | undefined;
220
+ };
221
+ };
222
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
223
+ assets: {
224
+ id: string;
225
+ name: string;
226
+ assetCode: string;
227
+ serialNumber: string | null;
228
+ notes: string | null;
229
+ status: string;
230
+ writeOffReason: string | null;
231
+ writtenOffAt: string | null;
232
+ updatedAt: string | null;
233
+ createdAt: string;
234
+ }[];
235
+ total: string;
236
+ }>;
237
+ outputFormat: "json";
238
+ status: 200;
239
+ };
240
+ };
241
+ } & {
242
+ "/backoffice/assets/create": {
243
+ $post: {
244
+ input: {
245
+ json: {
246
+ name: string;
247
+ serialNumber?: string | null | undefined;
248
+ notes?: string | null | undefined;
249
+ };
250
+ };
251
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
252
+ [x: string]: never;
253
+ }>;
254
+ outputFormat: "json";
255
+ status: 201;
256
+ };
257
+ };
258
+ } & {
259
+ "/backoffice/assets/write-off": {
260
+ $post: {
261
+ input: {
262
+ json: {
263
+ assetId: number;
264
+ writeOffReason: string;
265
+ };
266
+ };
267
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
268
+ [x: string]: never;
269
+ }>;
270
+ outputFormat: "json";
271
+ status: 200;
272
+ };
273
+ };
274
+ } & {
275
+ "/backoffice/assets/update-metadata": {
276
+ $post: {
277
+ input: {
278
+ json: {
279
+ name: string;
280
+ serialNumber: string | null;
281
+ notes: string | null;
282
+ assetId: number;
283
+ };
284
+ };
285
+ output: import("@kalutskii/foundation").APIError | import("@kalutskii/foundation").APISuccess<{
286
+ [x: string]: never;
287
+ }>;
288
+ outputFormat: "json";
289
+ status: 200;
290
+ };
291
+ };
292
+ }, "/backoffice/assets", "/backoffice/assets/update-metadata">;
293
+ export type AssetsRouter = typeof assetsRouter;
180
294
 
181
295
  export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@esb-market-contracts/admin-backend",
3
3
  "description": "Shared TypeScript contract definitions for admin-backend.",
4
- "version": "1.8.22",
4
+ "version": "1.8.23",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "sideEffects": false,
package/types.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  // Generated by dts-bundle-generator v9.5.1
2
2
 
3
+ import z from 'zod';
3
4
  import { z } from 'zod';
4
5
 
5
6
  declare const signinPayloadSchema: z.ZodObject<{
@@ -110,5 +111,221 @@ export type EmployeeCreatePayload = z.infer<typeof employeeCreatePayloadSchema>;
110
111
  export type EmployeeSwitchStatusPayload = z.infer<typeof employeeSwitchStatusPayloadSchema>;
111
112
  export type EmployeeUpdatePasswordPayload = z.infer<typeof employeeUpdatePasswordPayloadSchema>;
112
113
  export type EmployeeUpdateGrantsPayload = z.infer<typeof employeeUpdateGrantsPayloadSchema>;
114
+ declare const assetSchema: import("drizzle-orm/zod").BuildSchema<"select", {
115
+ id: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").SetIsPrimaryKey<import("drizzle-orm/pg-core").PgSerialBuilder>, {
116
+ name: string;
117
+ tableName: "assets";
118
+ dataType: "number int32";
119
+ data: number;
120
+ driverParam: number;
121
+ notNull: true;
122
+ hasDefault: true;
123
+ isPrimaryKey: false;
124
+ isAutoincrement: false;
125
+ hasRuntimeDefault: false;
126
+ enumValues: undefined;
127
+ identity: undefined;
128
+ generated: undefined;
129
+ }>;
130
+ name: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[
131
+ string,
132
+ ...string[]
133
+ ]>>, {
134
+ name: string;
135
+ tableName: "assets";
136
+ dataType: "string";
137
+ data: string;
138
+ driverParam: string;
139
+ notNull: true;
140
+ hasDefault: false;
141
+ isPrimaryKey: false;
142
+ isAutoincrement: false;
143
+ hasRuntimeDefault: false;
144
+ enumValues: undefined;
145
+ identity: undefined;
146
+ generated: undefined;
147
+ }>;
148
+ assetCode: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTextBuilder<[
149
+ string,
150
+ ...string[]
151
+ ]>>, {
152
+ name: string;
153
+ tableName: "assets";
154
+ dataType: "string";
155
+ data: string;
156
+ driverParam: string;
157
+ notNull: true;
158
+ hasDefault: false;
159
+ isPrimaryKey: false;
160
+ isAutoincrement: false;
161
+ hasRuntimeDefault: false;
162
+ enumValues: undefined;
163
+ identity: undefined;
164
+ generated: undefined;
165
+ }>;
166
+ serialNumber: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").PgTextBuilder<[
167
+ string,
168
+ ...string[]
169
+ ]>, {
170
+ name: string;
171
+ tableName: "assets";
172
+ dataType: "string";
173
+ data: string;
174
+ driverParam: string;
175
+ notNull: false;
176
+ hasDefault: false;
177
+ isPrimaryKey: false;
178
+ isAutoincrement: false;
179
+ hasRuntimeDefault: false;
180
+ enumValues: undefined;
181
+ identity: undefined;
182
+ generated: undefined;
183
+ }>;
184
+ notes: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").PgTextBuilder<[
185
+ string,
186
+ ...string[]
187
+ ]>, {
188
+ name: string;
189
+ tableName: "assets";
190
+ dataType: "string";
191
+ data: string;
192
+ driverParam: string;
193
+ notNull: false;
194
+ hasDefault: false;
195
+ isPrimaryKey: false;
196
+ isAutoincrement: false;
197
+ hasRuntimeDefault: false;
198
+ enumValues: undefined;
199
+ identity: undefined;
200
+ generated: undefined;
201
+ }>;
202
+ status: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgEnumColumnBuilder<[
203
+ "active",
204
+ "written_off"
205
+ ]>>>, {
206
+ name: string;
207
+ tableName: "assets";
208
+ dataType: "string enum";
209
+ data: "active" | "written_off";
210
+ driverParam: string;
211
+ notNull: true;
212
+ hasDefault: true;
213
+ isPrimaryKey: false;
214
+ isAutoincrement: false;
215
+ hasRuntimeDefault: false;
216
+ enumValues: [
217
+ "active",
218
+ "written_off"
219
+ ];
220
+ identity: undefined;
221
+ generated: undefined;
222
+ }>;
223
+ writeOffReason: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").PgTextBuilder<[
224
+ string,
225
+ ...string[]
226
+ ]>, {
227
+ name: string;
228
+ tableName: "assets";
229
+ dataType: "string";
230
+ data: string;
231
+ driverParam: string;
232
+ notNull: false;
233
+ hasDefault: false;
234
+ isPrimaryKey: false;
235
+ isAutoincrement: false;
236
+ hasRuntimeDefault: false;
237
+ enumValues: undefined;
238
+ identity: undefined;
239
+ generated: undefined;
240
+ }>;
241
+ writtenOffAt: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").PgTimestampBuilder, {
242
+ name: string;
243
+ tableName: "assets";
244
+ dataType: "object date";
245
+ data: Date;
246
+ driverParam: string;
247
+ notNull: false;
248
+ hasDefault: false;
249
+ isPrimaryKey: false;
250
+ isAutoincrement: false;
251
+ hasRuntimeDefault: false;
252
+ enumValues: undefined;
253
+ identity: undefined;
254
+ generated: undefined;
255
+ }>;
256
+ updatedAt: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").PgTimestampBuilder>, {
257
+ name: string;
258
+ tableName: "assets";
259
+ dataType: "object date";
260
+ data: Date;
261
+ driverParam: string;
262
+ notNull: false;
263
+ hasDefault: true;
264
+ isPrimaryKey: false;
265
+ isAutoincrement: false;
266
+ hasRuntimeDefault: false;
267
+ enumValues: undefined;
268
+ identity: undefined;
269
+ generated: undefined;
270
+ }>;
271
+ createdAt: import("drizzle-orm/pg-core").PgBuildColumn<"assets", import("drizzle-orm/pg-core").SetHasDefault<import("drizzle-orm/pg-core").SetNotNull<import("drizzle-orm/pg-core").PgTimestampBuilder>>, {
272
+ name: string;
273
+ tableName: "assets";
274
+ dataType: "object date";
275
+ data: Date;
276
+ driverParam: string;
277
+ notNull: true;
278
+ hasDefault: true;
279
+ isPrimaryKey: false;
280
+ isAutoincrement: false;
281
+ hasRuntimeDefault: false;
282
+ enumValues: undefined;
283
+ identity: undefined;
284
+ generated: undefined;
285
+ }>;
286
+ }, undefined, undefined>;
287
+ export type Asset = z.infer<typeof assetSchema>;
288
+ declare const assetGetQuerySchema: z.ZodObject<{
289
+ assetId: z.ZodInt;
290
+ }, z.core.$strict>;
291
+ declare const assetSearchPayloadSchema: z.ZodObject<{
292
+ where: z.ZodOptional<z.ZodObject<{
293
+ status: z.ZodOptional<z.ZodEnum<{
294
+ active: "active";
295
+ written_off: "written_off";
296
+ }>>;
297
+ }, {
298
+ out: {};
299
+ in: {};
300
+ }>>;
301
+ pagination: z.ZodObject<{
302
+ offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
303
+ limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
304
+ }, z.core.$strip>;
305
+ }, z.core.$strict>;
306
+ declare const assetCreatePayloadSchema: z.ZodObject<{
307
+ name: z.ZodString;
308
+ serialNumber: z.ZodOptional<z.ZodNullable<z.ZodString>>;
309
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
310
+ }, z.core.$strict>;
311
+ declare const assetWriteOffPayloadSchema: z.ZodObject<{
312
+ assetId: z.ZodInt;
313
+ writeOffReason: z.ZodString;
314
+ }, z.core.$strict>;
315
+ declare const assetUpdateMetadataPayloadSchema: z.ZodObject<{
316
+ name: z.ZodString;
317
+ serialNumber: z.ZodNullable<z.ZodString>;
318
+ notes: z.ZodNullable<z.ZodString>;
319
+ assetId: z.ZodInt;
320
+ }, z.core.$strict>;
321
+ export type AssetGetQuery = z.infer<typeof assetGetQuerySchema>;
322
+ export type AssetSearchPayload = z.infer<typeof assetSearchPayloadSchema>;
323
+ export type AssetSearchResult = {
324
+ assets: Asset[];
325
+ total: number;
326
+ };
327
+ export type AssetCreatePayload = z.infer<typeof assetCreatePayloadSchema>;
328
+ export type AssetWriteOffPayload = z.infer<typeof assetWriteOffPayloadSchema>;
329
+ export type AssetUpdateMetadataPayload = z.infer<typeof assetUpdateMetadataPayloadSchema>;
113
330
 
114
331
  export {};