ravcredit-lib 0.0.10 → 0.0.12

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 (61) hide show
  1. package/fesm2022/ravcredit-lib.mjs +1997 -0
  2. package/fesm2022/ravcredit-lib.mjs.map +1 -0
  3. package/index.d.ts +1647 -0
  4. package/package.json +25 -13
  5. package/ng-package.json +0 -7
  6. package/src/lib/ravcredit-lib.component.spec.ts +0 -23
  7. package/src/lib/ravcredit-lib.component.ts +0 -16
  8. package/src/lib/ravcredit-lib.service.spec.ts +0 -16
  9. package/src/lib/ravcredit-lib.service.ts +0 -9
  10. package/src/lib/v1/const/constants.ts +0 -35
  11. package/src/lib/v1/dto/AddressDto.ts +0 -27
  12. package/src/lib/v1/dto/BusinessDeadlineDto.ts +0 -9
  13. package/src/lib/v1/dto/ConektaDto.ts +0 -386
  14. package/src/lib/v1/dto/ContractDto.ts +0 -46
  15. package/src/lib/v1/dto/CustomerDto.ts +0 -47
  16. package/src/lib/v1/dto/DeviceDto.ts +0 -13
  17. package/src/lib/v1/dto/DynamiCoreDto.ts +0 -1017
  18. package/src/lib/v1/dto/FinancialDto.ts +0 -156
  19. package/src/lib/v1/dto/PassportDto.ts +0 -143
  20. package/src/lib/v1/dto/PayLinkResDto.ts +0 -144
  21. package/src/lib/v1/dto/PayOrderResAlternaDto.ts +0 -348
  22. package/src/lib/v1/dto/PayOrderResOxxoDto.ts +0 -254
  23. package/src/lib/v1/dto/PaymentLinkDto.ts +0 -161
  24. package/src/lib/v1/dto/ScheduleDto.ts +0 -17
  25. package/src/lib/v1/dto/UserDto.ts +0 -27
  26. package/src/lib/v1/dto/WeekScheduleDTO.ts +0 -46
  27. package/src/lib/v1/idb/idb.service.spec.ts +0 -16
  28. package/src/lib/v1/idb/indexed-db.service.ts +0 -396
  29. package/src/lib/v1/objects/oAddress.ts +0 -19
  30. package/src/lib/v1/objects/oBusiness.ts +0 -112
  31. package/src/lib/v1/objects/oClient.ts +0 -46
  32. package/src/lib/v1/objects/oConekta.ts +0 -408
  33. package/src/lib/v1/objects/oContract.ts +0 -30
  34. package/src/lib/v1/objects/oContractAll.ts +0 -38
  35. package/src/lib/v1/objects/oCustomer.ts +0 -36
  36. package/src/lib/v1/objects/oDevice.ts +0 -5
  37. package/src/lib/v1/objects/oFinancial.ts +0 -32
  38. package/src/lib/v1/objects/oGlobal.ts +0 -186
  39. package/src/lib/v1/objects/oLogIn.ts +0 -43
  40. package/src/lib/v1/objects/oNewPayment.ts +0 -18
  41. package/src/lib/v1/objects/oNotification.ts +0 -34
  42. package/src/lib/v1/objects/oPassport.ts +0 -65
  43. package/src/lib/v1/objects/oUser.ts +0 -35
  44. package/src/lib/v1/objects/oVerification.ts +0 -48
  45. package/src/lib/v1/util/UtilBusiness.ts +0 -186
  46. package/src/lib/v1/util/UtilClient.ts +0 -285
  47. package/src/lib/v1/util/UtilConekta.ts +0 -97
  48. package/src/lib/v1/util/UtilContract.ts +0 -386
  49. package/src/lib/v1/util/UtilDashboard.ts +0 -19
  50. package/src/lib/v1/util/UtilDynamiCore.ts +0 -752
  51. package/src/lib/v1/util/UtilNotification.ts +0 -46
  52. package/src/lib/v1/util/UtilPassport.ts +0 -32
  53. package/src/lib/v1/util/UtilPayment.ts +0 -22
  54. package/src/lib/v1/util/UtilTime.ts +0 -181
  55. package/src/lib/v1/util/UtilsHttp.ts +0 -11
  56. package/src/lib/v2/const/constants.ts +0 -38
  57. package/src/lib/v2/messaging/messaging.ts +0 -10
  58. package/src/public-api.ts +0 -37
  59. package/tsconfig.lib.json +0 -15
  60. package/tsconfig.lib.prod.json +0 -11
  61. package/tsconfig.spec.json +0 -15
@@ -1,186 +0,0 @@
1
- import {oUser} from "./oUser";
2
- import {oBusinessInfo, oSchedule} from "./oBusiness";
3
- import {oClient} from "./oClient";
4
- import {oDevice} from "./oDevice";
5
- import {oAddress} from "./oAddress";
6
- import {oFinancial} from "./oFinancial";
7
- import {MatSnackBarConfig} from "@angular/material/snack-bar";
8
- import {oContract} from "./oContract";
9
- import {oNotification} from "./oNotification";
10
- import {cContract} from '../util/UtilContract';
11
- import {cClient} from '../util/UtilClient';
12
-
13
- export enum eRoles { Administrator = "Administrator", Seller = "Seller", Consultant = "Consultant" }
14
-
15
- export enum eProcessStatus {
16
- IDLE = "IDLE",
17
- ERROR = "ERROR",
18
- CANCELED = "CANCELED",
19
- COMPLETE = "COMPLETE",
20
- PROCESSING = "PROCESSING",
21
- WAITING = "WAITING",
22
- }
23
-
24
- export enum eLoginStatus {
25
- IDLE = "IDLE",
26
- ERROR = "ERROR",
27
- AUTHORIZED = "AUTHORIZED",
28
- CHECKING = "CHECKING",
29
- NOAUTHORIZED = "NOAUTHORIZED",
30
- NOTFOUND = "NOTFOUND",
31
- ERRORPASSWORD = "ERRORPASSWORD"
32
- }
33
-
34
- export enum eClientStatus {
35
- ACTIVE = "active",
36
- COMPLETED = "completed",
37
- PAUSED = "paused",
38
- CANCELED = "canceled",
39
- LATE = "late"
40
- }
41
-
42
- export const cSingleOptionClientStatus: iOptionsSelect = {
43
- viewValue: "",
44
- value: ""
45
- }
46
- export const cOptionsClientStatus: iOptionsSelect[] = [
47
- {
48
- value: eClientStatus.ACTIVE,
49
- viewValue: "Activar"
50
- }, {
51
- value: eClientStatus.COMPLETED,
52
- viewValue: "Completar"
53
- }, {
54
- value: eClientStatus.PAUSED,
55
- viewValue: "Pausar"
56
- }, {
57
- value: eClientStatus.LATE,
58
- viewValue: "Marcar con atraso"
59
- }, {
60
- value: eClientStatus.CANCELED,
61
- viewValue: "Cancelar"
62
- }
63
- ]
64
-
65
- export interface iOptionsSelect {
66
- viewValue: String
67
- value: String
68
- }
69
-
70
- export interface iSelect {
71
- viewValue: eRoles
72
- value: eRoles
73
- }
74
-
75
- export const eRolesSelect: iSelect[] = [
76
- {
77
- value: eRoles.Administrator,
78
- viewValue: eRoles.Administrator
79
- },
80
- {
81
- value: eRoles.Consultant,
82
- viewValue: eRoles.Consultant
83
- },
84
- {
85
- value: eRoles.Seller,
86
- viewValue: eRoles.Seller
87
- },
88
- ]
89
-
90
- export interface iConfigUUID {
91
- client_uuid?: string;
92
- contract_uuid: string;
93
- }
94
-
95
- export interface iPaymentDelay {
96
- today: number;
97
- nextPayment: number;
98
- daysDelay: number
99
- late: boolean
100
- }
101
-
102
- export const cPaymentDalay: iPaymentDelay = {
103
- today: 0,
104
- nextPayment: 0,
105
- daysDelay: 0,
106
- late: false,
107
- }
108
-
109
- //Used for communicate response through services
110
- export interface oResponse {
111
- error?: string;
112
- data: oUser | oUser[] | oBusinessInfo | oAddress |
113
- oSchedule | oFinancial | string | iPaymentDelay |
114
- oClient | oDevice | iConfigUUID | Response | oNotification;
115
- }
116
-
117
- //Used for global interceptor to handle standard response
118
- export interface gResponse {
119
- status?: boolean; // indicates whether resource required was returned
120
- path: string;
121
- statusCode: number;
122
- error?: string;
123
- epochTime: number;
124
- data: any; // att with resources required [Optional]
125
- }
126
-
127
- export interface gResponseFuncEmail {
128
- success: boolean,
129
- message: any
130
- }
131
-
132
- export const snackBarConfigAction: MatSnackBarConfig = {
133
- horizontalPosition: "start"
134
- }
135
- export const snackBarConfigNoAction: MatSnackBarConfig = {
136
- duration: 4000,
137
- horizontalPosition: "start"
138
- }
139
-
140
- export interface iInformativeDialog {
141
- message: string,
142
- title: string,
143
- cancel: string,
144
- continue: string
145
- }
146
-
147
- export interface iSnackBarMessage {
148
- message: string,
149
- action: string,
150
- config: MatSnackBarConfig
151
- }
152
-
153
- //
154
- // export interface iClientContract extends oClient, oContract {
155
- // }
156
-
157
- export type tyClientContract = oClient & oContract
158
-
159
- export const cTyClientContract = {...cClient, ...cContract}
160
-
161
- export interface oContractMetrics {
162
- total: number
163
- activated: number
164
- paused: number
165
- completed: number
166
- canceled: number
167
- late: number
168
- dynamicCount: number
169
- passportCount: number
170
- conektaCount: number
171
- rateTotal: number
172
- rateActive: number
173
- ratePaused: number
174
- rateComplete: number
175
- rateCanceled: number
176
- rateLate: number
177
- }
178
-
179
- export interface HasUnsavedChanges {
180
- hasUnsavedChanges(): boolean;
181
- }
182
-
183
- export interface oPaymentDates {
184
- week: number
185
- date: number
186
- }
@@ -1,43 +0,0 @@
1
- import {WritableSignal} from "@angular/core";
2
-
3
- export enum eAuthActions {
4
- delete = "delete",
5
- auth = "auth"
6
- }
7
-
8
- export enum eAuthType {
9
- auth = "auth",
10
- login = "login",
11
- idle = ""
12
- }
13
-
14
- export interface iAuthConfig {
15
- title: string;
16
- desc: string;
17
- data: boolean;
18
- }
19
-
20
- export const cAuthConfig: iAuthConfig = {
21
- title: "",
22
- desc: "",
23
- data: true,
24
- }
25
-
26
- export interface ISignIn {
27
- username: WritableSignal<string>
28
- password: WritableSignal<string>
29
-
30
- login(credentials: oAuth, destination: string): Promise<void>
31
-
32
- success(): void
33
- }
34
-
35
- export interface oAuth {
36
- username: string,
37
- password: string
38
- }
39
-
40
- export interface oAuthRes {
41
- status: number
42
- data: {}
43
- }
@@ -1,18 +0,0 @@
1
- import {oContract} from "./oContract";
2
- import {oClient} from "./oClient";
3
-
4
- export interface iNewPayment {
5
- getContract(): Promise<void>;
6
-
7
- getContractApi(): Promise<oContract>;
8
-
9
- getClient(contract: oContract): Promise<void>;
10
-
11
- getClientApi(contract: oContract): Promise<oClient>;
12
-
13
- getParams(): Promise<void>
14
-
15
- getAccount(): Promise<boolean>
16
-
17
- createPayment(): Promise<string>;
18
- }
@@ -1,34 +0,0 @@
1
- export const cTopic = "RavCreditClients"
2
-
3
- export enum eNotificationType { GLOBAL = "global", USER = "user", PAYMENT = "payment" }
4
-
5
- export interface oNotificationResponses {
6
- successCount: number,
7
- failureCount: number,
8
- }
9
-
10
- export interface oNotification {
11
- ids?: string[];
12
- type?: string,
13
- tokens?: string[],
14
- topic?: string,
15
- notification: {
16
- title: string,
17
- body: string
18
- },
19
- data: any,
20
- notification_id?: number,
21
- recipient?: string,
22
- responses?: oNotificationResponses
23
- }
24
-
25
- export const cNotification: oNotification = {
26
- notification: {
27
- title: "",
28
- body: ""
29
- },
30
- data: {
31
- route: ""
32
- }
33
- }
34
-
@@ -1,65 +0,0 @@
1
- import {oContract} from "./oContract";
2
-
3
- export enum ePassportTypes {
4
- CREATE = "create_references",
5
- SEND = "send_references"
6
- }
7
-
8
- /** *********************************************************************************/
9
- export interface iPassportAdditional {
10
- client?: string;
11
- clientID?: string;
12
- credit?: string;
13
- }
14
-
15
- export interface iPassportReferenceData {
16
- name: string;
17
- email: string;
18
- amount: number;
19
- expirationDate: string;
20
- additional: iPassportAdditional;
21
- }
22
-
23
- /** Passport request interface base */
24
- export interface iPassportReference {
25
- type: string;
26
- data: iPassportReferenceData;
27
- }
28
-
29
- /** Global passport reference aPI */
30
- export interface iGlobalPassport {
31
- passport: iPassportReference;
32
- contract: oContract
33
- date?: number
34
- }
35
-
36
- /** ******************************** */
37
- export interface iPassportResponseData {
38
- name: string;
39
- email: string;
40
- amount: number;
41
- expirationDate: string;
42
- additional: iPassportAdditional;
43
- }
44
-
45
- export interface iPassportReferenceCenters {
46
- name: string;
47
- logo: string;
48
- }
49
-
50
- export interface iPassportReferenceRes {
51
- reference: string
52
- centers: iPassportReferenceCenters[],
53
- centerId: number,
54
- barcode: string
55
- }
56
-
57
- /** Passport response interface base */
58
- export interface iPassportResponse {
59
- type: string;
60
- data: iPassportResponseData;
61
- message: string;
62
- references: iPassportReference[];
63
- }
64
-
65
- /** ******************************** */
@@ -1,35 +0,0 @@
1
- import {eRoles} from "./oGlobal";
2
- import {WritableSignal} from "@angular/core";
3
-
4
- export interface iUser {
5
- pUser: oUser
6
-
7
- getAllUsers(): void
8
-
9
- editUser(user: oUser): void
10
-
11
- deleteUser(user: oUser): void
12
- }
13
-
14
- export interface oUser {
15
- id: string
16
- username: string,
17
- name: string,
18
- password: string,
19
- role: eRoles,
20
- lastLogin?: number
21
- createdAt?: number,
22
- access_token: string
23
- }
24
-
25
- export interface iServiceUser {
26
- users: WritableSignal<oUser[]>
27
-
28
- getAllUsersServer(): void
29
-
30
- createUser(o: oUser): void
31
-
32
- updateUser(o: oUser): void
33
-
34
- deleteUser(id: string): void
35
- }
@@ -1,48 +0,0 @@
1
- export enum oGenVerificationProvider {
2
- pending, approved, expired
3
- }
4
-
5
- export interface oVerificationLookup {
6
- carrier: any[]
7
- }
8
-
9
- export interface oVerificationSenCodeAttempt {
10
- attempt_sid: any[],
11
- channel: any[],
12
- time: any[]
13
- }
14
-
15
- export interface oGenVerification {
16
- Sid: string
17
- ServiceSid: string,
18
- AccountSid: string,
19
- To: string,
20
- Channel: any,
21
- Status: oGenVerificationProvider,
22
- Valid: boolean,
23
- Lookup: oVerificationLookup,
24
- SendCodeAttempts: oVerificationSenCodeAttempt[],
25
- DateCreated: string,
26
- DateUpdated: string,
27
- Url: string
28
- }
29
-
30
- export interface oVerification {
31
- Sid : string,
32
- ServiceSid : string,
33
- AccountSid : string,
34
- To : string,
35
- Channel : any,
36
- Status : oGenVerificationProvider,
37
- Valid : boolean,
38
- DateCreated : string,
39
- DateUpdated : string
40
- }
41
-
42
- export enum eVerificationStep {
43
- IDLE = "IDLE",
44
- ERROR = "ERROR",
45
- COMPLETED = "COMPLETED",
46
- IN_PROGRESS = "IN_PROGRESS",
47
- INVALID = "INVALID",
48
- }
@@ -1,186 +0,0 @@
1
- import {UntypedFormArray, UntypedFormControl, Validators} from "@angular/forms";
2
- import {
3
- oBusinessConfig,
4
- oBusinessDeadlines,
5
- oBusinessInfo,
6
- oSchedule,
7
- oTmpBusinessConfig,
8
- weekSchedule
9
- } from "../objects/oBusiness";
10
- import {cAddress, oAddress} from '../objects/oAddress';
11
-
12
- export const cSchedule: oSchedule = {
13
- day: "",
14
- open: 0,
15
- close: 0,
16
- }
17
-
18
- export const cEmptyDay: oSchedule = {
19
- close: 0, open: 0, day: ""
20
- }
21
-
22
- export const week: string[] = [
23
- "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"
24
- ]
25
-
26
- export const cDefinedSchedule: oSchedule[] = [
27
- {close: 0, open: 0, day: "monday"},
28
- {close: 0, open: 0, day: "tuesday"},
29
- {close: 0, open: 0, day: "wednesday"},
30
- {close: 0, open: 0, day: "thursday"},
31
- {close: 0, open: 0, day: "friday"},
32
- {close: 0, open: 0, day: "saturday"},
33
- {close: 0, open: 0, day: "sunday"},
34
- ]
35
-
36
- export const cBusinessInfo: oBusinessInfo = {
37
- version: "v2024",
38
- name: "",
39
- address: cAddress,
40
- phones: [],
41
- email: "",
42
- }
43
-
44
- export const cBusinessDeadlines: oBusinessDeadlines = {
45
- weeks: 0,
46
- interest: 0
47
- }
48
-
49
- export const cBusinessConfig: oBusinessConfig = {
50
- version: "",
51
- apiVersion: "",
52
- adminVersion: "",
53
- mobileVersion: "",
54
- mobileVersionPrev: "",
55
- deadlines: [],
56
- downloadsClient: false,
57
- passportPaymentReference: false,
58
- conektaPaymentReference: false,
59
- conektaPaymentLink: false,
60
- dynamicPaymentReference: false,
61
- apkUrl: "https://firebasestorage.googleapis.com/v0/b/ravcredit-2b079.appspot.com/o/mobile-app%2Fapp-release.apk?alt=media&token=ae05f332-a39a-46ad-8a64-312ae1487496"
62
- }
63
-
64
-
65
-
66
- export class FactoryBusiness {
67
-
68
- public static FormBusinessInfo(info?: oBusinessInfo) {
69
- let data = cBusinessInfo
70
-
71
- if (info) data = info
72
-
73
- if (!info?.address) data.address = cAddress
74
-
75
- return {
76
- name: new UntypedFormControl(data.name, Validators.required),
77
- email: new UntypedFormControl(data.email, [Validators.required, Validators.email]),
78
- desc: new UntypedFormControl(data.desc, [Validators.required, Validators.email]),
79
- street: new UntypedFormControl(data.address.street, Validators.required),
80
- neighbor: new UntypedFormControl(data.address.neighbor, Validators.required),
81
- cp: new UntypedFormControl(data.address.zip, Validators.required),
82
- ext: new UntypedFormControl(data.address.ext, Validators.required),
83
- int: new UntypedFormControl(data.address.int),
84
- city: new UntypedFormControl(data.address.city, Validators.required),
85
- state: new UntypedFormControl(data.address.state, Validators.required),
86
- phones: new UntypedFormControl(data.phones),
87
- mondayOpen: new UntypedFormControl(data.schedule?.monday.open),
88
- mondayClose: new UntypedFormControl(data.schedule?.monday.close),
89
- tuesdayOpen: new UntypedFormControl(data.schedule?.tuesday.open),
90
- tuesdayClose: new UntypedFormControl(data.schedule?.tuesday.close),
91
- wednesdayOpen: new UntypedFormControl(data.schedule?.wednesday.open),
92
- wednesdayClose: new UntypedFormControl(data.schedule?.wednesday.close),
93
- thursdayOpen: new UntypedFormControl(data.schedule?.thursday.open),
94
- thursdayClose: new UntypedFormControl(data.schedule?.thursday.close),
95
- fridayOpen: new UntypedFormControl(data.schedule?.friday.open),
96
- fridayClose: new UntypedFormControl(data.schedule?.friday.close),
97
- saturdayOpen: new UntypedFormControl(data.schedule?.saturday.open),
98
- saturdayClose: new UntypedFormControl(data.schedule?.saturday.close),
99
- sundayOpen: new UntypedFormControl(data.schedule?.sunday.open),
100
- sundayClose: new UntypedFormControl(data.schedule?.sunday.close),
101
- }
102
-
103
- }
104
-
105
- public static CreateBusinessInfoObj(data: oTmpBusinessConfig) {
106
- const address: oAddress = cAddress
107
- const schedule: weekSchedule = {
108
- monday: {},
109
- tuesday: {},
110
- wednesday: {},
111
- thursday: {},
112
- friday: {},
113
- saturday: {},
114
- sunday: {}
115
- }
116
-
117
- if (data.street) address.street = data.street
118
- if (data.state) address.state = data.state
119
- if (data.neighbor) address.neighbor = data.neighbor
120
- if (data.city) address.city = data.city
121
- if (data.ext) address.ext = data.ext
122
- if (data.int) address.int = data.int
123
- if (data.cp) address.zip = data.cp
124
-
125
- if (data.mondayOpen) schedule.monday.open = data.mondayOpen
126
- if (data.mondayClose) schedule.monday.close = data.mondayClose
127
-
128
- if (data.tuesdayOpen) schedule.tuesday.open = data.tuesdayOpen
129
- if (data.tuesdayClose) schedule.tuesday.close = data.tuesdayClose
130
-
131
- if (data.wednesdayOpen) schedule.wednesday.open = data.wednesdayOpen
132
- if (data.wednesdayClose) schedule.wednesday.close = data.wednesdayClose
133
-
134
- if (data.thursdayOpen) schedule.thursday.open = data.thursdayOpen
135
- if (data.thursdayClose) schedule.thursday.close = data.thursdayClose
136
-
137
- if (data.fridayOpen) schedule.friday.open = data.fridayOpen
138
- if (data.fridayClose) schedule.friday.close = data.fridayClose
139
-
140
- if (data.saturdayOpen) schedule.saturday.open = data.saturdayOpen
141
- if (data.saturdayClose) schedule.saturday.close = data.saturdayClose
142
-
143
- if (data.sundayOpen) schedule.sunday.open = data.sundayOpen
144
- if (data.sundayClose) schedule.sunday.close = data.sundayClose
145
-
146
- const info: oBusinessInfo = {
147
- version: "v2024",
148
- name: data.name ? data.name : "",
149
- address: address,
150
- phones: data.phones ? data.phones : [],
151
- email: data.email ? data.email : "",
152
- schedule: schedule,
153
- desc: data.desc ? data.desc : ""
154
- }
155
-
156
- return info
157
- }
158
-
159
- public static FormDeadlineConfig(data: oBusinessDeadlines) {
160
- // if (!data) data = cBusinessDeadlines
161
-
162
- return {
163
- weeks: new UntypedFormControl(data.weeks),
164
- interest: new UntypedFormControl(data.interest),
165
- }
166
- }
167
-
168
-
169
- public static FormBusinessConfig(config?: oBusinessConfig) {
170
- let data = cBusinessConfig
171
- if (config) data = config
172
-
173
- return {
174
- downloadsClient: new UntypedFormControl(data.downloadsClient),
175
- passportPaymentReference: new UntypedFormControl(data.passportPaymentReference),
176
- conektaPaymentReference: new UntypedFormControl(data.conektaPaymentReference),
177
- conektaPaymentLink: new UntypedFormControl(data.conektaPaymentLink),
178
- dynamicPaymentReference: new UntypedFormControl(data.dynamicPaymentReference),
179
- deadlines: new UntypedFormArray([])
180
- }
181
- }
182
-
183
- public static testBusiness(message: string) {
184
- return `Message ${message}`
185
- }
186
- }