spotcharge-types 1.0.381 → 1.0.382
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/dist/models/api/consumer/admin-consumer.api.model.d.ts +67 -0
- package/dist/models/api/consumer/admin-consumer.api.model.d.ts.map +1 -0
- package/dist/models/api/consumer/admin-consumer.api.model.js +3 -0
- package/dist/models/api/consumer/admin-consumer.api.model.js.map +1 -0
- package/dist/models/api/consumer/index.d.ts +1 -0
- package/dist/models/api/consumer/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/models/api/consumer/admin-consumer.api.model.ts +87 -0
- package/src/models/api/consumer/index.ts +12 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { WalletTransactionType } from '../../../enum/consumer';
|
|
2
|
+
import { PhoneNumberModel } from '../../phone-number-model';
|
|
3
|
+
import { ApiSortDirection } from '../users/admin-user.api.model';
|
|
4
|
+
import { IsoDateTime } from '../users/shared.api.model';
|
|
5
|
+
import { ConsumerAccountApiModel, ConsumerProfileApiModel, ConsumerWalletApiModel, UpdateConsumerProfileRequest, WalletTransactionListApiModel } from './consumer-wallet.api.model';
|
|
6
|
+
import { ConsumerAccountVehicleApiModel } from './consumer-vehicle.api.model';
|
|
7
|
+
/** GET /api/admin/consumers */
|
|
8
|
+
export type AdminConsumerListOrderBy = 'firstName' | 'lastName' | 'email' | 'createdAt' | 'walletBalance';
|
|
9
|
+
export interface AdminConsumerListItemApiModel {
|
|
10
|
+
/** consumer.accounts.id (uuid). */
|
|
11
|
+
accountId: string;
|
|
12
|
+
firebaseUid: string;
|
|
13
|
+
firstName: string;
|
|
14
|
+
lastName: string | null;
|
|
15
|
+
email: string | null;
|
|
16
|
+
phoneNumber: PhoneNumberModel | null;
|
|
17
|
+
isBlocked: boolean;
|
|
18
|
+
/** Spendable balance in rupees. */
|
|
19
|
+
walletBalance: number;
|
|
20
|
+
createdAt: IsoDateTime;
|
|
21
|
+
}
|
|
22
|
+
export interface AdminConsumerListApiModel {
|
|
23
|
+
rows: AdminConsumerListItemApiModel[];
|
|
24
|
+
totalCount: number;
|
|
25
|
+
pageIndex: number;
|
|
26
|
+
pageSize: number;
|
|
27
|
+
orderBy: AdminConsumerListOrderBy;
|
|
28
|
+
sortDirection: ApiSortDirection;
|
|
29
|
+
}
|
|
30
|
+
export interface AdminConsumerAccountApiModel extends ConsumerAccountApiModel {
|
|
31
|
+
blockedReason: string | null;
|
|
32
|
+
blockedAt: IsoDateTime | null;
|
|
33
|
+
legacyFirestoreId: string | null;
|
|
34
|
+
}
|
|
35
|
+
/** GET /api/admin/consumers/:id — `:id` is account UUID, Firebase uid, or legacy Firestore id. */
|
|
36
|
+
export interface AdminConsumerDetailApiModel {
|
|
37
|
+
profile: ConsumerProfileApiModel;
|
|
38
|
+
account: AdminConsumerAccountApiModel;
|
|
39
|
+
wallet: ConsumerWalletApiModel;
|
|
40
|
+
vehicles: ConsumerAccountVehicleApiModel[];
|
|
41
|
+
createdAt: IsoDateTime;
|
|
42
|
+
}
|
|
43
|
+
/** PATCH /api/admin/consumers/:id */
|
|
44
|
+
export type AdminUpdateConsumerRequest = UpdateConsumerProfileRequest;
|
|
45
|
+
/** PATCH /api/admin/consumers/:id/block */
|
|
46
|
+
export interface BlockConsumerRequest {
|
|
47
|
+
isBlocked: boolean;
|
|
48
|
+
reason?: string | null;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* POST /api/admin/consumers/:id/wallet/adjust
|
|
52
|
+
*
|
|
53
|
+
* Reason is always `admin`. Replaying `idempotencyKey` is a no-op.
|
|
54
|
+
*/
|
|
55
|
+
export interface AdjustConsumerWalletRequest {
|
|
56
|
+
type: WalletTransactionType;
|
|
57
|
+
amount: number;
|
|
58
|
+
note?: string | null;
|
|
59
|
+
idempotencyKey: string;
|
|
60
|
+
}
|
|
61
|
+
export interface AdjustConsumerWalletResponse {
|
|
62
|
+
wallet: ConsumerWalletApiModel;
|
|
63
|
+
replayed: boolean;
|
|
64
|
+
}
|
|
65
|
+
/** GET /api/admin/consumers/:id/wallet/transactions */
|
|
66
|
+
export type AdminConsumerWalletTransactionListApiModel = WalletTransactionListApiModel;
|
|
67
|
+
//# sourceMappingURL=admin-consumer.api.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-consumer.api.model.d.ts","sourceRoot":"","sources":["../../../../src/models/api/consumer/admin-consumer.api.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,4BAA4B,EAC5B,6BAA6B,EAC9B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,8BAA8B,EAAE,MAAM,8BAA8B,CAAC;AAE9E,+BAA+B;AAC/B,MAAM,MAAM,wBAAwB,GAChC,WAAW,GACX,UAAU,GACV,OAAO,GACP,WAAW,GACX,eAAe,CAAC;AAEpB,MAAM,WAAW,6BAA6B;IAC5C,mCAAmC;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,gBAAgB,GAAG,IAAI,CAAC;IACrC,SAAS,EAAE,OAAO,CAAC;IACnB,mCAAmC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,WAAW,CAAC;CACxB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,6BAA6B,EAAE,CAAC;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,wBAAwB,CAAC;IAClC,aAAa,EAAE,gBAAgB,CAAC;CACjC;AAED,MAAM,WAAW,4BAA6B,SAAQ,uBAAuB;IAC3E,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,SAAS,EAAE,WAAW,GAAG,IAAI,CAAC;IAC9B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,kGAAkG;AAClG,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,uBAAuB,CAAC;IACjC,OAAO,EAAE,4BAA4B,CAAC;IACtC,MAAM,EAAE,sBAAsB,CAAC;IAC/B,QAAQ,EAAE,8BAA8B,EAAE,CAAC;IAC3C,SAAS,EAAE,WAAW,CAAC;CACxB;AAED,qCAAqC;AACrC,MAAM,MAAM,0BAA0B,GAAG,4BAA4B,CAAC;AAEtE,2CAA2C;AAC3C,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,qBAAqB,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,sBAAsB,CAAC;IAC/B,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,uDAAuD;AACvD,MAAM,MAAM,0CAA0C,GAAG,6BAA6B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-consumer.api.model.js","sourceRoot":"","sources":["../../../../src/models/api/consumer/admin-consumer.api.model.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { ConsumerWalletApiModel, WalletTransactionListItemApiModel, WalletTransactionListApiModel, ConsumerProfileApiModel, ConsumerAccountApiModel, EnsureConsumerRequest, UpdateConsumerProfileRequest, ConsumerMeApiModel, } from './consumer-wallet.api.model';
|
|
2
2
|
export { ConsumerAccountVehicleApiModel, ConsumerAccountVehicleListApiModel, CreateConsumerAccountVehicleRequest, UpdateConsumerAccountVehicleRequest, } from './consumer-vehicle.api.model';
|
|
3
3
|
export { RegisterPushTokenRequest, ConsumerPushTokenApiModel, UnregisterPushTokenRequest, } from './consumer-push-token.api.model';
|
|
4
|
+
export { AdminConsumerListOrderBy, AdminConsumerListItemApiModel, AdminConsumerListApiModel, AdminConsumerAccountApiModel, AdminConsumerDetailApiModel, AdminUpdateConsumerRequest, BlockConsumerRequest, AdjustConsumerWalletRequest, AdjustConsumerWalletResponse, AdminConsumerWalletTransactionListApiModel, } from './admin-consumer.api.model';
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/api/consumer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,iCAAiC,EACjC,6BAA6B,EAC7B,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,8BAA8B,EAC9B,kCAAkC,EAClC,mCAAmC,EACnC,mCAAmC,GACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/api/consumer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,iCAAiC,EACjC,6BAA6B,EAC7B,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,8BAA8B,EAC9B,kCAAkC,EAClC,mCAAmC,EACnC,mCAAmC,GACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,wBAAwB,EACxB,6BAA6B,EAC7B,yBAAyB,EACzB,4BAA4B,EAC5B,2BAA2B,EAC3B,0BAA0B,EAC1B,oBAAoB,EACpB,2BAA2B,EAC3B,4BAA4B,EAC5B,0CAA0C,GAC3C,MAAM,4BAA4B,CAAC"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { WalletTransactionType } from '../../../enum/consumer';
|
|
2
|
+
import { PhoneNumberModel } from '../../phone-number-model';
|
|
3
|
+
import { ApiSortDirection } from '../users/admin-user.api.model';
|
|
4
|
+
import { IsoDateTime } from '../users/shared.api.model';
|
|
5
|
+
import {
|
|
6
|
+
ConsumerAccountApiModel,
|
|
7
|
+
ConsumerProfileApiModel,
|
|
8
|
+
ConsumerWalletApiModel,
|
|
9
|
+
UpdateConsumerProfileRequest,
|
|
10
|
+
WalletTransactionListApiModel,
|
|
11
|
+
} from './consumer-wallet.api.model';
|
|
12
|
+
import { ConsumerAccountVehicleApiModel } from './consumer-vehicle.api.model';
|
|
13
|
+
|
|
14
|
+
/** GET /api/admin/consumers */
|
|
15
|
+
export type AdminConsumerListOrderBy =
|
|
16
|
+
| 'firstName'
|
|
17
|
+
| 'lastName'
|
|
18
|
+
| 'email'
|
|
19
|
+
| 'createdAt'
|
|
20
|
+
| 'walletBalance';
|
|
21
|
+
|
|
22
|
+
export interface AdminConsumerListItemApiModel {
|
|
23
|
+
/** consumer.accounts.id (uuid). */
|
|
24
|
+
accountId: string;
|
|
25
|
+
firebaseUid: string;
|
|
26
|
+
firstName: string;
|
|
27
|
+
lastName: string | null;
|
|
28
|
+
email: string | null;
|
|
29
|
+
phoneNumber: PhoneNumberModel | null;
|
|
30
|
+
isBlocked: boolean;
|
|
31
|
+
/** Spendable balance in rupees. */
|
|
32
|
+
walletBalance: number;
|
|
33
|
+
createdAt: IsoDateTime;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface AdminConsumerListApiModel {
|
|
37
|
+
rows: AdminConsumerListItemApiModel[];
|
|
38
|
+
totalCount: number;
|
|
39
|
+
pageIndex: number;
|
|
40
|
+
pageSize: number;
|
|
41
|
+
orderBy: AdminConsumerListOrderBy;
|
|
42
|
+
sortDirection: ApiSortDirection;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface AdminConsumerAccountApiModel extends ConsumerAccountApiModel {
|
|
46
|
+
blockedReason: string | null;
|
|
47
|
+
blockedAt: IsoDateTime | null;
|
|
48
|
+
legacyFirestoreId: string | null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** GET /api/admin/consumers/:id — `:id` is account UUID, Firebase uid, or legacy Firestore id. */
|
|
52
|
+
export interface AdminConsumerDetailApiModel {
|
|
53
|
+
profile: ConsumerProfileApiModel;
|
|
54
|
+
account: AdminConsumerAccountApiModel;
|
|
55
|
+
wallet: ConsumerWalletApiModel;
|
|
56
|
+
vehicles: ConsumerAccountVehicleApiModel[];
|
|
57
|
+
createdAt: IsoDateTime;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** PATCH /api/admin/consumers/:id */
|
|
61
|
+
export type AdminUpdateConsumerRequest = UpdateConsumerProfileRequest;
|
|
62
|
+
|
|
63
|
+
/** PATCH /api/admin/consumers/:id/block */
|
|
64
|
+
export interface BlockConsumerRequest {
|
|
65
|
+
isBlocked: boolean;
|
|
66
|
+
reason?: string | null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* POST /api/admin/consumers/:id/wallet/adjust
|
|
71
|
+
*
|
|
72
|
+
* Reason is always `admin`. Replaying `idempotencyKey` is a no-op.
|
|
73
|
+
*/
|
|
74
|
+
export interface AdjustConsumerWalletRequest {
|
|
75
|
+
type: WalletTransactionType;
|
|
76
|
+
amount: number;
|
|
77
|
+
note?: string | null;
|
|
78
|
+
idempotencyKey: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface AdjustConsumerWalletResponse {
|
|
82
|
+
wallet: ConsumerWalletApiModel;
|
|
83
|
+
replayed: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** GET /api/admin/consumers/:id/wallet/transactions */
|
|
87
|
+
export type AdminConsumerWalletTransactionListApiModel = WalletTransactionListApiModel;
|
|
@@ -19,3 +19,15 @@ export {
|
|
|
19
19
|
ConsumerPushTokenApiModel,
|
|
20
20
|
UnregisterPushTokenRequest,
|
|
21
21
|
} from './consumer-push-token.api.model';
|
|
22
|
+
export {
|
|
23
|
+
AdminConsumerListOrderBy,
|
|
24
|
+
AdminConsumerListItemApiModel,
|
|
25
|
+
AdminConsumerListApiModel,
|
|
26
|
+
AdminConsumerAccountApiModel,
|
|
27
|
+
AdminConsumerDetailApiModel,
|
|
28
|
+
AdminUpdateConsumerRequest,
|
|
29
|
+
BlockConsumerRequest,
|
|
30
|
+
AdjustConsumerWalletRequest,
|
|
31
|
+
AdjustConsumerWalletResponse,
|
|
32
|
+
AdminConsumerWalletTransactionListApiModel,
|
|
33
|
+
} from './admin-consumer.api.model';
|