@kanda-libs/ks-schema 1.0.116 → 1.0.118

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 (80) hide show
  1. package/dist/components/schemas/Company.d.ts +9 -2
  2. package/dist/components/schemas/Company.d.ts.map +1 -1
  3. package/dist/components/schemas/Company.js +2 -0
  4. package/dist/components/schemas/CompanyInfo.d.ts +8 -0
  5. package/dist/components/schemas/CompanyInfo.d.ts.map +1 -1
  6. package/dist/components/schemas/CompanyInfo.js +2 -0
  7. package/dist/components/schemas/ContactInfo.d.ts +2 -0
  8. package/dist/components/schemas/ContactInfo.d.ts.map +1 -1
  9. package/dist/components/schemas/ContactInfo.js +1 -0
  10. package/dist/components/schemas/ContractAgreement.d.ts +14 -0
  11. package/dist/components/schemas/ContractAgreement.d.ts.map +1 -0
  12. package/dist/components/schemas/ContractAgreement.js +34 -0
  13. package/dist/components/schemas/Entity.d.ts +558 -0
  14. package/dist/components/schemas/Entity.d.ts.map +1 -0
  15. package/dist/components/schemas/Entity.js +41 -0
  16. package/dist/components/schemas/Event.d.ts +550 -8
  17. package/dist/components/schemas/Event.d.ts.map +1 -1
  18. package/dist/components/schemas/Event.js +5 -4
  19. package/dist/components/schemas/Identity.d.ts +30 -0
  20. package/dist/components/schemas/Identity.d.ts.map +1 -0
  21. package/dist/components/schemas/Identity.js +37 -0
  22. package/dist/components/schemas/InfoCompany.d.ts +23 -5
  23. package/dist/components/schemas/InfoCompany.d.ts.map +1 -1
  24. package/dist/components/schemas/InfoCompany.js +8 -10
  25. package/dist/components/schemas/JobCompanyInfo.d.ts +1 -0
  26. package/dist/components/schemas/JobCompanyInfo.d.ts.map +1 -1
  27. package/dist/components/schemas/Subscription.d.ts +0 -24
  28. package/dist/components/schemas/Subscription.d.ts.map +1 -1
  29. package/dist/components/schemas/Subscription.js +0 -2
  30. package/dist/components/schemas/index.d.ts +3 -0
  31. package/dist/components/schemas/index.d.ts.map +1 -1
  32. package/dist/components/schemas/index.js +3 -0
  33. package/dist/operations/approveCompany.d.ts +8 -1
  34. package/dist/operations/approveCompany.d.ts.map +1 -1
  35. package/dist/operations/declineCompany.d.ts +206 -0
  36. package/dist/operations/declineCompany.d.ts.map +1 -0
  37. package/dist/operations/declineCompany.js +50 -0
  38. package/dist/operations/deleteCompany.d.ts +8 -1
  39. package/dist/operations/deleteCompany.d.ts.map +1 -1
  40. package/dist/operations/deleteSubscription.d.ts +0 -22
  41. package/dist/operations/deleteSubscription.d.ts.map +1 -1
  42. package/dist/operations/directorCompany.d.ts +8 -1
  43. package/dist/operations/directorCompany.d.ts.map +1 -1
  44. package/dist/operations/getCompanies.d.ts +8 -1
  45. package/dist/operations/getCompanies.d.ts.map +1 -1
  46. package/dist/operations/getCompany.d.ts +8 -1
  47. package/dist/operations/getCompany.d.ts.map +1 -1
  48. package/dist/operations/getCompanyIdentity.d.ts +121 -0
  49. package/dist/operations/getCompanyIdentity.d.ts.map +1 -0
  50. package/dist/operations/getCompanyIdentity.js +50 -0
  51. package/dist/operations/getSubscription.d.ts +0 -22
  52. package/dist/operations/getSubscription.d.ts.map +1 -1
  53. package/dist/operations/getSubscriptions.d.ts +0 -22
  54. package/dist/operations/getSubscriptions.d.ts.map +1 -1
  55. package/dist/operations/index.d.ts +595 -230
  56. package/dist/operations/index.d.ts.map +1 -1
  57. package/dist/operations/index.js +12 -0
  58. package/dist/operations/infoCompany.d.ts +20 -4
  59. package/dist/operations/infoCompany.d.ts.map +1 -1
  60. package/dist/operations/jobCompanyInfo.d.ts +1 -0
  61. package/dist/operations/jobCompanyInfo.d.ts.map +1 -1
  62. package/dist/operations/pendingSubscription.d.ts +0 -22
  63. package/dist/operations/pendingSubscription.d.ts.map +1 -1
  64. package/dist/operations/postCompany.d.ts +8 -1
  65. package/dist/operations/postCompany.d.ts.map +1 -1
  66. package/dist/operations/postCompanyIdentity.d.ts +126 -0
  67. package/dist/operations/postCompanyIdentity.d.ts.map +1 -0
  68. package/dist/operations/postCompanyIdentity.js +56 -0
  69. package/dist/operations/postSubscription.d.ts +0 -22
  70. package/dist/operations/postSubscription.d.ts.map +1 -1
  71. package/dist/operations/putCompany.d.ts +8 -1
  72. package/dist/operations/putCompany.d.ts.map +1 -1
  73. package/dist/operations/putSubscription.d.ts +0 -22
  74. package/dist/operations/putSubscription.d.ts.map +1 -1
  75. package/dist/schema.json +1 -1
  76. package/dist/widget/index.d.ts +8570 -2584
  77. package/dist/widget/index.d.ts.map +1 -1
  78. package/dist/widget/index.js +12471 -5345
  79. package/package.json +1 -1
  80. package/schema.yaml +236 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kanda-libs/ks-schema",
3
- "version": "1.0.116",
3
+ "version": "1.0.118",
4
4
  "description": "Kanda Service OpenAPI Schema",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/schema.yaml CHANGED
@@ -488,6 +488,81 @@ paths:
488
488
  schema:
489
489
  $ref: "#/components/schemas/Error"
490
490
 
491
+ /api/company/{id}/identity:
492
+ get:
493
+ operationId: getCompanyIdentity
494
+ summary: get owner / director info from company
495
+ tags:
496
+ - Company
497
+ parameters:
498
+ - name: id
499
+ in: path
500
+ description: company id
501
+ required: true
502
+ schema:
503
+ type: string
504
+ minLength: 1
505
+ - name: email
506
+ in: query
507
+ description: filter owner / director by email
508
+ schema:
509
+ type: string
510
+ minLength: 1
511
+ responses:
512
+ 200:
513
+ description: got owner / director info from company
514
+ content:
515
+ application/json:
516
+ schema:
517
+ $ref: "#/components/schemas/InfoCompany"
518
+ default:
519
+ description: unexpected error
520
+ content:
521
+ application/json:
522
+ schema:
523
+ $ref: "#/components/schemas/Error"
524
+
525
+ post:
526
+ operationId: postCompanyIdentity
527
+ summary: owner / director to submit ID verification
528
+ tags:
529
+ - Company
530
+ parameters:
531
+ - name: id
532
+ in: path
533
+ description: company id
534
+ required: true
535
+ schema:
536
+ type: string
537
+ minLength: 1
538
+ - name: email
539
+ in: query
540
+ description: owner / director email
541
+ required: true
542
+ schema:
543
+ type: string
544
+ minLength: 1
545
+ requestBody:
546
+ description: submit owner / director ID verification
547
+ required: true
548
+ content:
549
+ application/json:
550
+ schema:
551
+ $ref: "#/components/schemas/Identity"
552
+ responses:
553
+ 200:
554
+ description: submitted owner / director ID verification
555
+ content:
556
+ application/json:
557
+ schema:
558
+ $ref: "#/components/schemas/InfoCompany"
559
+ default:
560
+ description: unexpected error
561
+ content:
562
+ application/json:
563
+ schema:
564
+ $ref: "#/components/schemas/Error"
565
+
491
566
  /api/company/{id}/director:
492
567
  post:
493
568
  operationId: directorCompany
@@ -546,6 +621,50 @@ paths:
546
621
  schema:
547
622
  $ref: "#/components/schemas/Error"
548
623
 
624
+ /api/company/{id}/decline:
625
+ post:
626
+ operationId: declineCompany
627
+ summary: >
628
+ kanda staff to reject or decline company and mark its lifecycle declined,
629
+ apart from improper insurance document, all declines will disable company
630
+ and suspend and disable all users associated with the company.
631
+ for improper insurance document, document will be removed and lifecycle
632
+ re-calculated so tradesperson can upload a correct one again.
633
+ tags:
634
+ - Company
635
+ parameters:
636
+ - name: id
637
+ in: path
638
+ description: company id
639
+ required: true
640
+ schema:
641
+ type: string
642
+ minLength: 1
643
+ - name: reason
644
+ in: query
645
+ description: reject or decline reason
646
+ required: true
647
+ schema:
648
+ type: string
649
+ enum:
650
+ - "failed_checks"
651
+ - "fraudulent"
652
+ - "improper_insurance"
653
+ - "unsupported_trade"
654
+ responses:
655
+ 200:
656
+ description: got rejected or declined company
657
+ content:
658
+ application/json:
659
+ schema:
660
+ $ref: "#/components/schemas/Company"
661
+ default:
662
+ description: unexpected error
663
+ content:
664
+ application/json:
665
+ schema:
666
+ $ref: "#/components/schemas/Error"
667
+
549
668
  /api/job:
550
669
  get:
551
670
  operationId: getJobs
@@ -2084,13 +2203,16 @@ components:
2084
2203
 
2085
2204
  InfoCompany:
2086
2205
  type: object
2087
- required:
2088
- - limited_company
2089
2206
  properties:
2090
2207
  id:
2091
2208
  type: string
2092
2209
  title: company info unique id
2093
2210
  readOnly: true
2211
+ sole_trader:
2212
+ type: object
2213
+ title: sole trader info
2214
+ $ref: "#/components/schemas/SoleTraderInfo"
2215
+ readOnly: true
2094
2216
  limited_company:
2095
2217
  type: object
2096
2218
  title: limited company info
@@ -2188,8 +2310,10 @@ components:
2188
2310
  - subscribed
2189
2311
  - director_info_provided
2190
2312
  - onboarded
2313
+ - insurance_uploaded
2191
2314
  - completed_setup
2192
2315
  - verified
2316
+ - declined
2193
2317
  default: registered
2194
2318
  readOnly: true
2195
2319
  billing:
@@ -2298,6 +2422,38 @@ components:
2298
2422
  type: object
2299
2423
  title: insurance document
2300
2424
  $ref: "#/components/schemas/Document"
2425
+ contract_agreement:
2426
+ type: object
2427
+ title: contract agreement
2428
+ $ref: "#/components/schemas/ContractAgreement"
2429
+
2430
+ ContractAgreement:
2431
+ type: object
2432
+ title: contract agreement
2433
+ properties:
2434
+ agreed_terms_and_conditions:
2435
+ type: string
2436
+ title: agreed terms and conditions
2437
+ enum:
2438
+ - "yes"
2439
+ - "no"
2440
+ default: "no"
2441
+ agreed_to_become_iar_of_kanda:
2442
+ type: string
2443
+ title: agreed to become IAR of Kanda
2444
+ enum:
2445
+ - "yes"
2446
+ - "no"
2447
+ default: "no"
2448
+ print_name:
2449
+ type: string
2450
+ title: print name
2451
+ minLength: 1
2452
+ signed_at:
2453
+ type: string
2454
+ title: signed at
2455
+ format: date-time
2456
+ readOnly: true
2301
2457
 
2302
2458
  ContactInfo:
2303
2459
  type: object
@@ -2317,6 +2473,9 @@ components:
2317
2473
  type: object
2318
2474
  title: contact address
2319
2475
  $ref: "#/components/schemas/Address"
2476
+ trading_name:
2477
+ type: string
2478
+ title: trading name
2320
2479
 
2321
2480
  Document:
2322
2481
  type: object
@@ -2408,6 +2567,41 @@ components:
2408
2567
  $ref: "#/components/schemas/Address"
2409
2568
  title: trading address
2410
2569
 
2570
+ Identity:
2571
+ type: object
2572
+ required:
2573
+ - first_name
2574
+ - last_name
2575
+ - email
2576
+ - mobile
2577
+ - date_of_birth
2578
+ - home_address
2579
+ properties:
2580
+ first_name:
2581
+ type: string
2582
+ title: first name
2583
+ minLength: 1
2584
+ last_name:
2585
+ type: string
2586
+ title: last name
2587
+ minLength: 1
2588
+ email:
2589
+ type: string
2590
+ format: email
2591
+ title: email
2592
+ mobile:
2593
+ type: string
2594
+ title: mobile
2595
+ minLength: 1
2596
+ date_of_birth:
2597
+ type: string
2598
+ title: date of birth
2599
+ format: date-time
2600
+ home_address:
2601
+ type: object
2602
+ $ref: "#/components/schemas/Address"
2603
+ title: home address
2604
+
2411
2605
  DirectorInfo:
2412
2606
  type: object
2413
2607
  required:
@@ -3393,12 +3587,6 @@ components:
3393
3587
  title: subscription amount
3394
3588
  $ref: "#/components/schemas/Money"
3395
3589
  readOnly: true
3396
- events:
3397
- type: array
3398
- title: subscription events
3399
- items:
3400
- $ref: "#/components/schemas/Event"
3401
- readOnly: true
3402
3590
  xid:
3403
3591
  type: string
3404
3592
  title: external reference id
@@ -3418,6 +3606,7 @@ components:
3418
3606
  title: event
3419
3607
  required:
3420
3608
  - id
3609
+ - rid
3421
3610
  - cid
3422
3611
  - oid
3423
3612
  - resource
@@ -3429,6 +3618,10 @@ components:
3429
3618
  type: string
3430
3619
  title: event id
3431
3620
  readOnly: true
3621
+ rid:
3622
+ type: string
3623
+ title: request id
3624
+ readOnly: true
3432
3625
  cid:
3433
3626
  type: string
3434
3627
  title: company id
@@ -3441,18 +3634,6 @@ components:
3441
3634
  type: string
3442
3635
  title: author id
3443
3636
  readOnly: true
3444
- resource:
3445
- type: string
3446
- title: event resource
3447
- readOnly: true
3448
- resource_id:
3449
- type: string
3450
- title: event resource id
3451
- readOnly: true
3452
- action:
3453
- type: string
3454
- title: event action
3455
- readOnly: true
3456
3637
  source:
3457
3638
  type: string
3458
3639
  title: event source
@@ -3461,9 +3642,18 @@ components:
3461
3642
  - kanda
3462
3643
  - webhook
3463
3644
  readOnly: true
3464
- result:
3645
+ action:
3465
3646
  type: string
3466
- title: event result
3647
+ title: event action
3648
+ readOnly: true
3649
+ success:
3650
+ type: boolean
3651
+ title: success
3652
+ readOnly: true
3653
+ entity:
3654
+ type: object
3655
+ $ref: "#/components/schemas/Entity"
3656
+ title: entity
3467
3657
  readOnly: true
3468
3658
  error:
3469
3659
  type: object
@@ -3475,6 +3665,30 @@ components:
3475
3665
  title: metadata
3476
3666
  readOnly: true
3477
3667
 
3668
+ Entity:
3669
+ type: object
3670
+ title: entity
3671
+ description: entity record
3672
+ properties:
3673
+ company:
3674
+ $ref: "#/components/schemas/Company"
3675
+ readOnly: true
3676
+ credit:
3677
+ $ref: "#/components/schemas/Credit"
3678
+ readOnly: true
3679
+ document:
3680
+ $ref: "#/components/schemas/Document"
3681
+ readOnly: true
3682
+ job:
3683
+ $ref: "#/components/schemas/Job"
3684
+ readOnly: true
3685
+ payment:
3686
+ $ref: "#/components/schemas/Payment"
3687
+ readOnly: true
3688
+ subscription:
3689
+ $ref: "#/components/schemas/Subscription"
3690
+ readOnly: true
3691
+
3478
3692
  InfoValidationEmail:
3479
3693
  type: object
3480
3694
  properties: