Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
ca95363
name fix
alacret Dec 17, 2019
d24fe89
enlarging name on field
alacret Dec 17, 2019
5ab6b94
adding app version
alacret Dec 17, 2019
726739e
Merge branch 'develop'
alacret Dec 17, 2019
731c0a7
admin
alacret Dec 17, 2019
6f96c66
admin
alacret Dec 17, 2019
c27ea76
develop
alesanchezr Dec 17, 2019
8e62836
develop
alesanchezr Dec 17, 2019
1dd7c97
documents revamp
alesanchezr Dec 17, 2019
a089e11
documents revamp
alesanchezr Dec 17, 2019
b0c3ca4
seed api version
alacret Dec 17, 2019
0555fb2
fixed the docuemnts tests
alesanchezr Dec 18, 2019
0cbeb2e
Merge branch 'develop' of https://github.com/JobCore/api into develop
alesanchezr Dec 18, 2019
00a6972
cleaning up
alacret Dec 18, 2019
a75bf15
updated app version model
alesanchezr Dec 18, 2019
d5b3abd
Merge branch 'develop' of github.com:JobCore/api into develop
alacret Dec 18, 2019
f5ba651
implemented the logic for documents
alesanchezr Dec 18, 2019
b6c7717
app version field
alacret Dec 18, 2019
c487d20
app version field
alacret Dec 18, 2019
d1d51fb
manage user
alesanchezr Dec 18, 2019
1086f1c
Merge branch 'develop' of https://github.com/JobCore/api into develop
alesanchezr Dec 18, 2019
0be38a5
merge migrations
alacret Dec 19, 2019
8ea3ed2
hide venues and locations instead of deleting them
alesanchezr Dec 19, 2019
3249781
documents instead of document
alesanchezr Dec 19, 2019
f1f2534
Merge branch 'develop' of https://github.com/JobCore/api into develop
alesanchezr Dec 19, 2019
6f77e3a
migration merge fixed
alesanchezr Dec 19, 2019
8cbab5d
fixing migrations
alesanchezr Dec 20, 2019
e5da931
recreate migrations
alacret Dec 20, 2019
64278a0
fixed registration
alesanchezr Dec 20, 2019
2fe3bbf
fixed registration
alesanchezr Dec 20, 2019
4df518e
admin for documents
alesanchezr Dec 20, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,39 @@ class ShiftInviteAdmin(admin.ModelAdmin):

class ClockinAdmin(admin.ModelAdmin):
list_display = ('id', 'employee', 'started_at', 'ended_at', 'shift', 'author')
search_fields = ('employee__user__first_name', 'employee__user__last_name', 'employee__user__email', 'author__user__first_name', 'author__user__last_name')
search_fields = (
'employee__user__first_name', 'employee__user__last_name', 'employee__user__email', 'author__user__first_name',
'author__user__last_name')
list_filter = ('status',)
list_per_page = 100


class EmployeeDocumentAdmin(admin.ModelAdmin):
list_display = ('id', 'document', 'get_name', 'status', 'created_at', 'updated_at')
search_fields = (
'state', 'name', 'employee__user__first_name', 'employee__user__last_name', 'employee__user__email')
list_filter = ('status','document_type__validates_identity','document_type__validates_employment','document_type__is_form')
list_per_page = 100

def get_name(self, obj):
return obj.document_type.title if obj.document_type is not None else 'Missing document type'
admin.site.register(EmployeeDocument, EmployeeDocumentAdmin)
class DocumentAdmin(admin.ModelAdmin):
list_display = ('id', 'title', 'validates_identity', 'validates_employment', 'is_form')
admin.site.register(Document, DocumentAdmin)




admin.site.register(Clockin, ClockinAdmin)

admin.site.register(UserToken)
admin.site.register(Notification)
admin.site.register(JobCoreInvite)
admin.site.register(BankAccount)
admin.site.register(EmployeeDocument)

class AppVersionAdmin(admin.ModelAdmin):
list_display = ('id', 'version', 'force_update', 'created_at', 'updated_at')
admin.site.register(AppVersion, AppVersionAdmin)

admin.site.register(PaymentDeduction)
# admin.site.register(City)
50 changes: 50 additions & 0 deletions api/fixtures/development/5-document.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
- model: api.Document
pk: 1
fields:
title: US Passport
validates_identity: True
validates_employment: True
is_form: False
created_at: "2018-09-13T19:45:00Z"
updated_at: "2018-09-13T19:45:00Z"

- model: api.Document
pk: 2
fields:
title: Permanent Resident Card or Alien Registration Receipt Card (Form I-551)
validates_identity: True
validates_employment: True
is_form: False
created_at: "2018-09-13T19:45:00Z"
updated_at: "2018-09-13T19:45:00Z"

- model: api.Document
pk: 3
fields:
title: Divers License
validates_identity: True
validates_employment: False
is_form: False
created_at: "2018-09-13T19:45:00Z"
updated_at: "2018-09-13T19:45:00Z"

- model: api.Document
pk: 4
fields:
title: I-94
validates_identity: False
validates_employment: True
is_form: False
created_at: "2018-09-13T19:45:00Z"
updated_at: "2018-09-13T19:45:00Z"


- model: api.Document
pk: 5
fields:
title: W4 Form
validates_identity: False
validates_employment: False
is_form: True
created_at: "2018-09-13T19:45:00Z"
updated_at: "2018-09-13T19:45:00Z"
4 changes: 3 additions & 1 deletion api/management/commands/process_expired.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ def handle(self, *args, **options):
#log = []

hooks.process_expired_shifts()
self.stdout.write(self.style.SUCCESS("Successfully expired shifts and clockins"))

self.stdout.write(self.style.SUCCESS("Successfully expired everything"))
hooks.process_expired_documents()
self.stdout.write(self.style.SUCCESS("Successfully expired documents"))
3 changes: 3 additions & 0 deletions api/management/commands/reset_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,7 @@ def handle(self, *args, **options):
log.insert(0, "Deleting PayrollPeriodPayments...")
PayrollPeriodPayment.objects.all().delete()

log.insert(0, "Deleting Documents...")
Document.objects.all().delete()

self.stdout.write(self.style.SUCCESS("Successfully deleted all models"))
18 changes: 18 additions & 0 deletions api/migrations/0055_auto_20191217_1631.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.4 on 2019-12-17 16:31

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0054_employee_document_active'),
]

operations = [
migrations.AlterField(
model_name='employeedocument',
name='name',
field=models.CharField(blank=True, max_length=150, null=True),
),
]
45 changes: 45 additions & 0 deletions api/migrations/0055_auto_20191217_2021.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Generated by Django 2.2.6 on 2019-12-17 20:21

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('api', '0054_employee_document_active'),
]

operations = [
migrations.CreateModel(
name='Document',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(blank=True, max_length=50, null=True)),
('validates_identity', models.BooleanField(default=False)),
('validates_employment', models.BooleanField(default=False)),
('is_form', models.BooleanField(default=False)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
),
migrations.RenameField(
model_name='employeedocument',
old_name='state',
new_name='status',
),
migrations.RemoveField(
model_name='employee',
name='document_active',
),
migrations.AddField(
model_name='employee',
name='employment_verification_status',
field=models.CharField(blank=True, choices=[('NOT_APPROVED', 'Not Approved'), ('PENDING', 'Pending'), ('BEING_REVIEWED', 'Being Reviews'), ('APPROVED', 'Approved')], default='NOT_APPROVED', max_length=25),
),
migrations.AddField(
model_name='employeedocument',
name='document_type',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='api.Document'),
),
]
22 changes: 22 additions & 0 deletions api/migrations/0056_appversion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Generated by Django 2.2.4 on 2019-12-17 18:28

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0055_auto_20191217_1631'),
]

operations = [
migrations.CreateModel(
name='AppVersion',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('version', models.IntegerField(default=94)),
('created_at', models.DateTimeField(auto_now_add=True)),
('updated_at', models.DateTimeField(auto_now=True)),
],
),
]
18 changes: 18 additions & 0 deletions api/migrations/0056_auto_20191217_2023.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.6 on 2019-12-17 20:23

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0055_auto_20191217_2021'),
]

operations = [
migrations.AlterField(
model_name='document',
name='title',
field=models.CharField(blank=True, max_length=250, null=True),
),
]
18 changes: 18 additions & 0 deletions api/migrations/0057_auto_20191217_2044.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.2.6 on 2019-12-17 20:44

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0056_auto_20191217_2023'),
]

operations = [
migrations.AlterField(
model_name='employeedocument',
name='public_id',
field=models.CharField(max_length=80, null=True),
),
]
14 changes: 14 additions & 0 deletions api/migrations/0058_merge_20191217_2131.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 2.2.6 on 2019-12-17 21:31

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('api', '0056_appversion'),
('api', '0057_auto_20191217_2044'),
]

operations = [
]
47 changes: 47 additions & 0 deletions api/migrations/0059_auto_20191218_1649.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Generated by Django 2.2.6 on 2019-12-18 16:49

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0058_merge_20191217_2131'),
]

operations = [
migrations.RemoveField(
model_name='employeedocument',
name='name',
),
migrations.AddField(
model_name='appversion',
name='change_log',
field=models.TextField(blank=True, max_length=450),
),
migrations.AddField(
model_name='appversion',
name='force_update',
field=models.BooleanField(default=False),
),
migrations.AddField(
model_name='position',
name='description',
field=models.TextField(blank=True, max_length=1050),
),
migrations.AddField(
model_name='position',
name='meta_description',
field=models.TextField(blank=True, max_length=250),
),
migrations.AddField(
model_name='position',
name='meta_keywords',
field=models.TextField(blank=True, max_length=250),
),
migrations.AlterField(
model_name='appversion',
name='version',
field=models.CharField(default=94, max_length=10, unique=True),
),
]
23 changes: 23 additions & 0 deletions api/migrations/0060_auto_20191218_1804.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 2.2.6 on 2019-12-18 18:04

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0059_auto_20191218_1649'),
]

operations = [
migrations.AddField(
model_name='employeedocument',
name='expired_at',
field=models.DateTimeField(blank=True, null=True),
),
migrations.AlterField(
model_name='employeedocument',
name='status',
field=models.CharField(choices=[('PENDING', 'Pending'), ('APPROVED', 'Approved'), ('ARCHIVED', 'Archived'), ('REJECTED', 'Rejected')], default='PENDING', max_length=8),
),
]
23 changes: 23 additions & 0 deletions api/migrations/0060_auto_20191218_1827.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 2.2.4 on 2019-12-18 18:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0059_auto_20191218_1649'),
]

operations = [
migrations.AddField(
model_name='appversion',
name='build_number',
field=models.IntegerField(default=94),
),
migrations.AlterField(
model_name='appversion',
name='version',
field=models.CharField(default='94', max_length=10, unique=True),
),
]
38 changes: 38 additions & 0 deletions api/migrations/0061_auto_20191218_1824.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Generated by Django 2.2.6 on 2019-12-18 18:24

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('api', '0060_auto_20191218_1804'),
]

operations = [
migrations.AddField(
model_name='employee',
name='allowances',
field=models.IntegerField(blank=True, default=0),
),
migrations.AddField(
model_name='employee',
name='extra_withholding',
field=models.FloatField(blank=True, default=0),
),
migrations.AddField(
model_name='employee',
name='filing_status',
field=models.CharField(blank=True, choices=[('SINGLE', 'Single'), ('MARRIED_JOINTLY', 'Married filing jointly'), ('MARRIED_SEPARATELY', 'Married filing separately'), ('HEAD', 'Head of household'), ('WIDOWER', 'Qualifying widow(er) with dependent child')], default='SINGLE', max_length=25),
),
migrations.AlterField(
model_name='employee',
name='employment_verification_status',
field=models.CharField(blank=True, choices=[('NOT_APPROVED', 'Not Approved'), ('PENDING', 'Pending'), ('BEING_REVIEWED', 'Being Reviewed'), ('APPROVED', 'Approved')], default='NOT_APPROVED', max_length=25),
),
migrations.AlterField(
model_name='employeedocument',
name='status',
field=models.CharField(choices=[('PENDING', 'Pending'), ('APPROVED', 'Approved'), ('ARCHIVED', 'Archived'), ('DELETED', 'Deleted'), ('REJECTED', 'Rejected')], default='PENDING', max_length=8),
),
]
Loading